ADC
8.0
Analog to Digital Conversor library for the Teensy 3.5 microprocessor
|
26 #ifndef RINGBUFFERDMA_H
27 #define RINGBUFFERDMA_H
30 #include "DMAChannel.h"
39 RingBufferDMA(
volatile int16_t* elems, uint32_t len, uint8_t ADC_num = 0);
54 void start(
void (*call_dma_isr)(
void));
62 uint16_t
size() {
return b_size; }
96 uint16_t increase(uint16_t p);
98 volatile uint32_t*
const ADC_RA;
106 #endif // RINGBUFFERDMA_H
uint16_t b_end
End pointer: Write here.
Definition: RingBufferDMA.h:79
void write()
Write a value into the buffer.
bool isFull()
Returns true if the buffer is full.
uint16_t b_start
Start pointer: Read here.
Definition: RingBufferDMA.h:77
uint16_t size()
Length of the buffer.
Definition: RingBufferDMA.h:62
RingBufferDMA(volatile int16_t *elems, uint32_t len, uint8_t ADC_num=0)
Constructor, buffer has a size len and stores the conversions of ADC number ADC_num.
void start(void(*call_dma_isr)(void))
Start DMA operation.
~RingBufferDMA()
Destructor.
volatile int16_t *const p_elems
Pointer to the elements of the buffer.
Definition: RingBufferDMA.h:82
DMAChannel * dmaChannel
DMAChannel to handle all low level DMA code.
Definition: RingBufferDMA.h:68
volatile int16_t *const buffer()
Pointer to the data.
Definition: RingBufferDMA.h:65
Definition: RingBufferDMA.h:35
bool isEmpty()
Returns true if the buffer is empty.
int16_t read()
Read a value from the buffer, make sure it's not emtpy by calling isEmpty() first.