|
ADC
8.0
Analog to Digital Conversor library for the Teensy 3.6 microprocessor
|
#include <RingBufferDMA.h>
Public Member Functions | |
| 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. | |
| ~RingBufferDMA () | |
| Destructor. | |
| bool | isFull () |
| Returns true if the buffer is full. | |
| 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. | |
| void | start (void(*call_dma_isr)(void)) |
| Start DMA operation. | |
| void | write () |
| Write a value into the buffer. More... | |
| uint16_t | size () |
| Length of the buffer. | |
| volatile int16_t *const | buffer () |
| Pointer to the data. | |
Public Attributes | |
| DMAChannel * | dmaChannel |
| DMAChannel to handle all low level DMA code. | |
| uint16_t | b_start |
| Start pointer: Read here. | |
| uint16_t | b_end |
| End pointer: Write here. | |
| volatile int16_t *const | p_elems |
| Pointer to the elements of the buffer. | |
Class RingBufferDMA implements a DMA ping-pong buffer of fixed size
| void RingBufferDMA::write | ( | ) |
Write a value into the buffer.
The actual value is copied by DMA, this function only updates the buffer pointers to reflect that fact.