add sampling.h
This commit is contained in:
parent
1d2833a282
commit
aca9fc79ac
3 changed files with 14 additions and 3 deletions
1
main.c
1
main.c
|
@ -16,6 +16,7 @@
|
||||||
#include "Crystalfontz128x128_ST7735.h"
|
#include "Crystalfontz128x128_ST7735.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "buttons.h"
|
#include "buttons.h"
|
||||||
|
#include "sampling.h"
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include "inc/hw_memmap.h"
|
#include "inc/hw_memmap.h"
|
||||||
#include "driverlib/gpio.h"
|
#include "driverlib/gpio.h"
|
||||||
|
|
|
@ -11,9 +11,8 @@
|
||||||
#include "inc/hw_memmap.h"
|
#include "inc/hw_memmap.h"
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include "buttons.h"
|
#include "buttons.h"
|
||||||
|
#include "sampling.h"
|
||||||
|
|
||||||
|
|
||||||
#define ADC_BUFFER_SIZE 2048 // size must be a power of 2
|
|
||||||
// index wrapping macro
|
// index wrapping macro
|
||||||
#define ADC_BUFFER_WRAP(i) ((i) & (ADC_BUFFER_SIZE - 1))
|
#define ADC_BUFFER_WRAP(i) ((i) & (ADC_BUFFER_SIZE - 1))
|
||||||
// latest sample index
|
// 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