ADC  8.0
Analog to Digital Conversor library for the Teensy LC microprocessor
RingBufferDMA Class Reference

#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.
 

Detailed Description

Class RingBufferDMA implements a DMA ping-pong buffer of fixed size

Member Function Documentation

◆ write()

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.


The documentation for this class was generated from the following file: