![]() |
S32 SDK
|
This module covers the functionality of the Enhanced Direct Memory Access (eDMA) peripheral hardware abstraction layer.
eDMA HAL provides the API for reading and writing register bit-fields belonging to the eDMA module. It also provides an initialization function for bringing the module to the reset state.
The eDMA HAL functions are used by the eDMA driver, as well as other drivers for peripherals that have DMA features (communication/analogue).
For higher-level functionality, use the eDMA driver.
eDMA HAL driver module level operation | |
void | EDMA_HAL_Init (DMA_Type *base) |
Initializes eDMA module to known state. More... | |
void | EDMA_HAL_CancelTransfer (DMA_Type *base) |
Cancels the remaining data transfer. More... | |
void | EDMA_HAL_CancelTransferWithError (DMA_Type *base) |
Cancels the remaining data transfer and treats it as an error condition. More... | |
static void | EDMA_HAL_SetHaltCmd (DMA_Type *base, bool halt) |
Halts/Un-halts the DMA Operations. More... | |
static void | EDMA_HAL_SetHaltOnErrorCmd (DMA_Type *base, bool haltOnError) |
Halts or does not halt the eDMA module when an error occurs. More... | |
static void | EDMA_HAL_SetDebugCmd (DMA_Type *base, bool enable) |
Enables/Disables the eDMA DEBUG mode. More... | |
eDMA HAL error checking | |
static bool | EDMA_HAL_GetValidErrorNotCleared (const DMA_Type *base) |
Checks for valid errors. More... | |
static bool | EDMA_HAL_GetTransferCancelledError (const DMA_Type *base) |
Checks for cancelled transfers. More... | |
static bool | EDMA_HAL_GetChannelPriorityError (const DMA_Type *base) |
Checks for channel priority errors. More... | |
static bool | EDMA_HAL_GetSourceAddressError (const DMA_Type *base) |
Checks for source address errors. More... | |
static bool | EDMA_HAL_GetSourceOffsetError (const DMA_Type *base) |
Checks for source offset errors. More... | |
static bool | EDMA_HAL_GetDestinationAddressError (const DMA_Type *base) |
Checks for destination address errors. More... | |
static bool | EDMA_HAL_GetDestinationOffsetError (const DMA_Type *base) |
Checks for destination offset errors. More... | |
static bool | EDMA_HAL_GetMinorMajorLoopConfigError (const DMA_Type *base) |
Checks for minor/major loop configuration errors. More... | |
static bool | EDMA_HAL_GetScatterGatherError (const DMA_Type *base) |
Checks for scatter/gather configuration errors. More... | |
static bool | EDMA_HAL_GetSourceBusError (const DMA_Type *base) |
Checks for source bus errors. More... | |
static bool | EDMA_HAL_GetDestinationBusError (const DMA_Type *base) |
Checks for destination bus errors. More... | |
static uint8_t | EDMA_HAL_GetChannelWithError (const DMA_Type *base) |
Error channel number. More... | |
eDMA HAL driver channel priority and arbitration configuration | |
static void | EDMA_HAL_SetChannelPreemptMode (DMA_Type *base, uint32_t channel, bool preemptive, bool preemptible) |
Sets the preemption feature for the eDMA channel. More... | |
static void | EDMA_HAL_SetChannelPriority (DMA_Type *base, uint32_t channel, edma_channel_priority_t priority) |
Sets the eDMA channel priority. More... | |
static void | EDMA_HAL_SetChannelArbitrationMode (DMA_Type *base, edma_arbitration_algorithm_t channelArbitration) |
Sets the channel arbitration algorithm. More... | |
static edma_arbitration_algorithm_t | EDMA_HAL_GetChannelArbitrationMode (const DMA_Type *base) |
Gets the channel arbitration algorithm. More... | |
eDMA HAL driver configuration and operation | |
static void | EDMA_HAL_SetMinorLoopMappingCmd (DMA_Type *base, bool enable) |
Enables/Disables the minor loop mapping. More... | |
static void | EDMA_HAL_SetContinuousLinkCmd (DMA_Type *base, bool continuous) |
Enables or disables the continuous transfer mode. More... | |
void | EDMA_HAL_SetErrorIntCmd (DMA_Type *base, uint8_t channel, bool enable) |
Enables/Disables the error interrupt for channels. More... | |
static uint32_t | EDMA_HAL_GetErrorIntStatusFlag (const DMA_Type *base) |
Gets the eDMA error interrupt status. More... | |
static void | EDMA_HAL_ClearErrorIntStatusFlag (DMA_Type *base, uint8_t channel) |
Clears the error interrupt status for the eDMA channel or channels. More... | |
void | EDMA_HAL_SetDmaRequestCmd (DMA_Type *base, uint8_t channel, bool enable) |
Enables/Disables the DMA request for the channel or all channels. More... | |
static bool | EDMA_HAL_GetDmaRequestStatusFlag (const DMA_Type *base, uint32_t channel) |
Gets the eDMA channel DMA request status. More... | |
static void | EDMA_HAL_ClearDoneStatusFlag (DMA_Type *base, uint8_t channel) |
Clears the done status for a channel or all channels. More... | |
static void | EDMA_HAL_TriggerChannelStart (DMA_Type *base, uint8_t channel) |
Triggers the eDMA channel. More... | |
static bool | EDMA_HAL_GetIntStatusFlag (const DMA_Type *base, uint32_t channel) |
Gets the eDMA channel interrupt request status. More... | |
static void | EDMA_HAL_ClearIntStatusFlag (DMA_Type *base, uint8_t channel) |
Clears the interrupt status for the eDMA channel or all channels. More... | |
static void | EDMA_HAL_SetAsyncRequestInStopModeCmd (DMA_Type *base, uint32_t channel, bool enable) |
Enables/Disables an asynchronous request in stop mode. More... | |
eDMA HAL driver TCD configuration functions | |
void | EDMA_HAL_TCDClearReg (DMA_Type *base, uint32_t channel) |
Clears all registers to 0 for the hardware TCD. More... | |
static void | EDMA_HAL_TCDSetSrcAddr (DMA_Type *base, uint32_t channel, uint32_t address) |
Configures the source address for the hardware TCD. More... | |
static void | EDMA_HAL_TCDSetSrcOffset (DMA_Type *base, uint32_t channel, int16_t offset) |
Configures the source address signed offset for the hardware TCD. More... | |
void | EDMA_HAL_TCDSetAttribute (DMA_Type *base, uint32_t channel, edma_modulo_t srcModulo, edma_modulo_t destModulo, edma_transfer_size_t srcTransferSize, edma_transfer_size_t destTransferSize) |
Configures the transfer attribute for the eDMA channel. More... | |
void | EDMA_HAL_TCDSetNbytes (DMA_Type *base, uint32_t channel, uint32_t nbytes) |
Configures the nbytes for the eDMA channel. More... | |
uint32_t | EDMA_HAL_TCDGetNbytes (const DMA_Type *base, uint32_t channel) |
Gets the nbytes configuration data for the TCD. More... | |
static void | EDMA_HAL_TCDSetSrcMinorLoopOffsetCmd (DMA_Type *base, uint32_t channel, bool enable) |
Enables/disables the source minor loop offset feature for the TCD. More... | |
static void | EDMA_HAL_TCDSetDestMinorLoopOffsetCmd (DMA_Type *base, uint32_t channel, bool enable) |
Enables/disables the destination minor loop offset feature for the TCD. More... | |
void | EDMA_HAL_TCDSetMinorLoopOffset (DMA_Type *base, uint32_t channel, int32_t offset) |
Configures the minor loop offset for the TCD. More... | |
static void | EDMA_HAL_TCDSetSrcLastAdjust (DMA_Type *base, uint32_t channel, int32_t size) |
Configures the last source address adjustment for the TCD. More... | |
static void | EDMA_HAL_TCDSetDestAddr (DMA_Type *base, uint32_t channel, uint32_t address) |
Configures the destination address for the TCD. More... | |
static void | EDMA_HAL_TCDSetDestOffset (DMA_Type *base, uint32_t channel, int16_t offset) |
Configures the destination address signed offset for the TCD. More... | |
static void | EDMA_HAL_TCDSetDestLastAdjust (DMA_Type *base, uint32_t channel, int32_t adjust) |
Configures the last source address adjustment. More... | |
void | EDMA_HAL_TCDSetScatterGatherLink (DMA_Type *base, uint32_t channel, uint32_t nextTCDAddr) |
Configures the memory address for the next transfer TCD for the TCD. More... | |
static void | EDMA_HAL_TCDSetBandwidth (DMA_Type *base, uint32_t channel, edma_bandwidth_config_t bandwidth) |
Configures the bandwidth for the TCD. More... | |
static void | EDMA_HAL_TCDSetChannelMajorLink (DMA_Type *base, uint32_t channel, uint32_t majorLinkChannel, bool enable) |
Configures the major channel link the TCD. More... | |
static void | EDMA_HAL_TCDSetScatterGatherCmd (DMA_Type *base, uint32_t channel, bool enable) |
Enables/Disables the scatter/gather feature for the TCD. More... | |
static void | EDMA_HAL_TCDSetDisableDmaRequestAfterTCDDoneCmd (DMA_Type *base, uint32_t channel, bool disable) |
Disables/Enables the DMA request after the major loop completes for the TCD. More... | |
static void | EDMA_HAL_TCDSetHalfCompleteIntCmd (DMA_Type *base, uint32_t channel, bool enable) |
Enables/Disables the half complete interrupt for the TCD. More... | |
static void | EDMA_HAL_TCDSetIntCmd (DMA_Type *base, uint32_t channel, bool enable) |
Enables/Disables the interrupt after the major loop completes for the TCD. More... | |
static void | EDMA_HAL_TCDTriggerChannelStart (DMA_Type *base, uint32_t channel) |
Triggers the start bits for the TCD. More... | |
static bool | EDMA_HAL_TCDGetChannelActiveStatus (const DMA_Type *base, uint32_t channel) |
Checks whether the channel is running for the TCD. More... | |
void | EDMA_HAL_TCDSetChannelMinorLink (DMA_Type *base, uint32_t channel, uint32_t linkChannel, bool enable) |
Sets the channel minor link for the TCD. More... | |
void | EDMA_HAL_TCDSetMajorCount (DMA_Type *base, uint32_t channel, uint32_t count) |
Sets the major iteration count according to minor loop channel link setting. More... | |
uint32_t | EDMA_HAL_TCDGetBeginMajorCount (const DMA_Type *base, uint32_t channel) |
Returns the begin major iteration count. More... | |
uint32_t | EDMA_HAL_TCDGetCurrentMajorCount (const DMA_Type *base, uint32_t channel) |
Returns the current major iteration count. More... | |
uint32_t | EDMA_HAL_TCDGetFinishedBytes (const DMA_Type *base, uint32_t channel) |
Gets the number of bytes already transferred for the TCD. More... | |
uint32_t | EDMA_HAL_TCDGetUnfinishedBytes (const DMA_Type *base, uint32_t channel) |
Gets the number of bytes haven't transferred for the TCD. More... | |
static bool | EDMA_HAL_TCDGetDoneStatusFlag (const DMA_Type *base, uint32_t channel) |
Gets the channel done status. More... | |
eDMA channel arbitration algorithm used for selection among channels. Implements : edma_arbitration_algorithm_t_Class
Enumerator | |
---|---|
EDMA_ARBITRATION_FIXED_PRIORITY |
Fixed Priority |
EDMA_ARBITRATION_ROUND_ROBIN |
Round-Robin arbitration |
Definition at line 54 of file edma_hal.h.
Bandwidth control configuration Implements : edma_bandwidth_config_t_Class.
Definition at line 143 of file edma_hal.h.
eDMA channel priority setting Implements : edma_channel_priority_t_Class
Definition at line 62 of file edma_hal.h.
enum edma_modulo_t |
eDMA modulo configuration Implements : edma_modulo_t_Class
Definition at line 94 of file edma_hal.h.
enum edma_transfer_size_t |
eDMA transfer configuration Implements : edma_transfer_size_t_Class
Enumerator | |
---|---|
EDMA_TRANSFER_SIZE_1B | |
EDMA_TRANSFER_SIZE_2B | |
EDMA_TRANSFER_SIZE_4B | |
EDMA_TRANSFER_SIZE_16B | |
EDMA_TRANSFER_SIZE_32B |
Definition at line 132 of file edma_hal.h.
void EDMA_HAL_CancelTransfer | ( | DMA_Type * | base | ) |
Cancels the remaining data transfer.
This function stops the executing channel and forces the minor loop to finish. The cancellation takes effect after the last write of the current read/write sequence. The CX clears itself after the cancel has been honored. This cancel retires the channel normally as if the minor loop had completed.
base | Register base address for eDMA module. |
Definition at line 70 of file edma_hal.c.
void EDMA_HAL_CancelTransferWithError | ( | DMA_Type * | base | ) |
Cancels the remaining data transfer and treats it as an error condition.
This function stops the executing channel and forces the minor loop to finish. The cancellation takes effect after the last write of the current read/write sequence. The CX clears itself after the cancel has been honoured. This cancel retires the channel normally as if the minor loop had completed. Additional thing is to treat this operation as an error condition.
base | Register base address for eDMA module. |
Definition at line 88 of file edma_hal.c.
|
inlinestatic |
Clears the done status for a channel or all channels.
base | Register base address for eDMA module. |
channel | Channel indicator. If kEDMAAllChannel is selected, all channels' done status will be cleared. Implements : EDMA_HAL_ClearDoneStatusFlag_Activity |
Definition at line 688 of file edma_hal.h.
|
inlinestatic |
Clears the error interrupt status for the eDMA channel or channels.
base | Register base address for eDMA module. |
channel | Channel indicator. If kEDMAAllChannel is selected, all channels' error interrupt status will be cleared. Implements : EDMA_HAL_ClearErrorIntStatusFlag_Activity |
Definition at line 645 of file edma_hal.h.
|
inlinestatic |
Clears the interrupt status for the eDMA channel or all channels.
base | Register base address for eDMA module. |
channel | Channel indicator. If kEDMAAllChannel is selected, all channels' interrupt status will be cleared. Implements : EDMA_HAL_ClearIntStatusFlag_Activity |
Definition at line 737 of file edma_hal.h.
|
inlinestatic |
Gets the channel arbitration algorithm.
base | Register base address for eDMA module. |
Definition at line 512 of file edma_hal.h.
|
inlinestatic |
Checks for channel priority errors.
Returns whether the channel priorities configuration was erroneous (priorities not unique).
base | Register base address for eDMA module. |
Definition at line 300 of file edma_hal.h.
|
inlinestatic |
Error channel number.
Returns the channel number of the last recorded error.
base | Register base address for eDMA module. |
Definition at line 426 of file edma_hal.h.
|
inlinestatic |
Checks for destination address errors.
Returns whether the destination address configuration was erroneous.
base | Register base address for eDMA module. |
Definition at line 342 of file edma_hal.h.
|
inlinestatic |
Checks for destination bus errors.
Returns whether there was a bus error on a destination write.
base | Register base address for eDMA module. |
Definition at line 412 of file edma_hal.h.
|
inlinestatic |
Checks for destination offset errors.
Returns whether the destination offset configuration was erroneous.
base | Register base address for eDMA module. |
Definition at line 356 of file edma_hal.h.
|
inlinestatic |
Gets the eDMA channel DMA request status.
base | Register base address for eDMA module. |
channel | eDMA channel number. |
Definition at line 672 of file edma_hal.h.
|
inlinestatic |
Gets the eDMA error interrupt status.
base | Register base address for eDMA module. |
Definition at line 632 of file edma_hal.h.
|
inlinestatic |
Gets the eDMA channel interrupt request status.
base | Register base address for eDMA module. |
channel | eDMA channel number. |
Definition at line 720 of file edma_hal.h.
|
inlinestatic |
Checks for minor/major loop configuration errors.
Returns whether the NBYTES or CITER fields configuration was erroneous.
base | Register base address for eDMA module. |
Definition at line 370 of file edma_hal.h.
|
inlinestatic |
Checks for scatter/gather configuration errors.
Returns whether the scatter/gather configuration was erroneous.
base | Register base address for eDMA module. |
Definition at line 384 of file edma_hal.h.
|
inlinestatic |
Checks for source address errors.
Returns whether the source address configuration was erroneous.
base | Register base address for eDMA module. |
Definition at line 314 of file edma_hal.h.
|
inlinestatic |
Checks for source bus errors.
Returns whether there was a bus error on a source read.
base | Register base address for eDMA module. |
Definition at line 398 of file edma_hal.h.
|
inlinestatic |
Checks for source offset errors.
Returns whether the source offset configuration was erroneous.
base | Register base address for eDMA module. |
Definition at line 328 of file edma_hal.h.
|
inlinestatic |
Checks for cancelled transfers.
Returns whether the last entry was a cancelled transfer, by the error cancel transfer input
base | Register base address for eDMA module. |
Definition at line 285 of file edma_hal.h.
|
inlinestatic |
Checks for valid errors.
Returns whether a valid error exists, that has not been cleared.
base | Register base address for eDMA module. |
Definition at line 270 of file edma_hal.h.
void EDMA_HAL_Init | ( | DMA_Type * | base | ) |
Initializes eDMA module to known state.
base | Register base address for eDMA module. |
Definition at line 42 of file edma_hal.c.
|
inlinestatic |
Enables/Disables an asynchronous request in stop mode.
base | Register base address for eDMA module. |
channel | eDMA channel number. |
enable | Enable (true) or Disable (false) async DMA request. Implements : EDMA_HAL_SetAsyncRequestInStopModeCmd_Activity |
Definition at line 755 of file edma_hal.h.
|
inlinestatic |
Sets the channel arbitration algorithm.
base | Register base address for eDMA module. |
channelArbitration | Round-Robin way or fixed priority way. Implements : EDMA_HAL_SetChannelArbitrationMode_Activity |
Definition at line 496 of file edma_hal.h.
|
inlinestatic |
Sets the preemption feature for the eDMA channel.
This function sets the preemption features.
base | Register base address for eDMA module. |
channel | eDMA channel number. |
preemptive | eDMA channel can suspend a lower priority channel (true). eDMA channel cannot suspend a lower priority channel (false). |
preemptible | eDMA channel can be temporarily suspended by the service request of a higher priority channel (true). eDMA channel can't be suspended by a higher priority channel (false). Implements : EDMA_HAL_SetChannelPreemptMode_Activity |
Definition at line 450 of file edma_hal.h.
|
inlinestatic |
Sets the eDMA channel priority.
base | Register base address for eDMA module. |
channel | eDMA channel number. |
priority | Priority of the DMA channel. Different channels should have different priority setting inside a group. Implements : EDMA_HAL_SetChannelPriority_Activity |
Definition at line 475 of file edma_hal.h.
|
inlinestatic |
Enables or disables the continuous transfer mode.
This function enables or disables the continuous transfer. If set, a minor loop channel link does not go through the channel arbitration before being activated again. Upon minor loop completion, the channel activates again if that channel has a minor loop channel link enabled and the link channel is itself.
base | Register base address for eDMA module. |
continuous | Enables (true) or Disable (false) continuous transfer mode. Implements : EDMA_HAL_SetContinuousLinkCmd_Activity |
Definition at line 605 of file edma_hal.h.
|
inlinestatic |
Enables/Disables the eDMA DEBUG mode.
This function enables/disables the eDMA Debug mode. When in debug mode, the DMA stalls the start of a new channel. Executing channels are allowed to complete. Channel execution resumes either when the system exits debug mode or when the EDBG bit is cleared.
base | Register base address for eDMA module. |
enable | Enables (true) or Disable (false) eDMA module debug mode. Implements : EDMA_HAL_SetDebugCmd_Activity |
Definition at line 246 of file edma_hal.h.
void EDMA_HAL_SetDmaRequestCmd | ( | DMA_Type * | base, |
uint8_t | channel, | ||
bool | enable | ||
) |
Enables/Disables the DMA request for the channel or all channels.
base | Register base address for eDMA module. |
enable | Enable(true) or Disable (false) DMA request. |
channel | Channel indicator. If kEDMAAllChannel is selected, all channels DMA request are enabled/disabled. |
Definition at line 125 of file edma_hal.c.
void EDMA_HAL_SetErrorIntCmd | ( | DMA_Type * | base, |
uint8_t | channel, | ||
bool | enable | ||
) |
Enables/Disables the error interrupt for channels.
base | Register base address for eDMA module. |
channel | Channel indicator. If kEDMAAllChannel is selected, all channels' error interrupt will be enabled/disabled. |
enable | Enable(true) or Disable (false) error interrupt. |
Definition at line 106 of file edma_hal.c.
|
inlinestatic |
Halts/Un-halts the DMA Operations.
This function stalls/un-stalls the start of any new channels. Executing channels are allowed to be completed.
base | Register base address for eDMA module. |
halt | Halts (true) or un-halts (false) eDMA transfer. Implements : EDMA_HAL_SetHaltCmd_Activity |
Definition at line 206 of file edma_hal.h.
|
inlinestatic |
Halts or does not halt the eDMA module when an error occurs.
An error causes the HALT bit to be set. Subsequently, all service requests are ignored until the HALT bit is cleared.
base | Register base address for eDMA module. |
haltOnError | Halts (true) or not halt (false) eDMA module when an error occurs. Implements : EDMA_HAL_SetHaltOnErrorCmd_Activity |
Definition at line 225 of file edma_hal.h.
|
inlinestatic |
Enables/Disables the minor loop mapping.
This function enables/disables the minor loop mapping feature. If enabled, the NBYTES is redefined to include the individual enable fields and the NBYTES field. The individual enable fields allow the minor loop offset to be applied to the source address, the destination address, or both. The NBYTES field is reduced when either offset is enabled.
base | Register base address for eDMA module. |
enable | Enables (true) or Disable (false) minor loop mapping. Implements : EDMA_HAL_SetMinorLoopMappingCmd_Activity |
Definition at line 584 of file edma_hal.h.
void EDMA_HAL_TCDClearReg | ( | DMA_Type * | base, |
uint32_t | channel | ||
) |
Clears all registers to 0 for the hardware TCD.
base | Register base address for eDMA module. |
channel | eDMA channel number. |
Definition at line 172 of file edma_hal.c.
uint32_t EDMA_HAL_TCDGetBeginMajorCount | ( | const DMA_Type * | base, |
uint32_t | channel | ||
) |
Returns the begin major iteration count.
Gets the begin major iteration count according to minor loop channel link settings.
base | Register base address for eDMA module. |
channel | eDMA channel number. |
Definition at line 429 of file edma_hal.c.
|
inlinestatic |
Checks whether the channel is running for the TCD.
base | Register base address for eDMA module. |
channel | eDMA channel number. |
Definition at line 1207 of file edma_hal.h.
uint32_t EDMA_HAL_TCDGetCurrentMajorCount | ( | const DMA_Type * | base, |
uint32_t | channel | ||
) |
Returns the current major iteration count.
Gets the current major iteration count according to minor loop channel link settings.
base | Register base address for eDMA module. |
channel | eDMA channel number. |
Definition at line 454 of file edma_hal.c.
|
inlinestatic |
Gets the channel done status.
base | Register base address for eDMA module. |
channel | eDMA channel number. |
Definition at line 1285 of file edma_hal.h.
uint32_t EDMA_HAL_TCDGetFinishedBytes | ( | const DMA_Type * | base, |
uint32_t | channel | ||
) |
Gets the number of bytes already transferred for the TCD.
base | Register base address for eDMA module. |
channel | eDMA channel number. |
Definition at line 510 of file edma_hal.c.
uint32_t EDMA_HAL_TCDGetNbytes | ( | const DMA_Type * | base, |
uint32_t | channel | ||
) |
Gets the nbytes configuration data for the TCD.
This function decides whether the minor loop mapping is enabled or whether the source/dest minor loop mapping is enabled. Then, the nbytes are returned accordingly.
base | Register base address for eDMA module. |
channel | eDMA channel number. |
Definition at line 256 of file edma_hal.c.
uint32_t EDMA_HAL_TCDGetUnfinishedBytes | ( | const DMA_Type * | base, |
uint32_t | channel | ||
) |
Gets the number of bytes haven't transferred for the TCD.
base | Register base address for eDMA module. |
channel | eDMA channel number. |
Definition at line 480 of file edma_hal.c.
void EDMA_HAL_TCDSetAttribute | ( | DMA_Type * | base, |
uint32_t | channel, | ||
edma_modulo_t | srcModulo, | ||
edma_modulo_t | destModulo, | ||
edma_transfer_size_t | srcTransferSize, | ||
edma_transfer_size_t | destTransferSize | ||
) |
Configures the transfer attribute for the eDMA channel.
base | Register base address for eDMA module. |
channel | eDMA channel number. |
srcModulo | enumeration type for an allowed source modulo. The value defines a specific address range specified as the value after the SADDR + SOFF calculation is performed on the original register value. Setting this field provides the ability to implement a circular data. For data queues requiring power-of-2 size bytes, the queue should start at a 0-modulo-size address and the SMOD field should be set to the appropriate value for the queue, freezing the desired number of upper address bits. The value programmed into this field specifies the number of the lower address bits allowed to change. For a circular queue application, the SOFF is typically set to the transfer size to implement post-increment addressing with SMOD function restricting the addresses to a 0-modulo-size range. |
destModulo | Enum type for an allowed destination modulo. |
srcTransferSize | Enum type for source transfer size. |
destTransferSize | Enum type for destination transfer size. |
Definition at line 194 of file edma_hal.c.
|
inlinestatic |
Configures the bandwidth for the TCD.
Throttles the amount of bus bandwidth consumed by the eDMA. In general, as the eDMA processes the minor loop, it continuously generates read/write sequences until the minor count is exhausted. This field forces the eDMA to stall after the completion of each read/write access to control the bus request bandwidth seen by the crossbar switch.
base | Register base address for eDMA module. |
channel | eDMA channel number. |
bandwidth | enum type for bandwidth control Implements : EDMA_HAL_TCDSetBandwidth_Activity |
Definition at line 1044 of file edma_hal.h.
|
inlinestatic |
Configures the major channel link the TCD.
If the major link is enabled, after the major loop counter is exhausted, the eDMA engine initiates a channel service request at the channel defined by these six bits by setting that channel start bits.
base | Register base address for eDMA module. |
channel | eDMA channel number. |
majorLinkChannel | channel number for major link |
enable | Enables (true) or Disables (false) channel major link. Implements : EDMA_HAL_TCDSetChannelMajorLink_Activity |
Definition at line 1069 of file edma_hal.h.
void EDMA_HAL_TCDSetChannelMinorLink | ( | DMA_Type * | base, |
uint32_t | channel, | ||
uint32_t | linkChannel, | ||
bool | enable | ||
) |
Sets the channel minor link for the TCD.
base | Register base address for eDMA module. |
channel | eDMA channel number. |
linkChannel | Channel to be linked on minor loop complete. |
enable | Enable (true)/Disable (false) channel minor link. |
Definition at line 347 of file edma_hal.c.
|
inlinestatic |
Configures the destination address for the TCD.
base | Register base address for eDMA module. |
channel | eDMA channel number. |
address | The pointer to the destination address. Implements : EDMA_HAL_TCDSetDestAddr_Activity |
Definition at line 968 of file edma_hal.h.
|
inlinestatic |
Configures the last source address adjustment.
This function adds an adjustment value added to the source address at the completion of the major iteration count. This value can be applied to restore the source address to the initial value, or adjust the address to reference the next data structure.
base | Register base address for eDMA module. |
channel | eDMA channel number. |
adjust | adjustment value Implements : EDMA_HAL_TCDSetDestLastAdjust_Activity |
Definition at line 1007 of file edma_hal.h.
|
inlinestatic |
Enables/disables the destination minor loop offset feature for the TCD.
Configures whether the minor loop offset is applied to the destination address upon minor loop completion. NOTE: EMLM bit needs to be enabled prior to calling this function, otherwise it has no effect.
base | Register base address for eDMA module. |
channel | eDMA channel number. |
enable | Enables (true) or disables (false) destination minor loop offset. Implements : EDMA_HAL_TCDSetDestMinorLoopOffsetCmd_Activity |
Definition at line 910 of file edma_hal.h.
|
inlinestatic |
Configures the destination address signed offset for the TCD.
Sign-extended offset applied to the current source address to form the next-state value as each destination write is complete.
base | Register base address for eDMA module. |
channel | eDMA channel number. |
offset | signed-offset Implements : EDMA_HAL_TCDSetDestOffset_Activity |
Definition at line 987 of file edma_hal.h.
|
inlinestatic |
Disables/Enables the DMA request after the major loop completes for the TCD.
If disabled, the eDMA hardware automatically clears the corresponding DMA request when the current major iteration count reaches zero.
base | Register base address for eDMA module. |
channel | eDMA channel number. |
disable | Disable (true)/Enable (false) DMA request after TCD complete. Implements : EDMA_HAL_TCDSetDisableDmaRequestAfterTCDDoneCmd_Activity |
Definition at line 1117 of file edma_hal.h.
|
inlinestatic |
Enables/Disables the half complete interrupt for the TCD.
If set, the channel generates an interrupt request by setting the appropriate bit in the interrupt register when the current major iteration count reaches the halfway point. Specifically, the comparison performed by the eDMA engine is (CITER == (BITER >> 1)). This half-way point interrupt request is provided to support the double-buffered schemes or other types of data movement where the processor needs an early indication of the transfer's process.
base | Register base address for eDMA module. |
channel | eDMA channel number. |
enable | Enable (true) /Disable (false) half complete interrupt. Implements : EDMA_HAL_TCDSetHalfCompleteIntCmd_Activity |
Definition at line 1143 of file edma_hal.h.
|
inlinestatic |
Enables/Disables the interrupt after the major loop completes for the TCD.
If enabled, the channel generates an interrupt request by setting the appropriate bit in the interrupt register when the current major iteration count reaches zero.
base | Register base address for eDMA module. |
channel | eDMA channel number. |
enable | Enable (true) /Disable (false) interrupt after TCD done. Implements : EDMA_HAL_TCDSetIntCmd_Activity |
Definition at line 1166 of file edma_hal.h.
void EDMA_HAL_TCDSetMajorCount | ( | DMA_Type * | base, |
uint32_t | channel, | ||
uint32_t | count | ||
) |
Sets the major iteration count according to minor loop channel link setting.
Note here that user need to first set the minor loop channel link and then call this function. The execute flow inside this function is dependent on the minor loop channel link setting.
base | Register base address for eDMA module. |
channel | eDMA channel number. |
count | major loop count |
Definition at line 388 of file edma_hal.c.
void EDMA_HAL_TCDSetMinorLoopOffset | ( | DMA_Type * | base, |
uint32_t | channel, | ||
int32_t | offset | ||
) |
Configures the minor loop offset for the TCD.
Configures the offset value. If neither source nor destination offset is enabled, offset is not configured. NOTE: EMLM bit needs to be enabled prior to calling this function, otherwise it has no effect.
base | Register base address for eDMA module. |
channel | eDMA channel number. |
offset | Minor loop offset |
Definition at line 297 of file edma_hal.c.
void EDMA_HAL_TCDSetNbytes | ( | DMA_Type * | base, |
uint32_t | channel, | ||
uint32_t | nbytes | ||
) |
Configures the nbytes for the eDMA channel.
Note here that user need firstly configure the minor loop mapping feature and then call this function.
base | Register base address for eDMA module. |
channel | eDMA channel number. |
nbytes | Number of bytes to be transferred in each service request of the channel |
Definition at line 215 of file edma_hal.c.
|
inlinestatic |
Enables/Disables the scatter/gather feature for the TCD.
base | Register base address for eDMA module. |
channel | eDMA channel number. |
enable | Enables (true) /Disables (false) scatter/gather feature. Implements : EDMA_HAL_TCDSetScatterGatherCmd_Activity |
Definition at line 1094 of file edma_hal.h.
void EDMA_HAL_TCDSetScatterGatherLink | ( | DMA_Type * | base, |
uint32_t | channel, | ||
uint32_t | nextTCDAddr | ||
) |
Configures the memory address for the next transfer TCD for the TCD.
This function enables the scatter/gather feature for the TCD and configures the next TCD's address. This address points to the beginning of a 0-modulo-32 byte region containing the next transfer TCD to be loaded into this channel. The channel reload is performed as the major iteration count completes. The scatter/gather address must be 0-modulo-32-byte. Otherwise, a configuration error is reported.
base | Register base address for eDMA module. |
channel | eDMA channel number. |
nextTCDAddr | The address of the next TCD to be linked to this TCD. |
Definition at line 332 of file edma_hal.c.
|
inlinestatic |
Configures the source address for the hardware TCD.
base | Register base address for eDMA module. |
channel | eDMA channel number. |
address | The pointer to the source memory address. Implements : EDMA_HAL_TCDSetSrcAddr_Activity |
Definition at line 794 of file edma_hal.h.
|
inlinestatic |
Configures the last source address adjustment for the TCD.
Adjustment value added to the source address at the completion of the major iteration count. This value can be applied to restore the source address to the initial value, or adjust the address to reference the next data structure.
base | Register base address for eDMA module. |
channel | eDMA channel number. |
size | adjustment value Implements : EDMA_HAL_TCDSetSrcLastAdjust_Activity |
Definition at line 952 of file edma_hal.h.
|
inlinestatic |
Enables/disables the source minor loop offset feature for the TCD.
Configures whether the minor loop offset is applied to the source address upon minor loop completion. NOTE: EMLM bit needs to be enabled prior to calling this function, otherwise it has no effect.
base | Register base address for eDMA module. |
channel | eDMA channel number. |
enable | Enables (true) or disables (false) source minor loop offset. Implements : EDMA_HAL_TCDSetSrcMinorLoopOffsetCmd_Activity |
Definition at line 881 of file edma_hal.h.
|
inlinestatic |
Configures the source address signed offset for the hardware TCD.
Sign-extended offset applied to the current source address to form the next-state value as each source read is complete.
base | Register base address for eDMA module. |
channel | eDMA channel number. |
offset | signed-offset for source address. Implements : EDMA_HAL_TCDSetSrcOffset_Activity |
Definition at line 813 of file edma_hal.h.
|
inlinestatic |
Triggers the start bits for the TCD.
The eDMA hardware automatically clears this flag after the channel begins execution.
base | Register base address for eDMA module. |
channel | eDMA channel number. Implements : EDMA_HAL_TCDTriggerChannelStart_Activity |
Definition at line 1187 of file edma_hal.h.
|
inlinestatic |
Triggers the eDMA channel.
base | Register base address for eDMA module. |
channel | Channel indicator. If kEDMAAllChannel is selected, all channels are tirggere. Implements : EDMA_HAL_TriggerChannelStart_Activity |
Definition at line 703 of file edma_hal.h.