xDma Configuration Usage
To configure a XDMA channel, the user has to follow these few steps :
-
Initialize a XDMA driver instance by XDMAD_Initialize().
-
choose an available (disabled) channel using XDMAD_AllocateChannel().
-
After the XDMAC selected channel has been programmed, XDMAD_PrepareChannel() is to enable clock and dma peripheral of the DMA, and set Configuration register to set up the transfer type (memory or non-memory peripheral for source and destination) and flow control device.
-
Invoke XDMAD_StartTransfer() to start DMA transfer or XDMAD_StopTransfer() to force stop DMA transfer.
-
Once the buffer of data is transferred, XDMAD_IsTransferDone() checks if DMA transfer is finished.
-
XDMAD_Handler() handles XDMA interrupt, and invoking XDMAD_SetCallback() if provided.
Related files:
xdmad.h
xdmad.c.