AM263x MCU+ SDK  10.00.00
edma/v0/edma.h File Reference

Introduction

This file contains the prototype of EDMA driver APIs.

Please find the below detailed description of edma dal.

  1. Programming sequence for initializing the edma controller
    1. Perform the clock configuration of channel controller and transfer controllers.
    2. To perform initialization of controller use the
      1. EDMA_init with appropriate EDMA_InitParams which is part of the EDMA_Attrs
  2. Programming sequence for setting up edma channel.
    1. To configure the PaRAM sets use EDMA_setPaRAM. For custom use
    2. To start transfer use EDMA_enableTransferRegion.
    3. To stop transfer use EDMA_disableTransferRegion.

Go to the source code of this file.

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...
 

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.

AB Sync Transfer

#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)
 

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...
 

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...
 

Variables

EDMA_Config gEdmaConfig []
 Externally defined driver configuration array. More...
 
uint32_t gEdmaConfigNum
 Externally defined driver configuration array size. More...
 
EDMA_InitParams gEdmaInitParams []
 Externally defined driver init parameters array. More...