diff --git a/main.c b/main.c index 8c956ce..339db86 100644 --- a/main.c +++ b/main.c @@ -16,6 +16,7 @@ #include "Crystalfontz128x128_ST7735.h" #include #include "buttons.h" +#include "sampling.h" #include #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 } -} \ No newline at end of file +} diff --git a/sampling.c b/sampling.c index f661b22..2070218 100644 --- a/sampling.c +++ b/sampling.c @@ -11,9 +11,8 @@ #include "inc/hw_memmap.h" #include #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 diff --git a/sampling.h b/sampling.h new file mode 100644 index 0000000..69ea810 --- /dev/null +++ b/sampling.h @@ -0,0 +1,11 @@ +#ifndef SAMPLING_H_ +#define SAMPLING_H_ + +#include + +#define ADC_BUFFER_SIZE 2048 // size must be a power of 2 + +// initialize ADC and ISR +void start_sampler(void); + +#endif /* SAMPLING_H_ */