AM263Px MCU+ SDK
10.01.00
EDMA driver provides API to perform DMA tranfers.
Features Supported
DMA, QDMA channels
Interrupt and Polled mode of operations
PaRAM Linking
Channel Chaining
Manual and Event triggered transfers
SysConfig Features
Note It is strongly recommend to use SysConfig where it is available instead of using direct SW API calls. This will help simplify the SW application and also catch common mistakes early in the development cycle.
EDMA instances selection
Region Id selection
Interrupt mode selection
DMA Channel management
QDMA Channel management
TCC management
PaRAM management
Features NOT Supported
Usage Overview
API Sequence
To transfer the data using edma, application calls following APIs
Important Usage Guidelines
Example Usage
Include the below file to access the APIs
Instance Open Example
gEdmaHandle =
EDMA_open (CONFIG_EDMA0, ¶ms);
Instance Close Example
Instance transfer Example
uint32_t baseAddr, regionId;
uint8_t *srcBuffPtr, *dstBuffPtr;
EDMACCPaRAMEntry edmaParam;
uint32_t dmaCh, tcc, param;
srcBuffPtr = (uint8_t *) gEdmaTestSrcBuff;
dstBuffPtr = (uint8_t *) gEdmaTestDstBuff;
dmaCh, tcc, param, EDMA_TEST_EVT_QUEUE_NO);
edmaParam.srcAddr = (uint32_t) (srcBuffPtr);
edmaParam.destAddr = (uint32_t) (dstBuffPtr);
edmaParam.aCnt = (uint16_t) EDMA_TEST_A_COUNT;
edmaParam.bCnt = (uint16_t) EDMA_TEST_B_COUNT;
edmaParam.cCnt = (uint16_t) EDMA_TEST_C_COUNT;
edmaParam.bCntReload = (uint16_t) EDMA_TEST_B_COUNT;
edmaParam.srcCIdx = (int16_t) EDMA_TEST_A_COUNT;
edmaParam.destCIdx = (int16_t) EDMA_TEST_A_COUNT;
edmaParam.linkAddr = 0xFFFFU;
edmaParam.opt |=
API
APIs for EDMA
#define SOC_EDMA_NUM_REGIONS
Number of EDMA Regions.
Definition: cslr_soc_defines.h:98
int32_t EDMA_freeTcc(EDMA_Handle handle, uint32_t *tcc)
Function to free the tcc Channel.
uint32_t EDMA_enableTransferRegion(uint32_t baseAddr, uint32_t regionId, uint32_t chNum, uint32_t trigMode)
Start EDMA transfer on the specified channel.
uint32_t EDMA_getRegionId(EDMA_Handle handle)
Function to get the edma region.
#define EDMA_PARAM_BIDX_EXT(val)
Definition: edma/v0/edma.h:138
#define EDMA_CHANNEL_TYPE_DMA
Values that can be used for parameter chType in API's.
Definition: edma/v0/edma.h:161
int32_t EDMA_freeDmaChannel(EDMA_Handle handle, uint32_t *dmaCh)
Function to free the Dma Channel.
uint32_t EDMA_getBaseAddr(EDMA_Handle handle)
Function to get the edma base address.
#define EDMA_OPT_TCC_MASK
Definition: edma/v0/edma.h:256
int32_t EDMA_allocDmaChannel(EDMA_Handle handle, uint32_t *dmaCh)
Function to allocate the Dma Channel.
void EDMA_close(EDMA_Handle handle)
Function to close a EDMA peripheral specified by the EDMA handle.
#define EDMA_OPT_ITCINTEN_MASK
Definition: edma/v0/edma.h:254
#define EDMA_OPT_TCINTEN_MASK
Definition: edma/v0/edma.h:252
#define SystemP_SUCCESS
Return status when the API execution was successful.
Definition: SystemP.h:56
uint32_t EDMA_freeChannelRegion(uint32_t baseAddr, uint32_t regionId, uint32_t chType, uint32_t chNum, uint32_t trigMode, uint32_t tccNum, uint32_t evtQNum)
Free the specified channel (DMA/QDMA/Link) and its associated resources (PaRAM Set,...
#define EDMA_PARAM_BIDX(val)
Definition: edma/v0/edma.h:135
#define EDMA_OPT_TCC_SHIFT
Definition: edma/v0/edma.h:258
#define EDMA_TRIG_MODE_MANUAL
Definition: edma/v0/edma.h:147
int32_t EDMA_freeParam(EDMA_Handle handle, uint32_t *param)
Function to free the Param.
EDMA_Handle EDMA_open(uint32_t index, const EDMA_Params *prms)
This function opens a given EDMA instance.
uint32_t EDMA_configureChannelRegion(uint32_t baseAddr, uint32_t regionId, uint32_t chType, uint32_t chNum, uint32_t tccNum, uint32_t paramId, uint32_t evtQNum)
Request a DMA/QDMA/Link channel.
int32_t EDMA_allocParam(EDMA_Handle handle, uint32_t *param)
Function to allocate the TCC.
void EDMA_setPaRAM(uint32_t baseAddr, uint32_t paRAMId, const EDMACCPaRAMEntry *newPaRAM)
Copy the user specified PaRAM Set onto the PaRAM Set associated with the logical channel (DMA/Link).
EDMA open parameters passed to EDMA_open() function.
Definition: edma/v0/edma.h:455
#define DebugP_assert(expression)
Function to call for assert check.
Definition: DebugP.h:177
#define EDMA_RESOURCE_ALLOC_ANY
Definition: edma/v0/edma.h:333
void EDMA_ccPaRAMEntry_init(EDMACCPaRAMEntry *paramEntry)
Clear a PaRAM Set .
uint32_t intrEnable
Definition: edma/v0/edma.h:456
int32_t EDMA_allocTcc(EDMA_Handle handle, uint32_t *tcc)
Function to allocate the Qdma Channel.