This module contains APIs to program and use the EDMA.
Files | |
file | edma/v0/edma.h |
This file contains the prototype of EDMA driver APIs. | |
Data Structures | |
struct | __attribute__ |
EDMA Parameter RAM Set in User Configurable format This is a mapping of the EDMA PaRAM set provided to the user for ease of modification of the individual fields. More... | |
struct | EDMA_ResourceObject |
EDMA resource allocation structure. More... | |
struct | EDMA_InitParams |
EDMA initialization structure used for EDMAInitialize. More... | |
struct | EDMA_Params |
EDMA open parameters passed to EDMA_open() function. More... | |
struct | Edma_IntrObject |
EDMA interrupt configuration object. The object is passed to the EDMA_registerIntr() function. This is held by the driver till the EDMA_unregisterIntr() function is called with this obect. The application should not modify this object in between. More... | |
struct | EDMA_Object |
EDMA driver object. More... | |
struct | EDMA_Attrs |
EDMA instance attributes - used during init time. More... | |
struct | EDMA_Config |
EDMA Instance Configuration. Pointer to this object is returned as handle by driver open. More... | |
Functions | |
void | EDMA_initParamsInit (EDMA_InitParams *initParam) |
Structure initialization function for EDMA_InitParams. More... | |
void | EDMA_ccPaRAMEntry_init (EDMACCPaRAMEntry *paramEntry) |
Clear a PaRAM Set . More... | |
void | EDMA_enableChInShadowRegRegion (uint32_t baseAddr, uint32_t regionId, uint32_t chType, uint32_t chNum) |
Enable channel to Shadow region mapping. More... | |
void | EDMA_disableChInShadowRegRegion (uint32_t baseAddr, uint32_t regionId, uint32_t chType, uint32_t chNum) |
Disable channel to Shadow region mapping. More... | |
void | EDMA_channelToParamMap (uint32_t baseAddr, uint32_t channel, uint32_t paramSet) |
This function maps DMA channel to any of the PaRAM sets in the PaRAM memory map. More... | |
void | EDMA_mapChToEvtQ (uint32_t baseAddr, uint32_t chType, uint32_t chNum, uint32_t evtQNum) |
Map channel to Event Queue. More... | |
void | EDMA_unmapChToEvtQ (uint32_t baseAddr, uint32_t chType, uint32_t chNum) |
Remove Mapping of channel to Event Queue. More... | |
void | EDMA_mapQdmaChToPaRAM (uint32_t baseAddr, uint32_t chNum, const uint32_t *paRAMId) |
Enables the user to map a QDMA channel to PaRAM set This API Needs to be called before programming the paRAM sets for the QDMA Channels.Application needs to maitain the paRAMId provided by this API.This paRAMId is used to set paRAM and get paRAM. Refer corresponding API's for more details. More... | |
uint32_t | EDMA_getMappedPaRAM (uint32_t baseAddr, uint32_t chNum, uint32_t chType, uint32_t *paramId) |
Returns the PaRAM associated with the DMA/QDMA channel. More... | |
void | EDMA_setQdmaTrigWord (uint32_t baseAddr, uint32_t chNum, uint32_t trigWord) |
Assign a Trigger Word to the specified QDMA channel. More... | |
void | EDMA_clrMissEvtRegion (uint32_t baseAddr, uint32_t regionId, uint32_t chNum) |
Enables the user to Clear any missed event. More... | |
void | EDMA_qdmaClrMissEvtRegion (uint32_t baseAddr, uint32_t regionId, uint32_t chNum) |
Enables the user to Clear any QDMA missed event. More... | |
void | EDMA_clrCCErr (uint32_t baseAddr, uint32_t flags) |
Enables the user to Clear any Channel controller Errors. More... | |
void | EDMA_setEvtRegion (uint32_t baseAddr, uint32_t regionId, uint32_t chNum) |
Enables the user to Set an event. This API helps user to manually set events to initiate DMA transfer requests. More... | |
void | EDMA_clrEvtRegion (uint32_t baseAddr, uint32_t regionId, uint32_t chNum) |
Enables the user to Clear an event. More... | |
void | EDMA_enableDmaEvtRegion (uint32_t baseAddr, uint32_t regionId, uint32_t chNum) |
Enables the user to enable an DMA event. More... | |
void | EDMA_disableDmaEvtRegion (uint32_t baseAddr, uint32_t regionId, uint32_t chNum) |
Enables the user to Disable an DMA event. More... | |
void | EDMA_enableQdmaEvtRegion (uint32_t baseAddr, uint32_t regionId, uint32_t chNum) |
Enables the user to enable an QDMA event. More... | |
void | EDMA_disableQdmaEvtRegion (uint32_t baseAddr, uint32_t regionId, uint32_t chNum) |
Enables the user to disable an QDMA event. More... | |
uint32_t | EDMA_getIntrStatusRegion (uint32_t baseAddr, uint32_t regionId) |
This function returns interrupts status of those events which is less than 32. More... | |
void | EDMA_enableEvtIntrRegion (uint32_t baseAddr, uint32_t regionId, uint32_t chNum) |
Enables the user to enable the transfer completion interrupt generation by the EDMACC for all DMA/QDMA channels. More... | |
void | EDMA_disableEvtIntrRegion (uint32_t baseAddr, uint32_t regionId, uint32_t chNum) |
Enables the user to clear CC interrupts. More... | |
void | EDMA_clrIntrRegion (uint32_t baseAddr, uint32_t regionId, uint32_t value) |
Enables the user to Clear an Interrupt. More... | |
uint32_t | EDMA_getEnabledIntrRegion (uint32_t baseAddr, uint32_t regionId) |
This function returns interrupt enable status of events which are less than 32. More... | |
uint32_t | EDMA_getEnabledIntrHighRegion (uint32_t baseAddr, uint32_t regionId) |
This function returns interrupt enable status of events which are more than 32. More... | |
void | EDMA_getPaRAM (uint32_t baseAddr, uint32_t paRAMId, EDMACCPaRAMEntry *currPaRAM) |
Retrieve existing PaRAM set associated with specified logical channel (DMA/Link). More... | |
void | EDMA_qdmaGetPaRAM (uint32_t baseAddr, uint32_t paRAMId, EDMACCPaRAMEntry *currPaRAM) |
Retrieve existing PaRAM set associated with specified logical channel (QDMA). More... | |
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). More... | |
void | EDMA_qdmaSetPaRAM (uint32_t baseAddr, uint32_t paRAMId, const EDMACCPaRAMEntry *newPaRAM) |
Copy the user specified PaRAM Set onto the PaRAM Set associated with the logical channel (QDMA only). More... | |
void | EDMA_qdmaSetPaRAMEntry (uint32_t baseAddr, uint32_t paRAMId, uint32_t paRAMEntry, uint32_t newPaRAMEntryVal) |
Set a particular PaRAM set entry of the specified PaRAM set. More... | |
uint32_t | EDMA_qdmaGetPaRAMEntry (uint32_t baseAddr, uint32_t paRAMId, uint32_t paRAMEntry) |
Get a particular PaRAM entry of the specified PaRAM set. More... | |
void | EDMA_dmaSetPaRAMEntry (uint32_t baseAddr, uint32_t paRAMId, uint32_t paRAMEntry, uint32_t newPaRAMEntryVal) |
Set a particular PaRAM set entry of the specified PaRAM set. More... | |
uint32_t | EDMA_dmaGetPaRAMEntry (uint32_t baseAddr, uint32_t paRAMId, uint32_t paRAMEntry) |
Get a particular PaRAM entry of the specified PaRAM set. More... | |
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. More... | |
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, TCC etc) and removes various mappings. More... | |
uint32_t | EDMA_enableTransferRegion (uint32_t baseAddr, uint32_t regionId, uint32_t chNum, uint32_t trigMode) |
Start EDMA transfer on the specified channel. More... | |
uint32_t | EDMA_disableTransferRegion (uint32_t baseAddr, uint32_t regionId, uint32_t chNum, uint32_t trigMode) |
Disable DMA transfer on the specified channel. More... | |
void | EDMA_clearErrorBitsRegion (uint32_t baseAddr, uint32_t regionId, uint32_t chNum, uint32_t evtQNum) |
Clears Event Register and Error Register for a specific DMA channel and brings back EDMA to its initial state. More... | |
uint32_t | EDMA_getCCErrStatus (uint32_t baseAddr) |
This returns EDMA CC error status. More... | |
uint32_t | EDMA_getErrIntrStatus (uint32_t baseAddr) |
This returns error interrupt status for those events whose event number is less than 32. More... | |
uint32_t | EDMA_qdmaGetErrIntrStatus (uint32_t baseAddr) |
This returns QDMA error interrupt status. More... | |
uint32_t | EDMA_peripheralIdGet (uint32_t baseAddr) |
This API return the revision Id of the peripheral. More... | |
uint32_t | EDMA_intrStatusHighGetRegion (uint32_t baseAddr, uint32_t regionId) |
This function returns interrupt status of those events which are greater than 32. More... | |
uint32_t | EDMA_readIntrStatusRegion (uint32_t baseAddr, uint32_t regionId, uint32_t tccNum) |
This function reads interrupt status. More... | |
uint32_t | EDMA_getEventStatus (uint32_t baseAddr) |
This function returns status of those events which are less than 32. More... | |
uint32_t | EDMA_getEventStatusHigh (uint32_t baseAddr) |
This function returns status of those events which are greater than 32. More... | |
uint32_t | EDMA_readEventStatusRegion (uint32_t baseAddr, uint32_t chNum) |
This function reads Event pending status. More... | |
uint32_t | EDMA_errIntrHighStatusGet (uint32_t baseAddr) |
This returns error interrupt status for those events whose event number is greater than 32. More... | |
void | EDMA_chainChannel (uint32_t baseAddr, uint32_t paRAMId1, uint32_t chId2, uint32_t chainOptions) |
Chain the two specified channels. More... | |
void | EDMA_linkChannel (uint32_t baseAddr, uint32_t paRAMId1, uint32_t paRAMId2) |
Link two channels. More... | |
void | EDMA_init (void) |
This function initializes the EDMA driver object and controller. More... | |
void | EDMA_deinit (void) |
This function Deinitializes the EDMA driver object and controller. More... | |
uint32_t | EDMA_isInitialized (EDMA_Handle handle) |
Function to check if EDMA is enabled or not. More... | |
EDMA_Handle | EDMA_open (uint32_t index, const EDMA_Params *prms) |
This function opens a given EDMA instance. More... | |
EDMA_Handle | EDMA_getHandle (uint32_t index) |
This function returns the handle of an open EDMA Instance from the instance index. More... | |
void | EDMA_close (EDMA_Handle handle) |
Function to close a EDMA peripheral specified by the EDMA handle. More... | |
uint32_t | EDMA_isInterruptEnabled (EDMA_Handle handle) |
Function to check if EDMA interrupt is enabled. More... | |
int32_t | EDMA_registerIntr (EDMA_Handle handle, Edma_IntrObject *intrObj) |
Function to register callback function for a TCC. More... | |
int32_t | EDMA_unregisterIntr (EDMA_Handle handle, Edma_IntrObject *intrObj) |
Function to unregister callback function for a TCC. More... | |
uint32_t | EDMA_getBaseAddr (EDMA_Handle handle) |
Function to get the edma base address. More... | |
uint32_t | EDMA_getRegionId (EDMA_Handle handle) |
Function to get the edma region. More... | |
int32_t | EDMA_allocDmaChannel (EDMA_Handle handle, uint32_t *dmaCh) |
Function to allocate the Dma Channel. More... | |
int32_t | EDMA_allocQdmaChannel (EDMA_Handle handle, uint32_t *qdmaCh) |
Function to allocate the Dma Channel. More... | |
int32_t | EDMA_allocTcc (EDMA_Handle handle, uint32_t *tcc) |
Function to allocate the Qdma Channel. More... | |
int32_t | EDMA_allocParam (EDMA_Handle handle, uint32_t *param) |
Function to allocate the TCC. More... | |
int32_t | EDMA_freeDmaChannel (EDMA_Handle handle, uint32_t *dmaCh) |
Function to free the Dma Channel. More... | |
int32_t | EDMA_freeQdmaChannel (EDMA_Handle handle, uint32_t *qdmaCh) |
Function to free the Qdma Channel. More... | |
int32_t | EDMA_freeTcc (EDMA_Handle handle, uint32_t *tcc) |
Function to free the tcc Channel. More... | |
int32_t | EDMA_freeParam (EDMA_Handle handle, uint32_t *param) |
Function to free the Param. More... | |
Typedefs | |
typedef struct Edma_IntrObject_t * | Edma_IntrHandle |
EDMA interrupt handle returned from EDMA_registerIntr() function. More... | |
typedef void(* | Edma_EventCallback) (Edma_IntrHandle intrHandle, void *appData) |
EDMA interrupt callback function prototype. More... | |
typedef void * | EDMA_Handle |
A handle that is returned from a EDMA_open() call. More... | |
Macros | |
#define | EDMA_SET_ALL_BITS ((uint32_t) 0xFFFFFFFFU) |
#define | EDMA_CLR_ALL_BITS ((uint32_t) 0x00000000U) |
#define | EDMACC_COMPL_HANDLER_RETRY_COUNT ((uint32_t) 10U) |
#define | EDMACC_ERR_HANDLER_RETRY_COUNT ((uint32_t) 10U) |
EDMA Queue Number Configuration. | |
#define | EDMACC_DMAQNUM_CLR(chNum) (~((uint32_t) 0x7U << (((chNum) % 8U) * 4U))) |
#define | EDMACC_DMAQNUM_SET(chNum, queNum) (((uint32_t) 0x7U & (queNum)) << (((chNum) % 8U) * 4U)) |
#define | EDMACC_QDMAQNUM_CLR(chNum) (~((uint32_t) 0x7U << ((chNum) * 4U))) |
#define | EDMACC_QDMAQNUM_SET(chNum, queNum) (((uint32_t) 0x7U & (queNum)) << ((chNum) * 4U)) |
EDMA Qdma Channel mapping Configuration. | |
#define | EDMACC_QCHMAP_PAENTRY_CLR ((uint32_t) (~((uint32_t)EDMA_TPCC_QCHMAPN_PAENTRY_MASK))) |
#define | EDMACC_QCHMAP_PAENTRY_SET(paRAMId) |
#define | EDMACC_QCHMAP_TRWORD_CLR ((uint32_t) (~((uint32_t)EDMA_TPCC_QCHMAPN_TRWORD_MASK))) |
#define | EDMACC_QCHMAP_TRWORD_SET(paRAMId) |
EDMA PaRAM BIDX configuration helper macros. | |
#define | EDMA_PARAM_BIDX(val) (val & 0xFFFF) |
#define | EDMA_PARAM_BIDX_EXT(val) ((val & 0xFF0000) >> 16) |
EDMA Trigger Mode Configuration. | |
#define | EDMA_TRIG_MODE_MANUAL ((uint32_t) 0U) |
#define | EDMA_TRIG_MODE_QDMA ((uint32_t) 1U) |
#define | EDMA_TRIG_MODE_EVENT ((uint32_t) 2U) |
EDMA channel type definitions. | |
#define | EDMA_CHANNEL_TYPE_DMA ((uint32_t) 0U) |
Values that can be used for parameter chType in API's. More... | |
#define | EDMA_CHANNEL_TYPE_QDMA ((uint32_t) 1U) |
EDMA event status definitions. | |
#define | EDMA_XFER_COMPLETE ((uint32_t) 0U) |
Values that can be used to specify different event status. More... | |
#define | EDMA_CC_DMA_EVT_MISS ((uint32_t) 1U) |
#define | EDMA_CC_QDMA_EVT_MISS ((uint32_t) 2U) |
EDMA transfer type definitions. | |
#define | EDMA_SYNC_A ((uint32_t) 0U) |
Values that can be used to specify different synchronization events. More... | |
#define | EDMA_SYNC_AB ((uint32_t) 1U) |
EDMA addressing modes definitions. | |
#define | EDMA_ADDRESSING_MODE_LINEAR ((uint32_t) 0U) |
Values that can be used to specify different addressing modes (relevant for SAM and DAM sub-fields in OPT field). More... | |
#define | EDMA_ADDRESSING_MODE_FIFO_WRAP ((uint32_t) 1U) |
EDMA FIFO width definitions. | |
#define | EDMA_FIFO_WIDTH_8BIT ((uint32_t) EDMA_TPCC_OPT_FWID_FIFOWIDTH8BIT) |
Values that can be used to specify different FIFO widths (FWID in OPT field). More... | |
#define | EDMA_FIFO_WIDTH_16BIT ((uint32_t) EDMA_TPCC_OPT_FWID_FIFOWIDTH16BIT) |
#define | EDMA_FIFO_WIDTH_32BIT ((uint32_t) EDMA_TPCC_OPT_FWID_FIFOWIDTH32BIT) |
#define | EDMA_FIFO_WIDTH_64BIT ((uint32_t) EDMA_TPCC_OPT_FWID_FIFOWIDTH64BIT) |
#define | EDMA_FIFO_WIDTH_128BIT ((uint32_t) EDMA_TPCC_OPT_FWID_FIFOWIDTH128BIT) |
#define | EDMA_FIFO_WIDTH_256BIT ((uint32_t) DMA_TPCC_OPT_FWID_FIFOWIDTH256BIT) |
EDMA Clear Channel controller Error. | |
#define | EDMACC_CLR_TCCERR ((uint32_t) EDMA_TPCC_CCERRCLR_TCERR_MASK) |
Values that can be used to Clear any Channel controller Errors. More... | |
#define | EDMACC_CLR_QTHRQ0 ((uint32_t) EDMA_TPCC_CCERRCLR_QTHRXCD0_MASK) |
#define | EDMACC_CLR_QTHRQ1 ((uint32_t) EDMA_TPCC_CCERRCLR_QTHRXCD1_MASK) |
EDMA Param OPT fields. | |
#define | EDMA_OPT_TCCHEN_MASK ((uint32_t) EDMA_TPCC_OPT_TCCHEN_MASK) |
Values that are used to Chain two specified channels. More... | |
#define | EDMA_OPT_ITCCHEN_MASK ((uint32_t) EDMA_TPCC_OPT_ITCCHEN_MASK) |
#define | EDMA_OPT_TCINTEN_MASK ((uint32_t) EDMA_TPCC_OPT_TCINTEN_MASK) |
#define | EDMA_OPT_ITCINTEN_MASK ((uint32_t) EDMA_TPCC_OPT_ITCINTEN_MASK) |
#define | EDMA_OPT_TCC_MASK ((uint32_t) EDMA_TPCC_OPT_TCC_MASK) |
#define | EDMA_OPT_TCC_SHIFT ((uint32_t) EDMA_TPCC_OPT_TCC_SHIFT) |
#define | EDMA_OPT_SYNCDIM_MASK ((uint32_t) EDMA_TPCC_OPT_SYNCDIM_MASK) |
#define | EDMA_OPT_SYNCDIM_SHIFT ((uint32_t) EDMA_TPCC_OPT_SYNCDIM_SHIFT) |
#define | EDMA_OPT_STATIC_MASK ((uint32_t) EDMA_TPCC_OPT_STATIC_MASK) |
#define | EDMA_OPT_STATIC_SHIFT ((uint32_t) EDMA_TPCC_OPT_STATIC_SHIFT) |
#define | EDMACC_OPT_TCC_CLR ((uint32_t) (~EDMA_TPCC_OPT_TCC_MASK)) |
#define | EDMACC_OPT_TCC_SET(tcc) |
#define | EDMA_OPT_SAM_MASK ((uint32_t) EDMA_TPCC_OPT_SAM_MASK) |
#define | EDMA_OPT_SAM_SHIFT ((uint32_t) EDMA_TPCC_OPT_SAM_SHIFT) |
#define | EDMA_OPT_DAM_MASK ((uint32_t) EDMA_TPCC_OPT_DAM_SHIFT) |
#define | EDMA_OPT_DAM_SHIFT ((uint32_t) EDMA_TPCC_OPT_DAM_SHIFT) |
EDMA Param fields. | |
#define | EDMACC_PARAM_ENTRY_OPT ((uint32_t) 0x0U) |
PaRAMEntry Fields. More... | |
#define | EDMACC_PARAM_ENTRY_SRC ((uint32_t) 0x1U) |
#define | EDMACC_PARAM_ENTRY_ACNT_BCNT ((uint32_t) 0x2U) |
#define | EDMACC_PARAM_ENTRY_DST ((uint32_t) 0x3U) |
#define | EDMACC_PARAM_ENTRY_SRC_DST_BIDX ((uint32_t) 0x4U) |
#define | EDMACC_PARAM_ENTRY_LINK_BCNTRLD ((uint32_t) 0x5U) |
#define | EDMACC_PARAM_ENTRY_SRC_DST_CIDX ((uint32_t) 0x6U) |
#define | EDMACC_PARAM_ENTRY_CCNT ((uint32_t) 0x7U) |
#define | EDMACC_PARAM_FIELD_OFFSET ((uint32_t) 0x4U) |
#define | EDMACC_PARAM_ENTRY_FIELDS ((uint32_t) 0x8U) |
#define | EDMA_NUM_TCC ((uint32_t) SOC_EDMA_NUM_DMACH) |
EDMA resource type definition used for resource allocation and freeing. | |
#define | EDMA_RESOURCE_TYPE_DMA ((uint32_t) 0U) |
Values that can be used for parameter resType in API's. More... | |
#define | EDMA_RESOURCE_TYPE_QDMA ((uint32_t) 1U) |
#define | EDMA_RESOURCE_TYPE_TCC ((uint32_t) 2U) |
#define | EDMA_RESOURCE_TYPE_PARAM ((uint32_t) 3U) |
#define | EDMA_RESOURCE_ALLOC_ANY ((uint32_t) 0xFFFFU) |
#define EDMACC_DMAQNUM_CLR | ( | chNum | ) | (~((uint32_t) 0x7U << (((chNum) % 8U) * 4U))) |
DMAQNUM bits Clear
#define EDMACC_DMAQNUM_SET | ( | chNum, | |
queNum | |||
) | (((uint32_t) 0x7U & (queNum)) << (((chNum) % 8U) * 4U)) |
DMAQNUM bits Set
#define EDMACC_QDMAQNUM_CLR | ( | chNum | ) | (~((uint32_t) 0x7U << ((chNum) * 4U))) |
QDMAQNUM bits Clear
#define EDMACC_QDMAQNUM_SET | ( | chNum, | |
queNum | |||
) | (((uint32_t) 0x7U & (queNum)) << ((chNum) * 4U)) |
QDMAQNUM bits Set
#define EDMACC_QCHMAP_PAENTRY_CLR ((uint32_t) (~((uint32_t)EDMA_TPCC_QCHMAPN_PAENTRY_MASK))) |
QCHMAP Param ID Clear
#define EDMACC_QCHMAP_PAENTRY_SET | ( | paRAMId | ) |
QCHMAP-PaRAMEntry bitfield Set
#define EDMACC_QCHMAP_TRWORD_CLR ((uint32_t) (~((uint32_t)EDMA_TPCC_QCHMAPN_TRWORD_MASK))) |
QCHMAP-TrigWord bitfield Clear
#define EDMACC_QCHMAP_TRWORD_SET | ( | paRAMId | ) |
QCHMAP-TrigWord bitfield Set
#define EDMA_PARAM_BIDX | ( | val | ) | (val & 0xFFFF) |
Macro to derive BIDX Lower bits to be programmed in srcBIdx and dstBIdx
#define EDMA_PARAM_BIDX_EXT | ( | val | ) | ((val & 0xFF0000) >> 16) |
Macro to derive BIDX Higher bits to be programmed in srcBIdxExt and dstBIdxExt
#define EDMA_TRIG_MODE_MANUAL ((uint32_t) 0U) |
Manually trigger EDMA transfer
#define EDMA_TRIG_MODE_QDMA ((uint32_t) 1U) |
Manually trigger QDMA transfer
#define EDMA_TRIG_MODE_EVENT ((uint32_t) 2U) |
Trigger EDMA transfer upon Event
#define EDMA_CHANNEL_TYPE_DMA ((uint32_t) 0U) |
Values that can be used for parameter chType in API's.
Channel Typr DMA
#define EDMA_CHANNEL_TYPE_QDMA ((uint32_t) 1U) |
Channel Typr QDMA
#define EDMA_XFER_COMPLETE ((uint32_t) 0U) |
Values that can be used to specify different event status.
Transfer Complete
#define EDMA_CC_DMA_EVT_MISS ((uint32_t) 1U) |
DMA Event Miss
#define EDMA_CC_QDMA_EVT_MISS ((uint32_t) 2U) |
QDMA Event Miss
#define EDMA_SYNC_A ((uint32_t) 0U) |
Values that can be used to specify different synchronization events.
A Sync Transfer
#define EDMA_SYNC_AB ((uint32_t) 1U) |
#define EDMA_ADDRESSING_MODE_LINEAR ((uint32_t) 0U) |
Values that can be used to specify different addressing modes (relevant for SAM and DAM sub-fields in OPT field).
Incremental addressing (INCR), not FIFO
#define EDMA_ADDRESSING_MODE_FIFO_WRAP ((uint32_t) 1U) |
Constant addressing (CONST) within the FIFO array, wraps around upon reaching FIFO width
#define EDMA_FIFO_WIDTH_8BIT ((uint32_t) EDMA_TPCC_OPT_FWID_FIFOWIDTH8BIT) |
Values that can be used to specify different FIFO widths (FWID in OPT field).
8-bit FIFO width
#define EDMA_FIFO_WIDTH_16BIT ((uint32_t) EDMA_TPCC_OPT_FWID_FIFOWIDTH16BIT) |
16-bit FIFO width
#define EDMA_FIFO_WIDTH_32BIT ((uint32_t) EDMA_TPCC_OPT_FWID_FIFOWIDTH32BIT) |
32-bit FIFO width
#define EDMA_FIFO_WIDTH_64BIT ((uint32_t) EDMA_TPCC_OPT_FWID_FIFOWIDTH64BIT) |
64-bit FIFO width
#define EDMA_FIFO_WIDTH_128BIT ((uint32_t) EDMA_TPCC_OPT_FWID_FIFOWIDTH128BIT) |
128-bit FIFO width
#define EDMA_FIFO_WIDTH_256BIT ((uint32_t) DMA_TPCC_OPT_FWID_FIFOWIDTH256BIT) |
256-bit FIFO width
#define EDMACC_CLR_TCCERR ((uint32_t) EDMA_TPCC_CCERRCLR_TCERR_MASK) |
Values that can be used to Clear any Channel controller Errors.
Cleat TCC Error
#define EDMACC_CLR_QTHRQ0 ((uint32_t) EDMA_TPCC_CCERRCLR_QTHRXCD0_MASK) |
Cleat Queue threshold 0 Error
#define EDMACC_CLR_QTHRQ1 ((uint32_t) EDMA_TPCC_CCERRCLR_QTHRXCD1_MASK) |
Cleat Queue threshold 1 Error
#define EDMA_OPT_TCCHEN_MASK ((uint32_t) EDMA_TPCC_OPT_TCCHEN_MASK) |
Values that are used to Chain two specified channels.
Transfer Complete Chaining enable
#define EDMA_OPT_ITCCHEN_MASK ((uint32_t) EDMA_TPCC_OPT_ITCCHEN_MASK) |
Intermediate Transfer Complete Chaining enable
#define EDMA_OPT_TCINTEN_MASK ((uint32_t) EDMA_TPCC_OPT_TCINTEN_MASK) |
Transfer Complete Interrupt enable
#define EDMA_OPT_ITCINTEN_MASK ((uint32_t) EDMA_TPCC_OPT_ITCINTEN_MASK) |
Intermediate Transfer Complete Interrupt enable
#define EDMA_OPT_TCC_MASK ((uint32_t) EDMA_TPCC_OPT_TCC_MASK) |
Transfer Complete Code mask
#define EDMA_OPT_TCC_SHIFT ((uint32_t) EDMA_TPCC_OPT_TCC_SHIFT) |
Transfer Complete Code shift
#define EDMA_OPT_SYNCDIM_MASK ((uint32_t) EDMA_TPCC_OPT_SYNCDIM_MASK) |
Sync Type shift
#define EDMA_OPT_SYNCDIM_SHIFT ((uint32_t) EDMA_TPCC_OPT_SYNCDIM_SHIFT) |
Sync Type mask
#define EDMA_OPT_STATIC_MASK ((uint32_t) EDMA_TPCC_OPT_STATIC_MASK) |
Param Static mask
#define EDMA_OPT_STATIC_SHIFT ((uint32_t) EDMA_TPCC_OPT_STATIC_SHIFT) |
Param Static mask
#define EDMACC_OPT_TCC_CLR ((uint32_t) (~EDMA_TPCC_OPT_TCC_MASK)) |
OPT-TCC bitfield Clear
#define EDMACC_OPT_TCC_SET | ( | tcc | ) |
OPT-TCC bitfield Set
#define EDMA_OPT_SAM_MASK ((uint32_t) EDMA_TPCC_OPT_SAM_MASK) |
Source Addressing Mode mask
#define EDMA_OPT_SAM_SHIFT ((uint32_t) EDMA_TPCC_OPT_SAM_SHIFT) |
Source Addressing Mode shift
#define EDMA_OPT_DAM_MASK ((uint32_t) EDMA_TPCC_OPT_DAM_SHIFT) |
Destination Addressing Mode mask
#define EDMA_OPT_DAM_SHIFT ((uint32_t) EDMA_TPCC_OPT_DAM_SHIFT) |
Destination Addressing Mode shift
#define EDMACC_PARAM_ENTRY_OPT ((uint32_t) 0x0U) |
PaRAMEntry Fields.
The OPT field (Offset Address 0x0 Bytes)
#define EDMACC_PARAM_ENTRY_SRC ((uint32_t) 0x1U) |
The SRC field (Offset Address 0x4 Bytes)
#define EDMACC_PARAM_ENTRY_ACNT_BCNT ((uint32_t) 0x2U) |
The (ACNT+BCNT) field (Offset Address 0x8 Bytes)
#define EDMACC_PARAM_ENTRY_DST ((uint32_t) 0x3U) |
The DST field (Offset Address 0xC Bytes)
#define EDMACC_PARAM_ENTRY_SRC_DST_BIDX ((uint32_t) 0x4U) |
The (SRCBIDX+DSTBIDX) field (Offset Address 0x10 Bytes)
#define EDMACC_PARAM_ENTRY_LINK_BCNTRLD ((uint32_t) 0x5U) |
The (LINK+BCNTRLD) field (Offset Address 0x14 Bytes)
#define EDMACC_PARAM_ENTRY_SRC_DST_CIDX ((uint32_t) 0x6U) |
The (SRCCIDX+DSTCIDX) field (Offset Address 0x18 Bytes)
#define EDMACC_PARAM_ENTRY_CCNT ((uint32_t) 0x7U) |
The (CCNT+RSVD) field (Offset Address 0x1C Bytes)
#define EDMACC_PARAM_FIELD_OFFSET ((uint32_t) 0x4U) |
The offset for each PaRAM Entry field
#define EDMACC_PARAM_ENTRY_FIELDS ((uint32_t) 0x8U) |
Number of PaRAM Entry fields. OPT, SRC, A_B_CNT, DST, SRC_DST_BIDX, LINK_BCNTRLD, SRC_DST_CIDX and CCNT
#define EDMA_NUM_TCC ((uint32_t) SOC_EDMA_NUM_DMACH) |
Number of TCC's available
#define EDMA_RESOURCE_TYPE_DMA ((uint32_t) 0U) |
Values that can be used for parameter resType in API's.
Resource Type DMA
#define EDMA_RESOURCE_TYPE_QDMA ((uint32_t) 1U) |
Resource Type QDMA
#define EDMA_RESOURCE_TYPE_TCC ((uint32_t) 2U) |
Resource Type TCC
#define EDMA_RESOURCE_TYPE_PARAM ((uint32_t) 3U) |
Resource Type PARAM
#define EDMA_RESOURCE_ALLOC_ANY ((uint32_t) 0xFFFFU) |
Allocate any available resource
#define EDMA_SET_ALL_BITS ((uint32_t) 0xFFFFFFFFU) |
Used to set all Bits in a register
#define EDMA_CLR_ALL_BITS ((uint32_t) 0x00000000U) |
Used to clear all Bits in a register
#define EDMACC_COMPL_HANDLER_RETRY_COUNT ((uint32_t) 10U) |
Completion interrupt handler retry count
#define EDMACC_ERR_HANDLER_RETRY_COUNT ((uint32_t) 10U) |
Error interrupt handler retry count
typedef struct Edma_IntrObject_t* Edma_IntrHandle |
EDMA interrupt handle returned from EDMA_registerIntr() function.
typedef void(* Edma_EventCallback) (Edma_IntrHandle intrHandle, void *appData) |
EDMA interrupt callback function prototype.
typedef void* EDMA_Handle |
A handle that is returned from a EDMA_open() call.
void EDMA_initParamsInit | ( | EDMA_InitParams * | initParam | ) |
Structure initialization function for EDMA_InitParams.
initParam | Sets default initialization parameter used by API EDMAInitialize. This will set all DMA, QDMA, PaRAMs as own channels. Application should override this with appropriate owned resources. Overriding is must when EDMA is shared by multiple cores. |
void EDMA_ccPaRAMEntry_init | ( | EDMACCPaRAMEntry * | paramEntry | ) |
Clear a PaRAM Set .
paramEntry | Parameter RAM set to be cleared. |
void EDMA_enableChInShadowRegRegion | ( | uint32_t | baseAddr, |
uint32_t | regionId, | ||
uint32_t | chType, | ||
uint32_t | chNum | ||
) |
Enable channel to Shadow region mapping.
This API allocates DMA/QDMA channels or TCCs, and the same resources are enabled in the shadow region specific register (DRAE/DRAEH/QRAE). Here only one shadow region is used since, there is only one Master.
baseAddr | Memory address of the EDMA instance used. |
regionId | Region id to be used. Valid values are 0 to SOC_EDMA_NUM_REGIONS-1 |
chType | (DMA/QDMA) Channel For Example: For DMA it is, EDMA_CHANNEL_TYPE_DMA. |
chNum | Allocated channel number. Valid values are 0 to SOC_EDMA_NUM_DMACH-1 for DMA Valid values are 0 to SOC_EDMA_NUM_QDMACH-1 for QDMA chType can have values EDMA_CHANNEL_TYPE_DMA EDMA_CHANNEL_TYPE_QDMA |
void EDMA_disableChInShadowRegRegion | ( | uint32_t | baseAddr, |
uint32_t | regionId, | ||
uint32_t | chType, | ||
uint32_t | chNum | ||
) |
Disable channel to Shadow region mapping.
This API deallocates DMA/QDMA channels or TCCs, and the same resources are disabled in the shadow region specific register (DRAE/DRAEH/QRAE). Here only one shadow region is used since, there is only one Master.
baseAddr | Memory address of the EDMA instance used. |
regionId | Region id to be used. Valid values are 0 to SOC_EDMA_NUM_REGIONS-1 |
chType | (DMA/QDMA) Channel |
chNum | Allocated channel number. Valid values are 0 to SOC_EDMA_NUM_DMACH-1 for DMA Valid values are 0 to SOC_EDMA_NUM_QDMACH-1 for QDMA |
chType can have values EDMA_CHANNEL_TYPE_DMA
EDMA_CHANNEL_TYPE_QDMA
void EDMA_channelToParamMap | ( | uint32_t | baseAddr, |
uint32_t | channel, | ||
uint32_t | paramSet | ||
) |
This function maps DMA channel to any of the PaRAM sets in the PaRAM memory map.
baseAddr | Memory address of the EDMA instance used. |
channel | The DMA channel number required to be mapped. |
paramSet | It specifies the paramSet to which DMA channel required to be mapped. Valid values are 0 to SOC_EDMA_NUM_PARAMSETS-1 |
void EDMA_mapChToEvtQ | ( | uint32_t | baseAddr, |
uint32_t | chType, | ||
uint32_t | chNum, | ||
uint32_t | evtQNum | ||
) |
Map channel to Event Queue.
This API maps DMA/QDMA channels to the Event Queue
baseAddr | Memory address of the EDMA instance used. |
chType | (DMA/QDMA) Channel For Example: For QDMA it is EDMA_CHANNEL_TYPE_QDMA. |
chNum | Allocated channel number. Valid values are 0 to SOC_EDMA_NUM_DMACH-1 for DMA Valid values are 0 to SOC_EDMA_NUM_QDMACH-1 for QDMA |
evtQNum | Event Queue Number to which the channel will be mapped (valid only for the Master Channel (DMA/QDMA) request). chtype can have values EDMA_CHANNEL_TYPE_DMA EDMA_CHANNEL_TYPE_QDMA |
void EDMA_unmapChToEvtQ | ( | uint32_t | baseAddr, |
uint32_t | chType, | ||
uint32_t | chNum | ||
) |
Remove Mapping of channel to Event Queue.
This API Unmaps DMA/QDMA channels from the Event Queue allocated
baseAddr | Memory address of the EDMA instance used. |
chType | (DMA/QDMA) Channel For Example: For DMA it is EDMA_CHANNEL_TYPE_DMA. |
chNum | Allocated channel number. Valid values are 0 to SOC_EDMA_NUM_DMACH-1 for DMA Valid values are 0 to SOC_EDMA_NUM_QDMACH-1 for QDMA chtype can have values EDMA_CHANNEL_TYPE_DMA EDMA_CHANNEL_TYPE_QDMA |
void EDMA_mapQdmaChToPaRAM | ( | uint32_t | baseAddr, |
uint32_t | chNum, | ||
const uint32_t * | paRAMId | ||
) |
Enables the user to map a QDMA channel to PaRAM set This API Needs to be called before programming the paRAM sets for the QDMA Channels.Application needs to maitain the paRAMId provided by this API.This paRAMId is used to set paRAM and get paRAM. Refer corresponding API's for more details.
baseAddr | Memory address of the EDMA instance used. |
chNum | Allocated channel number. Valid values are 0 to SOC_EDMA_NUM_QDMACH-1 for QDMA |
paRAMId | PaRAM Id to which the QDMA channel will be mapped to. mapped to. |
Note : The PaRAMId requested must be greater than 32(SOC_EDMA_NUM_DMACH). and lesser than SOC_EDMA_NUM_DMACH + chNum Because, the first 32 PaRAM's are directly mapped to first 32 DMA channels and (32 - 38) for QDMA Channels. (32 - 38) is assigned by driver in this API.
uint32_t EDMA_getMappedPaRAM | ( | uint32_t | baseAddr, |
uint32_t | chNum, | ||
uint32_t | chType, | ||
uint32_t * | paramId | ||
) |
Returns the PaRAM associated with the DMA/QDMA channel.
baseAddr | Memory address of the EDMA instance used. |
chNum | Allocated channel number. Valid values are 0 to SOC_EDMA_NUM_DMACH-1 for DMA Valid values are 0 to SOC_EDMA_NUM_QDMACH-1 for QDMA |
chType | (DMA/QDMA) Channel For Example: For QDMA it is, EDMA_CHANNEL_TYPE_QDMA. |
paramId | Associated paramId is returned in this pointer. |
void EDMA_setQdmaTrigWord | ( | uint32_t | baseAddr, |
uint32_t | chNum, | ||
uint32_t | trigWord | ||
) |
Assign a Trigger Word to the specified QDMA channel.
This API sets the Trigger word for the specific QDMA channel in the QCHMAP Register. Default QDMA trigger word is CCNT.
baseAddr | Memory address of the EDMA instance used. |
chNum | QDMA Channel which needs to be assigned the Trigger Word. Valid values are 0 to SOC_EDMA_NUM_QDMACH-1 for QDMA |
trigWord | The Trigger Word for the QDMA channel. Trigger Word is the word in the PaRAM Register Set which, when written to by CPU, will start the QDMA transfer automatically. |
void EDMA_clrMissEvtRegion | ( | uint32_t | baseAddr, |
uint32_t | regionId, | ||
uint32_t | chNum | ||
) |
Enables the user to Clear any missed event.
baseAddr | Memory address of the EDMA instance used. |
regionId | Region id to be used. Valid values are 0 to SOC_EDMA_NUM_REGIONS-1 |
chNum | Allocated channel number. Valid values are 0 to SOC_EDMA_NUM_DMACH-1 for DMA |
void EDMA_qdmaClrMissEvtRegion | ( | uint32_t | baseAddr, |
uint32_t | regionId, | ||
uint32_t | chNum | ||
) |
Enables the user to Clear any QDMA missed event.
baseAddr | Memory address of the EDMA instance used. |
regionId | Region id to be used. Valid values are 0 to SOC_EDMA_NUM_REGIONS-1 |
chNum | Allocated channel number. Valid values are 0 to SOC_EDMA_NUM_QDMACH-1 for QDMA |
void EDMA_clrCCErr | ( | uint32_t | baseAddr, |
uint32_t | flags | ||
) |
Enables the user to Clear any Channel controller Errors.
baseAddr | Memory address of the EDMA instance used. |
flags | Masks to be passed. flags can have values: |
EDMACC_CLR_TCCERR Clears the TCCERR bit in the EDMACC ERR Reg
EDMACC_CLR_QTHRQ0 Queue threshold error clear for queue 0.
EDMACC_CLR_QTHRQ1 Queue threshold error clear for queue 1.
void EDMA_setEvtRegion | ( | uint32_t | baseAddr, |
uint32_t | regionId, | ||
uint32_t | chNum | ||
) |
Enables the user to Set an event. This API helps user to manually set events to initiate DMA transfer requests.
baseAddr | Memory address of the EDMA instance used. |
regionId | Region id to be used. |
chNum | Allocated channel number. Valid values are 0 to SOC_EDMA_NUM_DMACH-1 for DMA |
Note : This API is generally used during Manual transfers.
void EDMA_clrEvtRegion | ( | uint32_t | baseAddr, |
uint32_t | regionId, | ||
uint32_t | chNum | ||
) |
Enables the user to Clear an event.
baseAddr | Memory address of the EDMA instance used. |
regionId | Region id to be used. Valid values are 0 to SOC_EDMA_NUM_REGIONS-1 |
chNum | Allocated channel number. Valid values are 0 to SOC_EDMA_NUM_DMACH-1 for DMA |
Note : This API is generally used during Manual transfers.
void EDMA_enableDmaEvtRegion | ( | uint32_t | baseAddr, |
uint32_t | regionId, | ||
uint32_t | chNum | ||
) |
Enables the user to enable an DMA event.
baseAddr | Memory address of the EDMA instance used. |
regionId | Region id to be used. Valid values are 0 to SOC_EDMA_NUM_REGIONS-1 |
chNum | Allocated channel number. Valid values are 0 to SOC_EDMA_NUM_DMACH-1 for DMA |
Note : Writes of 1 to the bits in EESR sets the corresponding event bits in EER. This is generally used for Event Based transfers.
void EDMA_disableDmaEvtRegion | ( | uint32_t | baseAddr, |
uint32_t | regionId, | ||
uint32_t | chNum | ||
) |
Enables the user to Disable an DMA event.
baseAddr | Memory address of the EDMA instance used. |
regionId | Region id to be used. Valid values are 0 to SOC_EDMA_NUM_REGIONS-1 |
chNum | Allocated channel number. Valid values are 0 to SOC_EDMA_NUM_DMACH-1 for DMA |
Note : Writes of 1 to the bits in EECR clear the corresponding event bits in EER; writes of 0 have no effect.. This is generally used for Event Based transfers.
void EDMA_enableQdmaEvtRegion | ( | uint32_t | baseAddr, |
uint32_t | regionId, | ||
uint32_t | chNum | ||
) |
Enables the user to enable an QDMA event.
baseAddr | Memory address of the EDMA instance used. |
regionId | Region id to be used. Valid values are 0 to SOC_EDMA_NUM_REGIONS-1 |
chNum | Allocated channel number. Valid values are 0 to SOC_EDMA_NUM_QDMACH-1 for QDMA |
Note : Writes of 1 to the bits in QEESR sets the corresponding event bits in QEER.
void EDMA_disableQdmaEvtRegion | ( | uint32_t | baseAddr, |
uint32_t | regionId, | ||
uint32_t | chNum | ||
) |
Enables the user to disable an QDMA event.
baseAddr | Memory address of the EDMA instance used. |
regionId | Region id to be used. Valid values are 0 to SOC_EDMA_NUM_REGIONS-1 |
chNum | Allocated channel number. Valid values are 0 to SOC_EDMA_NUM_QDMACH-1 for QDMA |
Note : Writes of 1 to the bits in QEECR clears the corresponding event bits in QEER.
uint32_t EDMA_getIntrStatusRegion | ( | uint32_t | baseAddr, |
uint32_t | regionId | ||
) |
This function returns interrupts status of those events which is less than 32.
baseAddr | Memory address of the EDMA instance used. |
regionId | Region id to be used. Valid values are 0 to SOC_EDMA_NUM_REGIONS-1 |
void EDMA_enableEvtIntrRegion | ( | uint32_t | baseAddr, |
uint32_t | regionId, | ||
uint32_t | chNum | ||
) |
Enables the user to enable the transfer completion interrupt generation by the EDMACC for all DMA/QDMA channels.
baseAddr | Memory address of the EDMA instance used. |
regionId | Region id to be used. Valid values are 0 to SOC_EDMA_NUM_REGIONS-1 |
chNum | Allocated channel number. Valid values are 0 to SOC_EDMA_NUM_DMACH-1 for DMA |
Note : To set any interrupt bit in IER, a 1 must be written to the corresponding interrupt bit in the interrupt enable set register.
void EDMA_disableEvtIntrRegion | ( | uint32_t | baseAddr, |
uint32_t | regionId, | ||
uint32_t | chNum | ||
) |
Enables the user to clear CC interrupts.
baseAddr | Memory address of the EDMA instance used. |
regionId | Region id to be used. Valid values are 0 to SOC_EDMA_NUM_REGIONS-1 |
chNum | Allocated channel number. Valid values are 0 to SOC_EDMA_NUM_DMACH-1 for DMA |
Note : Writes of 1 to the bits in IECR clear the corresponding interrupt bits in the interrupt enable registers (IER); writes of 0 have no effect.
void EDMA_clrIntrRegion | ( | uint32_t | baseAddr, |
uint32_t | regionId, | ||
uint32_t | value | ||
) |
Enables the user to Clear an Interrupt.
baseAddr | Memory address of the EDMA instance used. |
regionId | Region id to be used. Valid values are 0 to SOC_EDMA_NUM_REGIONS-1 |
value | Value to be set to clear the Interrupt Status. |
uint32_t EDMA_getEnabledIntrRegion | ( | uint32_t | baseAddr, |
uint32_t | regionId | ||
) |
This function returns interrupt enable status of events which are less than 32.
baseAddr | Memory address of the EDMA instance used. |
regionId | Region id to be used. Valid values are 0 to SOC_EDMA_NUM_REGIONS-1 |
uint32_t EDMA_getEnabledIntrHighRegion | ( | uint32_t | baseAddr, |
uint32_t | regionId | ||
) |
This function returns interrupt enable status of events which are more than 32.
baseAddr | Memory address of the EDMA instance used. |
regionId | Region id to be used. Valid values are 0 to SOC_EDMA_NUM_REGIONS-1 |
void EDMA_getPaRAM | ( | uint32_t | baseAddr, |
uint32_t | paRAMId, | ||
EDMACCPaRAMEntry * | currPaRAM | ||
) |
Retrieve existing PaRAM set associated with specified logical channel (DMA/Link).
baseAddr | Memory address of the EDMA instance used. |
paRAMId | paRAMset ID whose parameter set is requested. Valid values are 0 to SOC_EDMA_NUM_PARAMSETS-1 |
currPaRAM | User gets the existing PaRAM here. |
void EDMA_qdmaGetPaRAM | ( | uint32_t | baseAddr, |
uint32_t | paRAMId, | ||
EDMACCPaRAMEntry * | currPaRAM | ||
) |
Retrieve existing PaRAM set associated with specified logical channel (QDMA).
baseAddr | Memory address of the EDMA instance used. |
paRAMId | paRAMset ID whose parameter set is requested. Valid values are 0 to SOC_EDMA_NUM_PARAMSETS-1 |
currPaRAM | User gets the existing PaRAM here. |
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).
This API takes a PaRAM Set as input and copies it onto the actual PaRAM Set associated with the logical channel. OPT field of the PaRAM Set is written first and the CCNT field is written last.
baseAddr | Memory address of the EDMA instance used. |
paRAMId | paRAMset ID whose parameter set has to be updated Valid values are 0 to SOC_EDMA_NUM_PARAMSETS-1 |
newPaRAM | Parameter RAM set to be copied onto existing PaRAM. |
void EDMA_qdmaSetPaRAM | ( | uint32_t | baseAddr, |
uint32_t | paRAMId, | ||
const EDMACCPaRAMEntry * | newPaRAM | ||
) |
Copy the user specified PaRAM Set onto the PaRAM Set associated with the logical channel (QDMA only).
This API takes a PaRAM Set as input and copies it onto the actual PaRAM Set associated with the logical channel. OPT field of the PaRAM Set is written first and the CCNT field is written last.
baseAddr | Memory address of the EDMA instance used. |
paRAMId | paRaMset ID whose parameter set has to be updated Valid values are 0 to SOC_EDMA_NUM_PARAMSETS-1 |
newPaRAM | Parameter RAM set to be copied onto existing PaRAM. |
void EDMA_qdmaSetPaRAMEntry | ( | uint32_t | baseAddr, |
uint32_t | paRAMId, | ||
uint32_t | paRAMEntry, | ||
uint32_t | newPaRAMEntryVal | ||
) |
Set a particular PaRAM set entry of the specified PaRAM set.
baseAddr | Memory address of the EDMA instance used. |
paRAMId | PaRAM Id to which the QDMA channel is mapped to. |
paRAMEntry | Specify the PaRAM set entry which needs to be set. |
newPaRAMEntryVal | The new field setting. Make sure this field is packed for setting certain fields in paRAM. |
EDMACC_PARAM_ENTRY_OPT EDMACC_PARAM_ENTRY_SRC EDMACC_PARAM_ENTRY_ACNT_BCNT EDMACC_PARAM_ENTRY_DST EDMACC_PARAM_ENTRY_SRC_DST_BIDX EDMACC_PARAM_ENTRY_LINK_BCNTRLD EDMACC_PARAM_ENTRY_SRC_DST_CIDX EDMACC_PARAM_ENTRY_CCNT
uint32_t EDMA_qdmaGetPaRAMEntry | ( | uint32_t | baseAddr, |
uint32_t | paRAMId, | ||
uint32_t | paRAMEntry | ||
) |
Get a particular PaRAM entry of the specified PaRAM set.
baseAddr | Memory address of the EDMA instance used. |
paRAMId | PaRAM Id to which the QDMA channel is mapped to. |
paRAMEntry | Specify the PaRAM set entry which needs to be read. |
paRAMEntry can have values:
EDMACC_PARAM_ENTRY_OPT EDMACC_PARAM_ENTRY_SRC EDMACC_PARAM_ENTRY_ACNT_BCNT EDMACC_PARAM_ENTRY_DST EDMACC_PARAM_ENTRY_SRC_DST_BIDX EDMACC_PARAM_ENTRY_LINK_BCNTRLD EDMACC_PARAM_ENTRY_SRC_DST_CIDX EDMACC_PARAM_ENTRY_CCNT
void EDMA_dmaSetPaRAMEntry | ( | uint32_t | baseAddr, |
uint32_t | paRAMId, | ||
uint32_t | paRAMEntry, | ||
uint32_t | newPaRAMEntryVal | ||
) |
Set a particular PaRAM set entry of the specified PaRAM set.
baseAddr | Memory address of the EDMA instance used. |
paRAMId | PaRAM Id to which the DMA channel is mapped to. |
paRAMEntry | Specify the PaRAM set entry which needs to be set. |
newPaRAMEntryVal | The new field setting. Make sure this field is packed for setting certain fields in paRAM. |
EDMACC_PARAM_ENTRY_OPT EDMACC_PARAM_ENTRY_SRC EDMACC_PARAM_ENTRY_ACNT_BCNT EDMACC_PARAM_ENTRY_DST EDMACC_PARAM_ENTRY_SRC_DST_BIDX EDMACC_PARAM_ENTRY_LINK_BCNTRLD EDMACC_PARAM_ENTRY_SRC_DST_CIDX EDMACC_PARAM_ENTRY_CCNT
uint32_t EDMA_dmaGetPaRAMEntry | ( | uint32_t | baseAddr, |
uint32_t | paRAMId, | ||
uint32_t | paRAMEntry | ||
) |
Get a particular PaRAM entry of the specified PaRAM set.
baseAddr | Memory address of the EDMA instance used. |
paRAMId | PaRAM Id to which the DMA channel is mapped to. |
paRAMEntry | Specify the PaRAM set entry which needs to be read. |
paRAMEntry can have values:
EDMACC_PARAM_ENTRY_OPT EDMACC_PARAM_ENTRY_SRC EDMACC_PARAM_ENTRY_ACNT_BCNT EDMACC_PARAM_ENTRY_DST EDMACC_PARAM_ENTRY_SRC_DST_BIDX EDMACC_PARAM_ENTRY_LINK_BCNTRLD EDMACC_PARAM_ENTRY_SRC_DST_CIDX EDMACC_PARAM_ENTRY_CCNT
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.
Each channel (DMA/QDMA/Link) must be requested before initiating a DMA transfer on that channel.
This API is used to allocate a logical channel (DMA/QDMA/Link) along with the associated resources. For DMA and QDMA channels, TCC and PaRAM Set are also allocated along with the requested channel.
User can request a specific logical channel by passing the channel number in 'chNum'.
For DMA/QDMA channels, after allocating all the EDMA resources, this API sets the TCC field of the OPT PaRAM Word with the allocated TCC. It also sets the event queue for the channel allocated. The event queue needs to be specified by the user.
For DMA channel, it also sets the DCHMAP register.
For QDMA channel, it sets the QCHMAP register and CCNT as trigger word and enables the QDMA channel by writing to the QEESR register.
baseAddr | Memory address of the EDMA instance used. |
regionId | Region id to be used. Valid values are 0 to SOC_EDMA_NUM_REGIONS-1 |
chType | (DMA/QDMA) Channel For Example: For DMA it is EDMA_CHANNEL_TYPE_DMA. |
chNum | This is the channel number requested for a particular event. Valid values are 0 to SOC_EDMA_NUM_DMACH-1 for DMA Valid values are 0 to SOC_EDMA_NUM_QDMACH-1 for QDMA |
tccNum | The tcc number on which the completion/error interrupt is generated. Not used if user requested for a Link channel. |
paramId | The param number currosponding to the DMA/QDMA channel. |
evtQNum | Event Queue Number to which the channel will be mapped (valid only for the Master Channel (DMA/QDMA) request). |
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, TCC etc) and removes various mappings.
For Link channels, this API only frees the associated PaRAM Set.
For DMA/QDMA channels, it does the following operations: 1) Disable any ongoing transfer on the channel,
2) Remove the channel to Event Queue mapping,
3) For DMA channels, clear the DCHMAP register, if available
4) For QDMA channels, clear the QCHMAP register,
5) Frees the DMA/QDMA channel in the end.
baseAddr | Memory address of the EDMA instance used. |
regionId | Region id to be used. Valid values are 0 to SOC_EDMA_NUM_REGIONS-1 |
chType | (DMA/QDMA) Channel For Example: For QDMA it is, EDMA_CHANNEL_TYPE_QDMA. |
chNum | This is the channel number requested for a particular event. Valid values are 0 to SOC_EDMA_NUM_DMACH-1 for DMA Valid values are 0 to SOC_EDMA_NUM_QDMACH-1 for QDMA |
trigMode | Mode of triggering start of transfer. |
tccNum | The channel number on which the completion/error interrupt is generated. Not used if user requested for a Link channel. |
evtQNum | Event Queue Number to which the channel will be unmapped (valid only for the Master Channel (DMA/QDMA) request). trigMode can have values: EDMA_TRIG_MODE_MANUAL EDMA_TRIG_MODE_QDMA EDMA_TRIG_MODE_EVENT |
uint32_t EDMA_enableTransferRegion | ( | uint32_t | baseAddr, |
uint32_t | regionId, | ||
uint32_t | chNum, | ||
uint32_t | trigMode | ||
) |
Start EDMA transfer on the specified channel.
There are multiple ways to trigger an EDMA transfer. The triggering mode option allows choosing from the available triggering modes: Event, Manual or QDMA.
In event triggered, a peripheral or an externally generated event triggers the transfer. This API clears the Event and Event Miss Register and then enables the DMA channel by writing to the EESR.
In manual triggered mode, CPU manually triggers a transfer by writing a 1 in the Event Set Register ESR. This API writes to the ESR to start the transfer.
In QDMA triggered mode, a QDMA transfer is triggered when a CPU (or other EDMA programmer) writes to the trigger word of the QDMA channel PaRAM set (auto-triggered) or when the EDMACC performs a link update on a PaRAM set that has been mapped to a QDMA channel (link triggered). This API enables the QDMA channel by writing to the QEESR register.
baseAddr | Memory address of the EDMA instance used. |
regionId | Region id to be used. Valid values are 0 to SOC_EDMA_NUM_REGIONS-1 |
chNum | Channel being used to enable transfer. Valid values are 0 to SOC_EDMA_NUM_DMACH-1 for DMA |
trigMode | Mode of triggering start of transfer (Manual, QDMA or Event). trigMode can have values: EDMA_TRIG_MODE_MANUAL EDMA_TRIG_MODE_QDMA EDMA_TRIG_MODE_EVENT |
uint32_t EDMA_disableTransferRegion | ( | uint32_t | baseAddr, |
uint32_t | regionId, | ||
uint32_t | chNum, | ||
uint32_t | trigMode | ||
) |
Disable DMA transfer on the specified channel.
There are multiple ways by which an EDMA transfer could be triggered. The triggering mode option allows choosing from the available triggering modes.
To disable a channel which was previously triggered in manual mode, this API clears the Secondary Event Register and Event Miss Register, if set, for the specific DMA channel.
To disable a channel which was previously triggered in QDMA mode, this API clears the QDMA Event Enable Register, for the specific QDMA channel.
To disable a channel which was previously triggered in event mode, this API clears the Event Enable Register, Event Register, Secondary Event Register and Event Miss Register, if set, for the specific DMA channel.
baseAddr | Memory address of the EDMA instance used. |
regionId | Region id to be used. Valid values are 0 to SOC_EDMA_NUM_REGIONS-1 |
chNum | Channel being used to enable transfer. Valid values are 0 to SOC_EDMA_NUM_DMACH-1 for DMA |
trigMode | Mode of triggering start of transfer (Manual, QDMA or Event). |
void EDMA_clearErrorBitsRegion | ( | uint32_t | baseAddr, |
uint32_t | regionId, | ||
uint32_t | chNum, | ||
uint32_t | evtQNum | ||
) |
Clears Event Register and Error Register for a specific DMA channel and brings back EDMA to its initial state.
This API clears the Event register, Event Miss register, Event Enable register for a specific DMA channel. It also clears the CC Error register.
baseAddr | Memory address of the EDMA instance used. |
regionId | Region id to be used. Valid values are 0 to SOC_EDMA_NUM_REGIONS-1 |
chNum | This is the channel number requested for a particular event. Valid values are 0 to SOC_EDMA_NUM_DMACH-1 for DMA |
evtQNum | Event Queue Number to which the channel will be unmapped (valid only for the Master Channel (DMA/QDMA) request). |
uint32_t EDMA_getCCErrStatus | ( | uint32_t | baseAddr | ) |
This returns EDMA CC error status.
baseAddr | Memory address of the EDMA instance used. |
uint32_t EDMA_getErrIntrStatus | ( | uint32_t | baseAddr | ) |
This returns error interrupt status for those events whose event number is less than 32.
baseAddr | Memory address of the EDMA instance used. |
uint32_t EDMA_qdmaGetErrIntrStatus | ( | uint32_t | baseAddr | ) |
This returns QDMA error interrupt status.
baseAddr | Memory address of the EDMA instance used. |
uint32_t EDMA_peripheralIdGet | ( | uint32_t | baseAddr | ) |
This API return the revision Id of the peripheral.
baseAddr | Memory address of the EDMA instance used. |
uint32_t EDMA_intrStatusHighGetRegion | ( | uint32_t | baseAddr, |
uint32_t | regionId | ||
) |
This function returns interrupt status of those events which are greater than 32.
baseAddr | Memory address of the EDMA instance used. |
regionId | Region id to be used. |
uint32_t EDMA_readIntrStatusRegion | ( | uint32_t | baseAddr, |
uint32_t | regionId, | ||
uint32_t | tccNum | ||
) |
This function reads interrupt status.
baseAddr | Memory address of the EDMA instance used. |
regionId | Region id to be used. |
tccNum | The channel number on which the completion/error interrupt is generated. |
uint32_t EDMA_getEventStatus | ( | uint32_t | baseAddr | ) |
This function returns status of those events which are less than 32.
baseAddr | Memory address of the EDMA instance used. |
uint32_t EDMA_getEventStatusHigh | ( | uint32_t | baseAddr | ) |
This function returns status of those events which are greater than 32.
baseAddr | Memory address of the EDMA instance used. |
uint32_t EDMA_readEventStatusRegion | ( | uint32_t | baseAddr, |
uint32_t | chNum | ||
) |
This function reads Event pending status.
baseAddr | Memory address of the EDMA instance used. |
chNum | Channel being used for transfer. Valid values are 0 to SOC_EDMA_NUM_DMACH-1 for DMA |
uint32_t EDMA_errIntrHighStatusGet | ( | uint32_t | baseAddr | ) |
This returns error interrupt status for those events whose event number is greater than 32.
baseAddr | Memory address of the EDMA instance used. |
void EDMA_chainChannel | ( | uint32_t | baseAddr, |
uint32_t | paRAMId1, | ||
uint32_t | chId2, | ||
uint32_t | chainOptions | ||
) |
Chain the two specified channels.
This API is used to chain a DMA channel to a previously allocated DMA/QDMA channel
Chaining is different from Linking. The EDMA link feature reloads the current channel parameter set with the linked parameter set. The EDMA chaining feature does not modify or update any channel parameter set; it provides a synchronization event (or trigger) to the chained DMA channel, as soon as the transfer (final or intermediate) completes on the main DMA/QDMA channel.
baseAddr | Memory address of the EDMA instance used. |
paRAMId1 | PaRAM set ID of physical channel1 to which particular paRAM set will be chained or PaRAM set ID in case another PaRAM set is being chained to this PaRAM set |
chId2 | DMA channel which needs to be chained to the first DMA/QDMA channel. |
chainOptions | combination of the following masks which control individual PaRAM OPT fields related to intermediate/final completion chaining and intermediate/final completion interrupt :
|
void EDMA_linkChannel | ( | uint32_t | baseAddr, |
uint32_t | paRAMId1, | ||
uint32_t | paRAMId2 | ||
) |
Link two channels.
This API is used to link two previously allocated logical (DMA/QDMA/Link) channels.
It sets the Link field of the PaRAM set associated with first channel (chId1) to point it to the PaRAM set associated with second channel (chId2).
It also sets the TCC field of PaRAM set of second channel to the same as that of the first channel.
baseAddr | Memory address of the EDMA instance used. |
paRAMId1 | PaRAM set ID of physical channel1 to which particular paRAM set will be linked or PaRAM set ID in case another PaRAM set is being linked to this PaRAM set |
paRAMId2 | PaRAM set ID which is linked to channel with parameter ID paRAMId1 |
After the transfer based on the PaRAM set of channel1 is over, the PaRAM set paRAMId2 will be copied to the PaRAM set of channel1 and transfer will resume. For DMA channels, another sync event is required to initiate the transfer on the Link channel.
void EDMA_init | ( | void | ) |
This function initializes the EDMA driver object and controller.
void EDMA_deinit | ( | void | ) |
This function Deinitializes the EDMA driver object and controller.
uint32_t EDMA_isInitialized | ( | EDMA_Handle | handle | ) |
Function to check if EDMA is enabled or not.
handle | EDMA_Handle returned from EDMA_open() |
EDMA_Handle EDMA_open | ( | uint32_t | index, |
const EDMA_Params * | prms | ||
) |
This function opens a given EDMA instance.
index | Index of config to use in the EDMA_Config array |
prms | Pointer to open parameters. |
EDMA_Handle EDMA_getHandle | ( | uint32_t | index | ) |
This function returns the handle of an open EDMA Instance from the instance index.
index | Index of config to use in the EDMA_Config array |
void EDMA_close | ( | EDMA_Handle | handle | ) |
Function to close a EDMA peripheral specified by the EDMA handle.
handle | EDMA_Handle returned from EDMA_open() |
uint32_t EDMA_isInterruptEnabled | ( | EDMA_Handle | handle | ) |
Function to check if EDMA interrupt is enabled.
handle | EDMA_Handle returned from EDMA_open() |
int32_t EDMA_registerIntr | ( | EDMA_Handle | handle, |
Edma_IntrObject * | intrObj | ||
) |
Function to register callback function for a TCC.
handle | EDMA_Handle returned from EDMA_open() |
intrObj | Pointer to interrupt parameters. intrObj will be held by the driver till EDMA_unregisterIntr() is called with the same intrObj and application should not modify the memory allocated to intrObj. |
int32_t EDMA_unregisterIntr | ( | EDMA_Handle | handle, |
Edma_IntrObject * | intrObj | ||
) |
Function to unregister callback function for a TCC.
handle | EDMA_Handle returned from EDMA_open() |
intrObj | Pointer to interrupt parameters object. This is the same object passed to EDMA_registerIntr() for interrupt registeration. |
uint32_t EDMA_getBaseAddr | ( | EDMA_Handle | handle | ) |
Function to get the edma base address.
handle | EDMA_Handle returned from EDMA_open() |
uint32_t EDMA_getRegionId | ( | EDMA_Handle | handle | ) |
Function to get the edma region.
handle | EDMA_Handle returned from EDMA_open() |
int32_t EDMA_allocDmaChannel | ( | EDMA_Handle | handle, |
uint32_t * | dmaCh | ||
) |
Function to allocate the Dma Channel.
handle | EDMA_Handle returned from EDMA_open() |
dmaCh | Set the value to DMA channel number to be allocated. Set to EDMA_RESOURCE_ALLOC_ANY to allocate any owned channel. Allocated channel number is stored in this. |
int32_t EDMA_allocQdmaChannel | ( | EDMA_Handle | handle, |
uint32_t * | qdmaCh | ||
) |
Function to allocate the Dma Channel.
handle | EDMA_Handle returned from EDMA_open() |
qdmaCh | Set the value to DMA channel number to be allocated. Set to EDMA_RESOURCE_ALLOC_ANY to allocate any owned channel. Allocated channel number is stored in this. |
int32_t EDMA_allocTcc | ( | EDMA_Handle | handle, |
uint32_t * | tcc | ||
) |
Function to allocate the Qdma Channel.
handle | EDMA_Handle returned from EDMA_open() |
tcc | Set the value to QDMA channel number to be allocated. Set to EDMA_RESOURCE_ALLOC_ANY to allocate any owned Qdma channel. Allocated channel number is stored in this. |
int32_t EDMA_allocParam | ( | EDMA_Handle | handle, |
uint32_t * | param | ||
) |
Function to allocate the TCC.
handle | EDMA_Handle returned from EDMA_open() |
param | Set the value to TCC to be allocated. Set to EDMA_RESOURCE_ALLOC_ANY to allocate any owned TCC. Allocated TCC number is stored in this. |
int32_t EDMA_freeDmaChannel | ( | EDMA_Handle | handle, |
uint32_t * | dmaCh | ||
) |
Function to free the Dma Channel.
handle | EDMA_Handle returned from EDMA_open() |
dmaCh | dma channel allocated using the call to EDMA_allocDmaChannel() |
int32_t EDMA_freeQdmaChannel | ( | EDMA_Handle | handle, |
uint32_t * | qdmaCh | ||
) |
Function to free the Qdma Channel.
handle | EDMA_Handle returned from EDMA_open() |
qdmaCh | qdma channel allocated using the call to EDMA_allocQdmaChannel() |
int32_t EDMA_freeTcc | ( | EDMA_Handle | handle, |
uint32_t * | tcc | ||
) |
Function to free the tcc Channel.
handle | EDMA_Handle returned from EDMA_open() |
tcc | tcc channel allocated using the call to EDMA_allocTcc() |
int32_t EDMA_freeParam | ( | EDMA_Handle | handle, |
uint32_t * | param | ||
) |
Function to free the Param.
handle | EDMA_Handle returned from EDMA_open() |
param | param allocated using the call to EDMA_allocParam() |
|
extern |
Externally defined driver configuration array.
|
extern |
Externally defined driver configuration array size.
|
extern |
Externally defined driver init parameters array.