From aca9fc79ac0ef34107587d05e8671f937f80b8c7 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Thu, 27 Mar 2025 10:41:57 -0400 Subject: [PATCH] add sampling.h --- main.c | 3 ++- sampling.c | 3 +-- sampling.h | 11 +++++++++++ 3 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 sampling.h 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_ */