14#include "hardware/dma.h"
15#include "hardware/irq.h"
24#define I2C_BURST_SIZE 16
46 HW_DMA(irq_num_t
irq_number = DMA_IRQ_0, irq_handler_t dma_irq_handler = NULL);
59 dma_channel_transfer_size_t transfer_size,
60 volatile void *destination_address,
61 volatile void *source_address,
~HW_DMA()
Destructor of the class, free the allocated DMA channel.
Definition hw_dma.cpp:23
SemaphoreHandle_t end_of_xfer
semaphore to signal the end of a DMA transfer
Definition hw_dma.h:41
irq_num_t irq_number
the IRQ number for the DMA channel, can be DMA_IRQ_0 or DMA_IRQ_1
Definition hw_dma.h:37
int xfer_mem2mem(uint32_t number_of_transfer, dma_channel_transfer_size_t transfer_size, volatile void *destination_address, volatile void *source_address, bool start)
the function member used to move data from memory to memory
Definition hw_dma.cpp:28
void start_dma()
start the DMA transfer
Definition hw_dma.cpp:58
uint channel
the DMA channel number allocated
Definition hw_dma.h:39
HW_DMA(irq_num_t irq_number=DMA_IRQ_0, irq_handler_t dma_irq_handler=NULL)
constructor of the DMA class
Definition hw_dma.cpp:3
void cleanup_and_free_dma_channel()
clean up and free the allocated DMA channel
Definition hw_dma.cpp:52