add sampling.h
This commit is contained in:
parent
1d2833a282
commit
aca9fc79ac
3 changed files with 14 additions and 3 deletions
3
main.c
3
main.c
|
@ -16,6 +16,7 @@
|
|||
#include "Crystalfontz128x128_ST7735.h"
|
||||
#include <stdio.h>
|
||||
#include "buttons.h"
|
||||
#include "sampling.h"
|
||||
#include <math.h>
|
||||
#include "inc/hw_memmap.h"
|
||||
#include "driverlib/gpio.h"
|
||||
|
@ -109,4 +110,4 @@ int main(void) {
|
|||
|
||||
GrFlush(&sContext); // flush the frame buffer to the LCD
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,9 +11,8 @@
|
|||
#include "inc/hw_memmap.h"
|
||||
#include <math.h>
|
||||
#include "buttons.h"
|
||||
#include "sampling.h"
|
||||
|
||||
|
||||
#define ADC_BUFFER_SIZE 2048 // size must be a power of 2
|
||||
// index wrapping macro
|
||||
#define ADC_BUFFER_WRAP(i) ((i) & (ADC_BUFFER_SIZE - 1))
|
||||
// latest sample index
|
||||
|
|
11
sampling.h
Normal file
11
sampling.h
Normal file
|
@ -0,0 +1,11 @@
|
|||
#ifndef SAMPLING_H_
|
||||
#define SAMPLING_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define ADC_BUFFER_SIZE 2048 // size must be a power of 2
|
||||
|
||||
// initialize ADC and ISR
|
||||
void start_sampler(void);
|
||||
|
||||
#endif /* SAMPLING_H_ */
|
Loading…
Reference in a new issue