Functions | |
EDMA3_DRV_Result | EDMA3_DRV_requestChannel (EDMA3_DRV_Handle hEdma, uint32_t *pLCh, uint32_t *pTcc, EDMA3_RM_EventQueue evtQueue, EDMA3_RM_TccCallback tccCb, void *cbData) |
Request a DMA/QDMA/Link channel. | |
EDMA3_DRV_Result | EDMA3_DRV_freeChannel (EDMA3_DRV_Handle hEdma, uint32_t channelId) |
Free the specified channel (DMA/QDMA/Link) and its associated resources (PaRAM Set, TCC etc) and removes various mappings. | |
EDMA3_DRV_Result | EDMA3_DRV_clearErrorBits (EDMA3_DRV_Handle hEdma, uint32_t channelId) |
Disables the DMA Channel by clearing the Event Enable Register and clears Error Register & Secondary Event Register for a specific DMA channel. | |
EDMA3_DRV_Result | EDMA3_DRV_setOptField (EDMA3_DRV_Handle hEdma, uint32_t lCh, EDMA3_DRV_OptField optField, uint32_t newOptFieldVal) |
Set a particular OPT field in the PaRAM set associated with the logical channel 'lCh'. | |
EDMA3_DRV_Result | EDMA3_DRV_getOptField (EDMA3_DRV_Handle hEdma, uint32_t lCh, EDMA3_DRV_OptField optField, uint32_t *optFieldVal) |
Get a particular OPT field in the PaRAM set associated with the logical channel 'lCh'. | |
EDMA3_DRV_Result | EDMA3_DRV_setSrcParams (EDMA3_DRV_Handle hEdma, uint32_t lCh, uint32_t srcAddr, EDMA3_DRV_AddrMode addrMode, EDMA3_DRV_FifoWidth fifoWidth) |
DMA source parameters setup. | |
EDMA3_DRV_Result | EDMA3_DRV_setDestParams (EDMA3_DRV_Handle hEdma, uint32_t lCh, uint32_t destAddr, EDMA3_DRV_AddrMode addrMode, EDMA3_DRV_FifoWidth fifoWidth) |
DMA Destination parameters setup. | |
EDMA3_DRV_Result | EDMA3_DRV_setSrcIndex (EDMA3_DRV_Handle hEdma, uint32_t lCh, int32_t srcBIdx, int32_t srcCIdx) |
DMA source index setup. | |
EDMA3_DRV_Result | EDMA3_DRV_setDestIndex (EDMA3_DRV_Handle hEdma, uint32_t lCh, int32_t destBIdx, int32_t destCIdx) |
DMA destination index setup. | |
EDMA3_DRV_Result | EDMA3_DRV_setTransferParams (EDMA3_DRV_Handle hEdma, uint32_t lCh, uint32_t aCnt, uint32_t bCnt, uint32_t cCnt, uint32_t bCntReload, EDMA3_DRV_SyncType syncType) |
DMA transfer parameters setup. | |
uint32_t | EDMA3_DRV_getVersion (void) |
Version information. | |
const char * | EDMA3_DRV_getVersionStr (void) |
Version string querry. | |
EDMA3_DRV_Result | EDMA3_DRV_enableTransfer (EDMA3_DRV_Handle hEdma, uint32_t lCh, EDMA3_DRV_TrigMode trigMode) |
Start EDMA transfer on the specified channel. | |
EDMA3_DRV_Result | EDMA3_DRV_disableTransfer (EDMA3_DRV_Handle hEdma, uint32_t lCh, EDMA3_DRV_TrigMode trigMode) |
Disable DMA transfer on the specified channel. | |
EDMA3_DRV_Result | EDMA3_DRV_disableLogicalChannel (EDMA3_DRV_Handle hEdma, uint32_t lCh, EDMA3_DRV_TrigMode trigMode) |
Disable the event driven DMA channel or QDMA channel. |
EDMA3_DRV_Result EDMA3_DRV_requestChannel | ( | EDMA3_DRV_Handle | hEdma, | |
uint32_t * | pLCh, | |||
uint32_t * | pTcc, | |||
EDMA3_RM_EventQueue | evtQueue, | |||
EDMA3_RM_TccCallback | tccCb, | |||
void * | cbData | |||
) |
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 also specify a specific TCC which needs to be allocated with the DMA/QDMA channel or else can request any available TCC.
For Link channels, ONLY a PaRAM Set is allocated and the allocated PaRAM Set number is returned as the logical channel no. A TCC code can also be specified while making the request. This TCC code will be copied to the LINK field of the allocated PaRAM Set and will be associated with the Link channel.
User can request a specific logical channel - DMA, QDMA and Link, by passing the channel id in 'pLCh'. Note that the channel id is the same as the actual resource id in case of DMA channels and Link channels. For DMA channels, channel id lies between 0 and (max dma channels - 1). For Link channels, channel id lies between (max dma channels) and (max param sets - 1). To allocate specific QDMA channels, user SHOULD use the defines EDMA3_DRV_QDMA_CHANNEL_X mentioned above.
User can also request ANY available logical channel by specifying the below mentioned values in '*pLCh': a) EDMA3_DRV_DMA_CHANNEL_ANY: For DMA channels b) EDMA3_DRV_QDMA_CHANNEL_ANY: For QDMA channels, and c) EDMA3_DRV_LINK_CHANNEL: For Link channels. Normally user should use this value to request link channels (PaRAM Sets used for linking purpose only), unless he wants to use some specific link channels (PaRAM Sets) which is also allowed. d) EDMA3_DRV_LINK_CHANNEL_WITH_TCC: For Link channels. User should use this value to request link channels with TCC code.
This API internally uses EDMA3_RM_allocResource () to allocate the desired resources (DMA/QDMA channel, PaRAM Set and TCC).
This API also registers a specific callback function, in case the same is provided, against the allocated TCC. To do this, this API calls EDMA3_RM_registerTccCb(), which is a part of the Resource Manager. Please note that the interrupts are enabled for the specific TCC only if callback function is provided. In the absence of this, the API assumes that the requested logical channel is going to be used in Poll mode environment.
For DMA/QDMA channels, after allocating all the EDMA3 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, if required.
For QDMA channel, it sets the QCHMAP register and CCNT as trigger word and enables the QDMA channel by writing to the QEESR register.
hEdma | [IN] Handle to the previously opened Driver Instance. | |
pLCh | [IN/OUT] Requested logical channel id. Examples:
|
In case user passes a specific channel Id, pLCh value is left unchanged. In case user requests ANY available resource, the allocated channel id is returned in pLCh.
*pLCh = EDMA3_DRV_LINK_CHANNEL or EDMA3_DRV_LINK_CHANNEL_WITH_TCC
This function will update *pLCh with the allocated Link channel handle.
pTcc | [IN/OUT] The channel number on which the completion/error interrupt is generated. Not used if user requested for a Link channel. Examples:
|
evtQueue | [IN] Event Queue Number to which the channel will be mapped (valid only for the Master Channel (DMA/QDMA) request) | |
tccCb | [IN] TCC callback - caters to channel- specific events like "Event Miss Error" or "Transfer Complete" | |
cbData | [IN] Data which will be passed directly to the tccCb callback function |
EDMA3_DRV_Result EDMA3_DRV_freeChannel | ( | EDMA3_DRV_Handle | hEdma, | |
uint32_t | channelId | |||
) |
Free the specified channel (DMA/QDMA/Link) and its associated resources (PaRAM Set, TCC etc) and removes various mappings.
This API internally uses EDMA3_RM_freeResource () to free the desired resources.
For Link channels, this API only frees the associated PaRAM Set.
For DMA/QDMA channels, it does the following operations: a) Disable any ongoing transfer on the channel, b) Unregister the TCC Callback function and disable the interrupts, c) Remove the channel to Event Queue mapping, d) For DMA channels, clear the DCHMAP register, if available e) For QDMA channels, clear the QCHMAP register, f) Frees the DMA/QDMA channel in the end.
hEdma | [IN] Handle to the EDMA Driver Instance. | |
channelId | [IN] Logical Channel number to be freed. |
EDMA3_DRV_Result EDMA3_DRV_clearErrorBits | ( | EDMA3_DRV_Handle | hEdma, | |
uint32_t | channelId | |||
) |
Disables the DMA Channel by clearing the Event Enable Register and clears Error Register & Secondary Event Register for a specific DMA channel.
This API clears the Event Enable register, Event Miss register and Secondary Event register for a specific DMA channel. It also clears the CC Error register.
hEdma | [IN] Handle to the EDMA Driver Instance. | |
channelId | [IN] DMA Channel needs to be cleaned. |
EDMA3_DRV_Result EDMA3_DRV_setOptField | ( | EDMA3_DRV_Handle | hEdma, | |
uint32_t | lCh, | |||
EDMA3_DRV_OptField | optField, | |||
uint32_t | newOptFieldVal | |||
) |
Set a particular OPT field in the PaRAM set associated with the logical channel 'lCh'.
This API can be used to set various optional parameters for an EDMA3 transfer. Like enable/disable completion interrupts, enable/disable chaining, setting the transfer mode (A/AB Sync), setting the FIFO width etc.
hEdma | [IN] Handle to the EDMA Driver Instance. | |
lCh | [IN] Logical Channel, bound to which PaRAM set OPT field needs to be set. | |
optField | [IN] The particular field of OPT Word that needs setting | |
newOptFieldVal | [IN] The new OPT field value |
EDMA3_DRV_Result EDMA3_DRV_getOptField | ( | EDMA3_DRV_Handle | hEdma, | |
uint32_t | lCh, | |||
EDMA3_DRV_OptField | optField, | |||
uint32_t * | optFieldVal | |||
) |
Get a particular OPT field in the PaRAM set associated with the logical channel 'lCh'.
This API can be used to read various optional parameters for an EDMA3 transfer. Like enable/disable completion interrupts, enable/disable chaining, setting the transfer mode (A/AB Sync), setting the FIFO width etc.
hEdma | [IN] Handle to the EDMA Driver Instance. | |
lCh | [IN] Logical Channel, bound to which PaRAM set OPT field is required. | |
optField | [IN] The particular field of OPT Word that is needed | |
optFieldVal | [IN/OUT] Value of the OPT field |
EDMA3_DRV_Result EDMA3_DRV_setSrcParams | ( | EDMA3_DRV_Handle | hEdma, | |
uint32_t | lCh, | |||
uint32_t | srcAddr, | |||
EDMA3_DRV_AddrMode | addrMode, | |||
EDMA3_DRV_FifoWidth | fifoWidth | |||
) |
DMA source parameters setup.
It is used to program the source address, source side addressing mode (INCR or FIFO) and the FIFO width in case the addressing mode is FIFO.
In FIFO Addressing mode, memory location must be 32 bytes aligned.
hEdma | [IN] Handle to the EDMA Driver Instance | |
lCh | [IN] Logical Channel for which the source parameters are to be configured | |
srcAddr | [IN] Source address | |
addrMode | [IN] Address mode [FIFO or Increment] | |
fifoWidth | [IN] Width of FIFO (Valid only if addrMode is FIFO)
|
EDMA3_DRV_Result EDMA3_DRV_setDestParams | ( | EDMA3_DRV_Handle | hEdma, | |
uint32_t | lCh, | |||
uint32_t | destAddr, | |||
EDMA3_DRV_AddrMode | addrMode, | |||
EDMA3_DRV_FifoWidth | fifoWidth | |||
) |
DMA Destination parameters setup.
It is used to program the destination address, destination side addressing mode (INCR or FIFO) and the FIFO width in case the addressing mode is FIFO.
In FIFO Addressing mode, memory location must be 32 bytes aligned.
hEdma | [IN] Handle to the EDMA Driver Instance | |
lCh | [IN] Logical Channel for which the destination parameters are to be configured | |
destAddr | [IN] Destination address | |
addrMode | [IN] Address mode [FIFO or Increment] | |
fifoWidth | [IN] Width of FIFO (Valid only if addrMode is FIFO)
|
EDMA3_DRV_Result EDMA3_DRV_setSrcIndex | ( | EDMA3_DRV_Handle | hEdma, | |
uint32_t | lCh, | |||
int32_t | srcBIdx, | |||
int32_t | srcCIdx | |||
) |
DMA source index setup.
It is used to program the source B index and source C index.
SRCBIDX is a 16-bit signed value (2s complement) used for source address modification between each array in the 2nd dimension. Valid values for SRCBIDX are between -32768 and 32767. It provides a byte address offset from the beginning of the source array to the beginning of the next source array. It applies to both A-synchronized and AB-synchronized transfers.
SRCCIDX is a 16-bit signed value (2s complement) used for source address modification in the 3rd dimension. Valid values for SRCCIDX are between -32768 and 32767. It provides a byte address offset from the beginning of the current array (pointed to by SRC address) to the beginning of the first source array in the next frame. It applies to both A-synchronized and AB-synchronized transfers. Note that when SRCCIDX is applied, the current array in an A-synchronized transfer is the last array in the frame, while the current array in an AB-synchronized transfer is the first array in the frame.
hEdma | [IN] Handle to the EDMA Driver Instance | |
lCh | [IN] Logical Channel for which source indices are to be configured | |
srcBIdx | [IN] Source B index | |
srcCIdx | [IN] Source C index |
EDMA3_DRV_Result EDMA3_DRV_setDestIndex | ( | EDMA3_DRV_Handle | hEdma, | |
uint32_t | lCh, | |||
int32_t | destBIdx, | |||
int32_t | destCIdx | |||
) |
DMA destination index setup.
It is used to program the destination B index and destination C index.
DSTBIDX is a 16-bit signed value (2s complement) used for destination address modification between each array in the 2nd dimension. Valid values for DSTBIDX are between -32768 and 32767. It provides a byte address offset from the beginning of the destination array to the beginning of the next destination array within the current frame. It applies to both A-synchronized and AB-synchronized transfers.
DSTCIDX is a 16-bit signed value (2s complement) used for destination address modification in the 3rd dimension. Valid values are between -32768 and 32767. It provides a byte address offset from the beginning of the current array (pointed to by DST address) to the beginning of the first destination array TR in the next frame. It applies to both A-synchronized and AB-synchronized transfers. Note that when DSTCIDX is applied, the current array in an A-synchronized transfer is the last array in the frame, while the current array in a AB-synchronized transfer is the first array in the frame
hEdma | [IN] Handle to the EDMA Driver Instance | |
lCh | [IN] Logical Channel for which dest indices are to be configured | |
destBIdx | [IN] Destination B index | |
destCIdx | [IN] Destination C index |
EDMA3_DRV_Result EDMA3_DRV_setTransferParams | ( | EDMA3_DRV_Handle | hEdma, | |
uint32_t | lCh, | |||
uint32_t | aCnt, | |||
uint32_t | bCnt, | |||
uint32_t | cCnt, | |||
uint32_t | bCntReload, | |||
EDMA3_DRV_SyncType | syncType | |||
) |
DMA transfer parameters setup.
It is used to specify the various counts (ACNT, BCNT and CCNT), B count reload and the synchronization type
ACNT represents the number of bytes within the 1st dimension of a transfer. ACNT is a 16-bit unsigned value with valid values between 0 and 65535. Therefore, the maximum number of bytes in an array is 65535 bytes (64K - 1 bytes). ACNT must be greater than or equal to 1 for a TR to be submitted to EDMA3 Transfer Controller. An ACNT equal to 0 is considered either a null or dummy transfer. A dummy or null transfer generates a completion code depending on the settings of the completion bit fields in OPT.
BCNT is a 16-bit unsigned value that specifies the number of arrays of length ACNT. For normal operation, valid values for BCNT are between 1 and 65535. Therefore, the maximum number of arrays in a frame is 65535 (64K - 1 arrays). A BCNT equal to 0 is considered either a null or dummy transfer. A dummy or null transfer generates a completion code depending on the settings of the completion bit fields in OPT.
CCNT is a 16-bit unsigned value that specifies the number of frames in a block. Valid values for CCNT are between 1 and 65535. Therefore, the maximum number of frames in a block is 65535 (64K - 1 frames). A CCNT equal to 0 is considered either a null or dummy transfer. A dummy or null transfer generates a completion code depending on the settings of the completion bit fields in OPT. A CCNT value of 0 is considered either a null or dummy transfer.
BCNTRLD is a 16-bit unsigned value used to reload the BCNT field once the last array in the 2nd dimension is transferred. This field is only used for A-synchronized transfers. In this case, the EDMA3CC decrements the BCNT value by 1 on each TR submission. When BCNT (conceptually) reaches 0, the EDMA3CC decrements CCNT and uses the BCNTRLD value to reinitialize the BCNT value. For AB-synchronized transfers, the EDMA3CC submits the BCNT in the TR and the EDMA3TC decrements BCNT appropriately. For AB-synchronized transfers, BCNTRLD is not used.
hEdma | [IN] Handle to the EDMA Driver Instance | |
lCh | [IN] Logical Channel for which transfer parameters are to be configured | |
aCnt | [IN] Count for 1st Dimension. | |
bCnt | [IN] Count for 2nd Dimension. | |
cCnt | [IN] Count for 3rd Dimension. | |
bCntReload | [IN] Reload value for bCnt. | |
syncType | [IN] Transfer synchronization dimension 0: A-synchronized. Each event triggers the transfer of a single array of ACNT bytes. 1: AB-synchronized. Each event triggers the transfer of BCNT arrays of ACNT bytes. |
uint32_t EDMA3_DRV_getVersion | ( | void | ) |
Version information.
The function is used to get the version information of the EDMA LLD.
const char* EDMA3_DRV_getVersionStr | ( | void | ) |
Version string querry.
The function is used to get the version string for the EDMA LLD.
EDMA3_DRV_Result EDMA3_DRV_enableTransfer | ( | EDMA3_DRV_Handle | hEdma, | |
uint32_t | lCh, | |||
EDMA3_DRV_TrigMode | trigMode | |||
) |
Start EDMA transfer on the specified channel.
There are multiple ways to trigger an EDMA3 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 Secondary Event Register 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/ESRH). This API writes to the ESR/ESRH to start the transfer.
In QDMA triggered mode, a QDMA transfer is triggered when a CPU (or other EDMA3 programmer) writes to the trigger word of the QDMA channel PaRAM set (auto-triggered) or when the EDMA3CC 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.
hEdma | [IN] Handle to the EDMA Driver Instance | |
lCh | [IN] Channel on which transfer has to be started | |
trigMode | [IN] Mode of triggering start of transfer (Manual, QDMA or Event) |
EDMA3_DRV_Result EDMA3_DRV_disableTransfer | ( | EDMA3_DRV_Handle | hEdma, | |
uint32_t | lCh, | |||
EDMA3_DRV_TrigMode | trigMode | |||
) |
Disable DMA transfer on the specified channel.
There are multiple ways by which an EDMA3 transfer could be triggered. The triggering mode option allows choosing from the available triggering modes: Event, Manual or QDMA.
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. It also clears Event Register, Secondary Event Register and Event Miss Register, if set, for the specific DMA channel.
hEdma | [IN] Handle to the EDMA Driver Instance | |
lCh | [IN] Channel on which transfer has to be stopped | |
trigMode | [IN] Mode of triggering start of transfer |
EDMA3_DRV_Result EDMA3_DRV_disableLogicalChannel | ( | EDMA3_DRV_Handle | hEdma, | |
uint32_t | lCh, | |||
EDMA3_DRV_TrigMode | trigMode | |||
) |
Disable the event driven DMA channel or QDMA channel.
This API disables the DMA channel (which was previously triggered in event mode) by clearing the Event Enable Register; it disables the QDMA channel by clearing the QDMA Event Enable Register.
This API should NOT be used for DMA channels which are not mapped to any hardware events and are used for memory-to-memory copy based transfers. In case of that, this API returns error.
hEdma | [IN] Handle to the EDMA Driver Instance | |
lCh | [IN] DMA/QDMA Channel which needs to be disabled | |
trigMode | [IN] Mode of triggering start of transfer |