C++ DevKit
C++ set of OOP library
Loading...
Searching...
No Matches
HW_DMA Class Reference

Class to manage a DMA channel. More...

#include <hw_dma.h>

Collaboration diagram for HW_DMA:
Collaboration graph

Public Member Functions

 HW_DMA (irq_num_t irq_number=DMA_IRQ_0, irq_handler_t dma_irq_handler=NULL)
 constructor of the DMA class
 
 ~HW_DMA ()
 Destructor of the class, free the allocated DMA channel.
 
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
 
void cleanup_and_free_dma_channel ()
 clean up and free the allocated DMA channel
 
void start_dma ()
 start the DMA transfer
 

Public Attributes

irq_num_t irq_number
 the IRQ number for the DMA channel, can be DMA_IRQ_0 or DMA_IRQ_1
 
uint channel
 the DMA channel number allocated
 
SemaphoreHandle_t end_of_xfer
 semaphore to signal the end of a DMA transfer
 

Detailed Description

Class to manage a DMA channel.

Constructor & Destructor Documentation

◆ HW_DMA()

HW_DMA::HW_DMA ( irq_num_t irq_number = DMA_IRQ_0,
irq_handler_t dma_irq_handler = NULL )

constructor of the DMA class

Parameters
irq_numberthe IRQ attached to this DMA object
dma_irq_handlerthe IRQ hansler triggered by this IRQ

Member Function Documentation

◆ xfer_mem2mem()

int HW_DMA::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

Parameters
number_of_transferthe number of DMA transfers
transfer_sizethe size of DMA transfer (8, 16 or 32 bit)
destination_addressthe memory destination address
source_addressthe memory source address
startif trus, immediate start
Returns
error code

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