Kinetis SDK v.1.3 API Reference Manual
Rev. 0
Freescale Semiconductor, Inc.
|
This section describes the programming interface of the eDMA HAL driver.
Data Structures | |
struct | edma_transfer_config_t |
eDMA transfer size configuration. More... | |
struct | edma_minorloop_offset_config_t |
eDMA TCD minor loop mapping configuration More... | |
struct | edma_error_status_all_t |
Error status of the eDMA module. More... | |
struct | edma_software_tcd_t |
eDMA TCD More... | |
Enumerations | |
enum | edma_status_t { , kStatus_EDMA_InvalidArgument = 1U, kStatus_EDMA_Fail = 2U } |
Error code for the eDMA Driver. More... | |
enum | edma_channel_arbitration_t { kEDMAChnArbitrationFixedPriority = 0U, kEDMAChnArbitrationRoundrobin } |
eDMA channel arbitration algorithm used to select among channels. More... | |
enum | edma_channel_priority_t |
eDMA channel priority setting | |
enum | edma_modulo_t |
eDMA modulo configuration | |
enum | edma_transfer_size_t |
eDMA transfer configuration | |
enum | edma_channel_indicator_t { kEDMAChannel0 = 0U } |
eDMA channel configuration. More... | |
enum | edma_bandwidth_config_t { kEDMABandwidthStallNone = 0U, kEDMABandwidthStall4Cycle = 2U, kEDMABandwidthStall8Cycle = 3U } |
Bandwidth control configuration. More... | |
eDMA HAL driver module level operation | |
void | EDMA_HAL_Init (DMA_Type *base) |
Initializes the eDMA module to a known state. More... | |
void | EDMA_HAL_CancelTransfer (DMA_Type *base) |
Cancels the remaining data transfer. More... | |
void | EDMA_HAL_ErrorCancelTransfer (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/resumes 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 driver channel priority and arbitration configuration. | |
static void | EDMA_HAL_SetChannelPreemptMode (DMA_Type *base, uint32_t channel, bool preempt, bool preemption) |
Sets the preempt and 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_channel_arbitration_t channelArbitration) |
Sets 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... | |
edma_error_status_all_t | EDMA_HAL_GetErrorStatus (DMA_Type *base) |
Gets the error status of the eDMA module. More... | |
void | EDMA_HAL_SetErrorIntCmd (DMA_Type *base, bool enable, edma_channel_indicator_t channel) |
Enables/Disables the error interrupt for channels. More... | |
static uint32_t | EDMA_HAL_GetErrorIntStatusFlag (DMA_Type *base) |
Gets the eDMA error interrupt status. More... | |
static void | EDMA_HAL_ClearErrorIntStatusFlag (DMA_Type *base, edma_channel_indicator_t channel) |
Clears the error interrupt status for the eDMA channel or channels. More... | |
void | EDMA_HAL_SetDmaRequestCmd (DMA_Type *base, edma_channel_indicator_t channel, bool enable) |
Enables/disables the DMA request for the channel or all channels. More... | |
static bool | EDMA_HAL_GetDmaRequestStatusFlag (DMA_Type *base, uint32_t channel) |
Gets the eDMA channel DMA request status. More... | |
static void | EDMA_HAL_ClearDoneStatusFlag (DMA_Type *base, edma_channel_indicator_t channel) |
Clears the done status for a channel or all channels. More... | |
static void | EDMA_HAL_TriggerChannelStart (DMA_Type *base, edma_channel_indicator_t channel) |
Triggers the eDMA channel. More... | |
static bool | EDMA_HAL_GetIntStatusFlag (DMA_Type *base, uint32_t channel) |
Gets the eDMA channel interrupt request status. More... | |
static void | EDMA_HAL_ClearIntStatusFlag (DMA_Type *base, edma_channel_indicator_t channel) |
Clears the interrupt status for the eDMA channel or all channels. More... | |
eDMA HAL driver hardware TCD configuration functions. | |
void | EDMA_HAL_HTCDClearReg (DMA_Type *base, uint32_t channel) |
Clears all registers to 0 for the hardware TCD. More... | |
static void | EDMA_HAL_HTCDSetSrcAddr (DMA_Type *base, uint32_t channel, uint32_t address) |
Configures the source address for the hardware TCD. More... | |
static void | EDMA_HAL_HTCDSetSrcOffset (DMA_Type *base, uint32_t channel, int16_t offset) |
Configures the source address signed offset for the hardware TCD. More... | |
void | EDMA_HAL_HTCDSetAttribute (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_HTCDSetNbytes (DMA_Type *base, uint32_t channel, uint32_t nbytes) |
Configures the nbytes for the eDMA channel. More... | |
uint32_t | EDMA_HAL_HTCDGetNbytes (DMA_Type *base, uint32_t channel) |
Gets the nbytes configuration data for the hardware TCD. More... | |
void | EDMA_HAL_HTCDSetMinorLoopOffset (DMA_Type *base, uint32_t channel, edma_minorloop_offset_config_t *config) |
Configures the minor loop offset for the hardware TCD. More... | |
static void | EDMA_HAL_HTCDSetSrcLastAdjust (DMA_Type *base, uint32_t channel, int32_t size) |
Configures the last source address adjustment for the hardware TCD. More... | |
static void | EDMA_HAL_HTCDSetDestAddr (DMA_Type *base, uint32_t channel, uint32_t address) |
Configures the destination address for the hardware TCD. More... | |
static void | EDMA_HAL_HTCDSetDestOffset (DMA_Type *base, uint32_t channel, int16_t offset) |
Configures the destination address signed offset for the hardware TCD. More... | |
static void | EDMA_HAL_HTCDSetDestLastAdjust (DMA_Type *base, uint32_t channel, uint32_t adjust) |
Configures the last source address adjustment. More... | |
void | EDMA_HAL_HTCDSetScatterGatherLink (DMA_Type *base, uint32_t channel, edma_software_tcd_t *stcd) |
Configures the memory address for the next transfer TCD for the hardware TCD. More... | |
static void | EDMA_HAL_HTCDSetBandwidth (DMA_Type *base, uint32_t channel, edma_bandwidth_config_t bandwidth) |
Configures the bandwidth for the hardware TCD. More... | |
static void | EDMA_HAL_HTCDSetChannelMajorLink (DMA_Type *base, uint32_t channel, uint32_t majorChannel, bool enable) |
Configures the major channel link the hardware TCD. More... | |
static void | EDMA_HAL_HTCDSetScatterGatherCmd (DMA_Type *base, uint32_t channel, bool enable) |
Enables/disables the scatter/gather feature for the hardware TCD. More... | |
static void | EDMA_HAL_HTCDSetDisableDmaRequestAfterTCDDoneCmd (DMA_Type *base, uint32_t channel, bool disable) |
Disables/enables the DMA request after the major loop completes for the hardware TCD. More... | |
static void | EDMA_HAL_HTCDSetHalfCompleteIntCmd (DMA_Type *base, uint32_t channel, bool enable) |
Enables/disables the half complete interrupt for the hardware TCD. More... | |
static void | EDMA_HAL_HTCDSetIntCmd (DMA_Type *base, uint32_t channel, bool enable) |
Enables/disables the interrupt after the major loop completes for the hardware TCD. More... | |
static void | EDMA_HAL_HTCDTriggerChannelStart (DMA_Type *base, uint32_t channel) |
Triggers the start bits for the hardware TCD. More... | |
static bool | EDMA_HAL_HTCDGetChannelActiveStatus (DMA_Type *base, uint32_t channel) |
Checks whether the channel is running for the hardware TCD. More... | |
void | EDMA_HAL_HTCDSetChannelMinorLink (DMA_Type *base, uint32_t channel, uint32_t linkChannel, bool enable) |
Sets the channel minor link for the hardware TCD. More... | |
void | EDMA_HAL_HTCDSetMajorCount (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_HTCDGetFinishedBytes (DMA_Type *base, uint32_t channel) |
Gets the number of bytes already transferred for the hardware TCD. More... | |
uint32_t | EDMA_HAL_HTCDGetUnfinishedBytes (DMA_Type *base, uint32_t channel) |
Gets the number of bytes haven't transferred for the hardware TCD. More... | |
static bool | EDMA_HAL_HTCDGetDoneStatusFlag (DMA_Type *base, uint32_t channel) |
Gets the channel done status. More... | |
uint32_t | EDMA_HAL_HTCDGetBeginMajorCount (DMA_Type *base, uint32_t channel) |
Gets the channel Begin major count. More... | |
uint32_t | EDMA_HAL_HTCDGetCurrentMajorCount (DMA_Type *base, uint32_t channel) |
Gets the channel current major count. More... | |
eDMA HAL driver software TCD configuration functions. | |
static void | EDMA_HAL_STCDSetSrcAddr (edma_software_tcd_t *stcd, uint32_t address) |
Configures the source address for the software TCD. More... | |
static void | EDMA_HAL_STCDSetSrcOffset (edma_software_tcd_t *stcd, int16_t offset) |
Configures the source address signed offset for the software TCD. More... | |
void | EDMA_HAL_STCDSetAttribute (edma_software_tcd_t *stcd, edma_modulo_t srcModulo, edma_modulo_t destModulo, edma_transfer_size_t srcTransferSize, edma_transfer_size_t destTransferSize) |
Configures the transfer attribute for software TCD. More... | |
void | EDMA_HAL_STCDSetNbytes (DMA_Type *base, edma_software_tcd_t *stcd, uint32_t nbytes) |
Configures the nbytes for software TCD. More... | |
void | EDMA_HAL_STCDSetMinorLoopOffset (DMA_Type *base, edma_software_tcd_t *stcd, edma_minorloop_offset_config_t *config) |
Configures the minor loop offset for the software TCD. More... | |
static void | EDMA_HAL_STCDSetSrcLastAdjust (edma_software_tcd_t *stcd, int32_t size) |
Configures the last source address adjustment for the software TCD. More... | |
static void | EDMA_HAL_STCDSetDestAddr (edma_software_tcd_t *stcd, uint32_t address) |
Configures the destination address for the software TCD. More... | |
static void | EDMA_HAL_STCDSetDestOffset (edma_software_tcd_t *stcd, int16_t offset) |
Configures the destination address signed offset for the software TCD. More... | |
static void | EDMA_HAL_STCDSetDestLastAdjust (edma_software_tcd_t *stcd, uint32_t adjust) |
Configures the last source address adjustment. More... | |
void | EDMA_HAL_STCDSetScatterGatherLink (edma_software_tcd_t *stcd, edma_software_tcd_t *nextStcd) |
Configures the memory address for the next transfer TCD for the software TCD. More... | |
static void | EDMA_HAL_STCDSetBandwidth (edma_software_tcd_t *stcd, edma_bandwidth_config_t bandwidth) |
Configures the bandwidth for the software TCD. More... | |
static void | EDMA_HAL_STCDSetChannelMajorLink (edma_software_tcd_t *stcd, uint32_t majorChannel, bool enable) |
Configures the major channel link the software TCD. More... | |
static void | EDMA_HAL_STCDSetScatterGatherCmd (edma_software_tcd_t *stcd, bool enable) |
Enables/disables the scatter/gather feature for the software TCD. More... | |
static void | EDMA_HAL_STCDSetDisableDmaRequestAfterTCDDoneCmd (edma_software_tcd_t *stcd, bool disable) |
Disables/enables the DMA request after the major loop completes for the software TCD. More... | |
static void | EDMA_HAL_STCDSetHalfCompleteIntCmd (edma_software_tcd_t *stcd, bool enable) |
Enables/disables the half complete interrupt for the software TCD. More... | |
static void | EDMA_HAL_STCDSetIntCmd (edma_software_tcd_t *stcd, bool enable) |
Enables/disables the interrupt after the major loop completes for the software TCD. More... | |
static void | EDMA_HAL_STCDTriggerChannelStart (edma_software_tcd_t *stcd) |
Triggers the start bits for the software TCD. More... | |
void | EDMA_HAL_STCDSetChannelMinorLink (edma_software_tcd_t *stcd, uint32_t linkChannel, bool enable) |
Sets the channel minor link for the software TCD. More... | |
void | EDMA_HAL_STCDSetMajorCount (edma_software_tcd_t *stcd, uint32_t count) |
Sets the major iteration count according to the minor loop channel link setting. More... | |
void | EDMA_HAL_PushSTCDToHTCD (DMA_Type *base, uint32_t channel, edma_software_tcd_t *stcd) |
Copies the software TCD configuration to the hardware TCD. More... | |
edma_status_t | EDMA_HAL_STCDSetBasicTransfer (DMA_Type *base, edma_software_tcd_t *stcd, edma_transfer_config_t *config, bool enableInt, bool disableDmaRequest) |
Sets the basic transfer for the software TCD. More... | |
struct edma_transfer_config_t |
This structure configures the basic source/destination transfer attribute. This figure shows the eDMA's transfer model:
_________________________________________________
| Transfer Size | |
Minor Loop |_______________| Major loop Count 1 |
Count | Transfer Size | |
____________|_______________|____________________|–> Minor loop complete
____________________________________
| | |
|_______________| Major Loop Count 2 |
| | |
|_______________|____________________|–> Minor loop Complete
------------------------------------------------------—> Major loop complete
Data Fields | |
uint32_t | srcAddr |
Memory address pointing to the source data. More... | |
uint32_t | destAddr |
Memory address pointing to the destination data. More... | |
edma_transfer_size_t | srcTransferSize |
Source data transfer size. More... | |
edma_transfer_size_t | destTransferSize |
Destination data transfer size. More... | |
int16_t | srcOffset |
Sign-extended offset applied to the current source address to form the next-state value as each source read/write is completed. More... | |
uint32_t | srcLastAddrAdjust |
Last source address adjustment. More... | |
uint32_t | destLastAddrAdjust |
Last destination address adjustment. More... | |
edma_modulo_t | srcModulo |
Source address modulo. More... | |
edma_modulo_t | destModulo |
Destination address modulo. More... | |
uint32_t | minorLoopCount |
Minor bytes transfer count. More... | |
uint16_t | majorLoopCount |
Major iteration count. More... | |
uint32_t edma_transfer_config_t::srcAddr |
uint32_t edma_transfer_config_t::destAddr |
edma_transfer_size_t edma_transfer_config_t::srcTransferSize |
edma_transfer_size_t edma_transfer_config_t::destTransferSize |
int16_t edma_transfer_config_t::srcOffset |
uint32_t edma_transfer_config_t::srcLastAddrAdjust |
uint32_t edma_transfer_config_t::destLastAddrAdjust |
Note here it is only valid when scatter/gather feature is not enabled.
edma_modulo_t edma_transfer_config_t::srcModulo |
edma_modulo_t edma_transfer_config_t::destModulo |
uint32_t edma_transfer_config_t::minorLoopCount |
Number of bytes to be transferred in each service request of the channel.
uint16_t edma_transfer_config_t::majorLoopCount |
struct edma_minorloop_offset_config_t |
Data Fields | |
bool | enableSrcMinorloop |
Enable(true) or Disable(false) source minor loop offset. More... | |
bool | enableDestMinorloop |
Enable(true) or Disable(false) destination minor loop offset. More... | |
uint32_t | offset |
Offset for minor loop mapping. More... | |
bool edma_minorloop_offset_config_t::enableSrcMinorloop |
bool edma_minorloop_offset_config_t::enableDestMinorloop |
uint32_t edma_minorloop_offset_config_t::offset |
struct edma_error_status_all_t |
Data Fields | |
uint8_t | errorChannel |
Error channel number of the cancelled channel number. | |
bool | destinationBusError |
Bus error on destination address. | |
bool | sourceBusError |
Bus error on the SRC address. | |
bool | scatterOrGatherConfigurationError |
Error on the Scatter/Gather address. | |
bool | nbyteOrCiterConfigurationError |
NBYTES/CITER configuration error. | |
bool | destinationOffsetError |
Destination offset error. | |
bool | destinationAddressError |
Destination address error. | |
bool | sourceOffsetError |
Source offset error. | |
bool | sourceAddressError |
Source address error. | |
bool | channelPriorityError |
Channel priority error. | |
bool | transferCancelledError |
Transfer cancelled. | |
bool | orOfAllError |
Logical OR all ERR status bits. | |
struct edma_software_tcd_t |
enum edma_status_t |
void EDMA_HAL_Init | ( | DMA_Type * | base | ) |
base | Register base address for the eDMA module. |
void EDMA_HAL_CancelTransfer | ( | DMA_Type * | base | ) |
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 cancellation is complete. The cancellation retires the channel normally as if the minor loop had completed.
base | Register base address for eDMA module. |
void EDMA_HAL_ErrorCancelTransfer | ( | DMA_Type * | base | ) |
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 cancellation is complete. The cancellation retires the channel normally as if the minor loop had completed and the operation is treated as an error condition.
base | Register base address for eDMA module. |
|
inlinestatic |
This function stalls/continues the start of any new channel. Executing channels are allowed to be completed.
base | Register base address for eDMA module. |
halt | Halts (true) or resumes (false) eDMA transfer. |
|
inlinestatic |
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. |
|
inlinestatic |
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. |
|
inlinestatic |
This function sets the preempt and preemption features.
base | Register base address for eDMA module. |
channel | eDMA channel number. |
preempt | eDMA channel can't suspend a lower priority channel (true). eDMA channel can suspend a lower priority channel (false). |
preemption | 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). |
|
inlinestatic |
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. |
|
inlinestatic |
base | Register base address for eDMA module. |
channelArbitration | Round-Robin way for fixed priority way. |
|
inlinestatic |
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. |
|
inlinestatic |
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. |
edma_error_status_all_t EDMA_HAL_GetErrorStatus | ( | DMA_Type * | base | ) |
base | Register base address for eDMA module. |
void EDMA_HAL_SetErrorIntCmd | ( | DMA_Type * | base, |
bool | enable, | ||
edma_channel_indicator_t | channel | ||
) |
base | Register base address for eDMA module. |
enable | Enable(true) or Disable (false) error interrupt. |
channel | Channel indicator. If kEDMAAllChannel is selected, all channels' error interrupt will be enabled/disabled. |
|
inlinestatic |
base | Register base address for eDMA module. |
|
inlinestatic |
base | Register base address for eDMA module. |
channel | Channel indicator. If kEDMAAllChannel is selected, all channels' error interrupt status will be cleared. |
void EDMA_HAL_SetDmaRequestCmd | ( | DMA_Type * | base, |
edma_channel_indicator_t | channel, | ||
bool | enable | ||
) |
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. |
|
inlinestatic |
base | Register base address for eDMA module. |
channel | eDMA channel number. |
|
inlinestatic |
base | Register base address for eDMA module. |
channel | Channel indicator. If kEDMAAllChannel is selected, all channels' done status will be cleared. |
|
inlinestatic |
base | Register base address for eDMA module. |
channel | Channel indicator. If kEDMAAllChannel is selected, all channels are tirggere. |
|
inlinestatic |
base | Register base address for eDMA module. |
channel | eDMA channel number. |
|
inlinestatic |
base | Register base address for eDMA module. |
channel | Channel indicator. If kEDMAAllChannel is selected, all channels' interrupt status will be cleared. |
void EDMA_HAL_HTCDClearReg | ( | DMA_Type * | base, |
uint32_t | channel | ||
) |
base | Register base address for eDMA module. |
channel | eDMA channel number. |
|
inlinestatic |
base | Register base address for eDMA module. |
channel | eDMA channel number. |
address | The pointer to the source memory address. |
|
inlinestatic |
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. |
void EDMA_HAL_HTCDSetAttribute | ( | DMA_Type * | base, |
uint32_t | channel, | ||
edma_modulo_t | srcModulo, | ||
edma_modulo_t | destModulo, | ||
edma_transfer_size_t | srcTransferSize, | ||
edma_transfer_size_t | destTransferSize | ||
) |
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. |
void EDMA_HAL_HTCDSetNbytes | ( | DMA_Type * | base, |
uint32_t | channel, | ||
uint32_t | nbytes | ||
) |
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 |
uint32_t EDMA_HAL_HTCDGetNbytes | ( | DMA_Type * | base, |
uint32_t | channel | ||
) |
This function decides whether the minor loop mapping is enabled or whether the source/destination minor loop mapping is enabled. Then, the nbytes are returned accordingly.
base | Register base address for eDMA module. |
channel | eDMA channel number. |
void EDMA_HAL_HTCDSetMinorLoopOffset | ( | DMA_Type * | base, |
uint32_t | channel, | ||
edma_minorloop_offset_config_t * | config | ||
) |
Configures both the enable bits and the offset value. If neither source nor destination offset is enabled, the offset is not configured. Note here if source or destination offset is required, the eDMA module EMLM bit is set in this function.
base | Register base address for eDMA module. |
channel | eDMA channel number. |
config | Configuration data structure for the minor loop offset |
|
inlinestatic |
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 |
|
inlinestatic |
base | Register base address for eDMA module. |
channel | eDMA channel number. |
address | The pointer to the destination address. |
|
inlinestatic |
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 |
|
inlinestatic |
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 |
void EDMA_HAL_HTCDSetScatterGatherLink | ( | DMA_Type * | base, |
uint32_t | channel, | ||
edma_software_tcd_t * | stcd | ||
) |
This function enables the scatter/gather feature for the hardware 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. |
stcd | The pointer to the TCD to be linked to this hardware TCD. |
|
inlinestatic |
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 |
|
inlinestatic |
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. |
majorChannel | channel number for major link |
enable | Enables (true) or Disables (false) channel major link. |
|
inlinestatic |
base | Register base address for eDMA module. |
channel | eDMA channel number. |
enable | Enables (true) /Disables (false) scatter/gather feature. |
|
inlinestatic |
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 (true) DMA request after TCD complete. |
|
inlinestatic |
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. |
|
inlinestatic |
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. |
|
inlinestatic |
The eDMA hardware automatically clears this flag after the channel begins execution.
base | Register base address for eDMA module. |
channel | eDMA channel number. |
|
inlinestatic |
base | Register base address for eDMA module. |
channel | eDMA channel number. |
void EDMA_HAL_HTCDSetChannelMinorLink | ( | DMA_Type * | base, |
uint32_t | channel, | ||
uint32_t | linkChannel, | ||
bool | enable | ||
) |
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. |
void EDMA_HAL_HTCDSetMajorCount | ( | DMA_Type * | base, |
uint32_t | channel, | ||
uint32_t | count | ||
) |
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 |
uint32_t EDMA_HAL_HTCDGetFinishedBytes | ( | DMA_Type * | base, |
uint32_t | channel | ||
) |
base | Register base address for eDMA module. |
channel | eDMA channel number. |
uint32_t EDMA_HAL_HTCDGetUnfinishedBytes | ( | DMA_Type * | base, |
uint32_t | channel | ||
) |
base | Register base address for eDMA module. |
channel | eDMA channel number. |
|
inlinestatic |
base | Register base address for eDMA module. |
channel | eDMA channel number. |
uint32_t EDMA_HAL_HTCDGetBeginMajorCount | ( | DMA_Type * | base, |
uint32_t | channel | ||
) |
base | Register base address for eDMA module. |
channel | eDMA channel number. |
uint32_t EDMA_HAL_HTCDGetCurrentMajorCount | ( | DMA_Type * | base, |
uint32_t | channel | ||
) |
base | Register base address for eDMA module. |
channel | eDMA channel number. |
|
inlinestatic |
stcd | The pointer to the software TCD. |
address | The source memory address. |
|
inlinestatic |
Sign-extended offset applied to the current source address to form the next-state value as each source read is complete.
stcd | The pointer to the software TCD. |
offset | signed-offset for source address. |
void EDMA_HAL_STCDSetAttribute | ( | edma_software_tcd_t * | stcd, |
edma_modulo_t | srcModulo, | ||
edma_modulo_t | destModulo, | ||
edma_transfer_size_t | srcTransferSize, | ||
edma_transfer_size_t | destTransferSize | ||
) |
stcd | The pointer to the software TCD. |
srcModulo | enum 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 destinatio transfer size. |
void EDMA_HAL_STCDSetNbytes | ( | DMA_Type * | base, |
edma_software_tcd_t * | stcd, | ||
uint32_t | nbytes | ||
) |
Note here that user need firstly configure the minor loop mapping feature and then call this function.
base | Register base address for eDMA module. |
stcd | The pointer to the software TCD. |
nbytes | Number of bytes to be transferred in each service request of the channel |
void EDMA_HAL_STCDSetMinorLoopOffset | ( | DMA_Type * | base, |
edma_software_tcd_t * | stcd, | ||
edma_minorloop_offset_config_t * | config | ||
) |
Configures both the enable bits and the offset value. If neither source nor destination offset is enabled, the offset is not configured. Note, if either the source or the destination offset is required, the eDMA module EMLM bit is set in this function.
base | Register base address for eDMA module. |
stcd | The pointer to the software TCD. |
config | Configuration data structure for the minor loop offset |
|
inlinestatic |
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.
stcd | The pointer to the software TCD. |
size | adjustment value |
|
inlinestatic |
stcd | The pointer to the software TCD. |
address | The pointer to the destination address. |
|
inlinestatic |
Sign-extended offset applied to the current source address to form the next-state value as the each destination write is complete.
stcd | The pointer to the software TCD. |
offset | signed-offset |
|
inlinestatic |
This function add 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.
stcd | The pointer to the software TCD. |
adjust | adjustment value |
void EDMA_HAL_STCDSetScatterGatherLink | ( | edma_software_tcd_t * | stcd, |
edma_software_tcd_t * | nextStcd | ||
) |
This function enable the scatter/gather feature for the software TCD and configure 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.
stcd | The pointer to the software TCD. |
nextStcd | The pointer to the TCD to be linked to this software TCD. |
|
inlinestatic |
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.
stcd | The pointer to the software TCD. |
bandwidth | enum type for bandwidth control |
|
inlinestatic |
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.
stcd | The pointer to the software TCD. |
majorChannel | channel number for major link |
enable | Enables (true) or Disables (false) channel major link. |
|
inlinestatic |
stcd | The pointer to the software TCD. |
enable | Enables (true) /Disables (false) scatter/gather feature. |
|
inlinestatic |
If disabled, the eDMA hardware automatically clears the corresponding DMA request when the current major iteration count reaches zero.
stcd | The pointer to the software TCD. |
disable | Disable (true)/Enable (true) DMA request after TCD complete. |
|
inlinestatic |
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.
stcd | The pointer to the software TCD. |
enable | Enable (true) /Disable (false) half complete interrupt. |
|
inlinestatic |
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.
stcd | The pointer to the software TCD. |
enable | Enable (true) /Disable (false) interrupt after TCD done. |
|
inlinestatic |
The eDMA hardware automatically clears this flag after the channel begins execution.
stcd | The pointer to the software TCD. |
void EDMA_HAL_STCDSetChannelMinorLink | ( | edma_software_tcd_t * | stcd, |
uint32_t | linkChannel, | ||
bool | enable | ||
) |
stcd | The pointer to the software TCD. |
linkChannel | Channel to be linked on minor loop complete. |
enable | Enable (true)/Disable (false) channel minor link. |
void EDMA_HAL_STCDSetMajorCount | ( | edma_software_tcd_t * | stcd, |
uint32_t | count | ||
) |
The user needs to set the minor loop channel link first and then call this function. The execution flow inside this function is dependent on the minor loop channel link setting.
stcd | The pointer to the software TCD. |
count | major loop count |
void EDMA_HAL_PushSTCDToHTCD | ( | DMA_Type * | base, |
uint32_t | channel, | ||
edma_software_tcd_t * | stcd | ||
) |
base | Register base address for eDMA module. |
channel | eDMA channel number. |
stcd | The pointer to the software TCD. |
edma_status_t EDMA_HAL_STCDSetBasicTransfer | ( | DMA_Type * | base, |
edma_software_tcd_t * | stcd, | ||
edma_transfer_config_t * | config, | ||
bool | enableInt, | ||
bool | disableDmaRequest | ||
) |
This function is used to set up the basic transfer for software TCD. The minor loop setting is not involved here because the minor loop's configuration has an impact on the global eDMA setting and the source minor loop offset is relevant to the destination minor loop offset. For these reasons, the minor loop offset configuration is treated as an advanced configuration. The user can call the EDMA_HAL_STCDSetMinorLoopOffset() to configure the minor loop offset feature.
base | Register base address for eDMA module. |
stcd | The pointer to the software TCD. |
config | The pointer to the transfer configuration structure. |
enableInt | Enables (true) or Disables (false) interrupt on TCD complete. |
disableDmaRequest | Disables (true) or Enable (false) DMA request on TCD complete. |