add sampling.h

This commit is contained in:
Andy Killorin 2025-03-27 10:41:57 -04:00
parent 1d2833a282
commit aca9fc79ac
Signed by: ank
GPG key ID: 23F9463ECB67FE8C
3 changed files with 14 additions and 3 deletions

1
main.c
View file

@ -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"

View file

@ -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
View 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_ */