Kinetis SDK v.1.3 API Reference Manual  Rev. 0
Freescale Semiconductor, Inc.
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages

Overview

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

Data Structure Documentation

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

Field Documentation

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

Field Documentation

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

Enumeration Type Documentation

Enumerator
kStatus_EDMA_InvalidArgument 

Parameter is invalid.

kStatus_EDMA_Fail 

Failed operation.

Enumerator
kEDMAChnArbitrationFixedPriority 

Fixed Priority arbitration is used to select among channels.

kEDMAChnArbitrationRoundrobin 

Round-Robin arbitration is used to select among channels.

Enumerator
kEDMAChannel0 

Channel 0.

Enumerator
kEDMABandwidthStallNone 

No eDMA engine stalls.

kEDMABandwidthStall4Cycle 

eDMA engine stalls for 4 cycles after each read/write.

kEDMABandwidthStall8Cycle 

eDMA engine stalls for 8 cycles after each read/write.

Function Documentation

void EDMA_HAL_Init ( DMA_Type *  base)
Parameters
baseRegister 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.

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

Parameters
baseRegister base address for eDMA module.
static void EDMA_HAL_SetHaltCmd ( DMA_Type *  base,
bool  halt 
)
inlinestatic

This function stalls/continues the start of any new channel. Executing channels are allowed to be completed.

Parameters
baseRegister base address for eDMA module.
haltHalts (true) or resumes (false) eDMA transfer.
static void EDMA_HAL_SetHaltOnErrorCmd ( DMA_Type *  base,
bool  haltOnError 
)
inlinestatic

An error causes the halt bit to be set. Subsequently, all service requests are ignored until the halt bit is cleared.

Parameters
baseRegister base address for eDMA module.
haltOnErrorHalts (true) or not halt (false) eDMA module when an error occurs.
static void EDMA_HAL_SetDebugCmd ( DMA_Type *  base,
bool  enable 
)
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.

Parameters
baseRegister base address for eDMA module.
enableEnables (true) or Disable (false) eDMA module debug mode.
static void EDMA_HAL_SetChannelPreemptMode ( DMA_Type *  base,
uint32_t  channel,
bool  preempt,
bool  preemption 
)
inlinestatic

This function sets the preempt and preemption features.

Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
preempteDMA channel can't suspend a lower priority channel (true). eDMA channel can suspend a lower priority channel (false).
preemptioneDMA 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).
static void EDMA_HAL_SetChannelPriority ( DMA_Type *  base,
uint32_t  channel,
edma_channel_priority_t  priority 
)
inlinestatic
Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
priorityPriority of the DMA channel. Different channels should have different priority setting inside a group.
static void EDMA_HAL_SetChannelArbitrationMode ( DMA_Type *  base,
edma_channel_arbitration_t  channelArbitration 
)
inlinestatic
Parameters
baseRegister base address for eDMA module.
channelArbitrationRound-Robin way for fixed priority way.
static void EDMA_HAL_SetMinorLoopMappingCmd ( DMA_Type *  base,
bool  enable 
)
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.

Parameters
baseRegister base address for eDMA module.
enableEnables (true) or Disable (false) minor loop mapping.
static void EDMA_HAL_SetContinuousLinkCmd ( DMA_Type *  base,
bool  continuous 
)
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.

Parameters
baseRegister base address for eDMA module.
continuousEnables (true) or Disable (false) continuous transfer mode.
edma_error_status_all_t EDMA_HAL_GetErrorStatus ( DMA_Type *  base)
Parameters
baseRegister base address for eDMA module.
Returns
Detailed information of the error type in the eDMA module.
void EDMA_HAL_SetErrorIntCmd ( DMA_Type *  base,
bool  enable,
edma_channel_indicator_t  channel 
)
Parameters
baseRegister base address for eDMA module.
enableEnable(true) or Disable (false) error interrupt.
channelChannel indicator. If kEDMAAllChannel is selected, all channels' error interrupt will be enabled/disabled.
static uint32_t EDMA_HAL_GetErrorIntStatusFlag ( DMA_Type *  base)
inlinestatic
Parameters
baseRegister base address for eDMA module.
Returns
32 bit variable indicating error channels. If error happens on eDMA channel n, the bit n of this variable is '1'. If not, the bit n of this variable is '0'.
static void EDMA_HAL_ClearErrorIntStatusFlag ( DMA_Type *  base,
edma_channel_indicator_t  channel 
)
inlinestatic
Parameters
baseRegister base address for eDMA module.
channelChannel 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 
)
Parameters
baseRegister base address for eDMA module.
enableEnable(true) or Disable (false) DMA request.
channelChannel indicator. If kEDMAAllChannel is selected, all channels DMA request are enabled/disabled.
static bool EDMA_HAL_GetDmaRequestStatusFlag ( DMA_Type *  base,
uint32_t  channel 
)
inlinestatic
Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
Returns
Hardware request is triggered in this eDMA channel (true) or not be triggered in this channel (false).
static void EDMA_HAL_ClearDoneStatusFlag ( DMA_Type *  base,
edma_channel_indicator_t  channel 
)
inlinestatic
Parameters
baseRegister base address for eDMA module.
channelChannel indicator. If kEDMAAllChannel is selected, all channels' done status will be cleared.
static void EDMA_HAL_TriggerChannelStart ( DMA_Type *  base,
edma_channel_indicator_t  channel 
)
inlinestatic
Parameters
baseRegister base address for eDMA module.
channelChannel indicator. If kEDMAAllChannel is selected, all channels are tirggere.
static bool EDMA_HAL_GetIntStatusFlag ( DMA_Type *  base,
uint32_t  channel 
)
inlinestatic
Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
Returns
Interrupt request happens in this eDMA channel (true) or not happen in this channel (false).
static void EDMA_HAL_ClearIntStatusFlag ( DMA_Type *  base,
edma_channel_indicator_t  channel 
)
inlinestatic
Parameters
baseRegister base address for eDMA module.
channelChannel indicator. If kEDMAAllChannel is selected, all channels' interrupt status will be cleared.
void EDMA_HAL_HTCDClearReg ( DMA_Type *  base,
uint32_t  channel 
)
Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
static void EDMA_HAL_HTCDSetSrcAddr ( DMA_Type *  base,
uint32_t  channel,
uint32_t  address 
)
inlinestatic
Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
addressThe pointer to the source memory address.
static void EDMA_HAL_HTCDSetSrcOffset ( DMA_Type *  base,
uint32_t  channel,
int16_t  offset 
)
inlinestatic

Sign-extended offset applied to the current source address to form the next-state value as each source read is complete.

Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
offsetsigned-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 
)
Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
srcModuloenumeration 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.
destModuloEnum type for an allowed destination modulo.
srcTransferSizeEnum type for source transfer size.
destTransferSizeEnum 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.

Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
nbytesNumber 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.

Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
Returns
nbytes configuration according to minor loop setting.
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.

Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
configConfiguration data structure for the minor loop offset
static void EDMA_HAL_HTCDSetSrcLastAdjust ( DMA_Type *  base,
uint32_t  channel,
int32_t  size 
)
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.

Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
sizeadjustment value
static void EDMA_HAL_HTCDSetDestAddr ( DMA_Type *  base,
uint32_t  channel,
uint32_t  address 
)
inlinestatic
Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
addressThe pointer to the destination address.
static void EDMA_HAL_HTCDSetDestOffset ( DMA_Type *  base,
uint32_t  channel,
int16_t  offset 
)
inlinestatic

Sign-extended offset applied to the current source address to form the next-state value as each destination write is complete.

Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
offsetsigned-offset
static void EDMA_HAL_HTCDSetDestLastAdjust ( DMA_Type *  base,
uint32_t  channel,
uint32_t  adjust 
)
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.

Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
adjustadjustment 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.

Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
stcdThe pointer to the TCD to be linked to this hardware TCD.
static void EDMA_HAL_HTCDSetBandwidth ( DMA_Type *  base,
uint32_t  channel,
edma_bandwidth_config_t  bandwidth 
)
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.

Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
bandwidthenum type for bandwidth control
static void EDMA_HAL_HTCDSetChannelMajorLink ( DMA_Type *  base,
uint32_t  channel,
uint32_t  majorChannel,
bool  enable 
)
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.

Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
majorChannelchannel number for major link
enableEnables (true) or Disables (false) channel major link.
static void EDMA_HAL_HTCDSetScatterGatherCmd ( DMA_Type *  base,
uint32_t  channel,
bool  enable 
)
inlinestatic
Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
enableEnables (true) /Disables (false) scatter/gather feature.
static void EDMA_HAL_HTCDSetDisableDmaRequestAfterTCDDoneCmd ( DMA_Type *  base,
uint32_t  channel,
bool  disable 
)
inlinestatic

If disabled, the eDMA hardware automatically clears the corresponding DMA request when the current major iteration count reaches zero.

Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
disableDisable (true)/Enable (true) DMA request after TCD complete.
static void EDMA_HAL_HTCDSetHalfCompleteIntCmd ( DMA_Type *  base,
uint32_t  channel,
bool  enable 
)
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.

Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
enableEnable (true) /Disable (false) half complete interrupt.
static void EDMA_HAL_HTCDSetIntCmd ( DMA_Type *  base,
uint32_t  channel,
bool  enable 
)
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.

Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
enableEnable (true) /Disable (false) interrupt after TCD done.
static void EDMA_HAL_HTCDTriggerChannelStart ( DMA_Type *  base,
uint32_t  channel 
)
inlinestatic

The eDMA hardware automatically clears this flag after the channel begins execution.

Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
static bool EDMA_HAL_HTCDGetChannelActiveStatus ( DMA_Type *  base,
uint32_t  channel 
)
inlinestatic
Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
Returns
True stands for running. False stands for not.
void EDMA_HAL_HTCDSetChannelMinorLink ( DMA_Type *  base,
uint32_t  channel,
uint32_t  linkChannel,
bool  enable 
)
Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
linkChannelChannel to be linked on minor loop complete.
enableEnable (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.

Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
countmajor loop count
uint32_t EDMA_HAL_HTCDGetFinishedBytes ( DMA_Type *  base,
uint32_t  channel 
)
Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
Returns
data bytes already transferred
uint32_t EDMA_HAL_HTCDGetUnfinishedBytes ( DMA_Type *  base,
uint32_t  channel 
)
Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
Returns
data bytes already transferred
static bool EDMA_HAL_HTCDGetDoneStatusFlag ( DMA_Type *  base,
uint32_t  channel 
)
inlinestatic
Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
Returns
If channel done.
uint32_t EDMA_HAL_HTCDGetBeginMajorCount ( DMA_Type *  base,
uint32_t  channel 
)
Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
Returns
Begin major count of this channel.
uint32_t EDMA_HAL_HTCDGetCurrentMajorCount ( DMA_Type *  base,
uint32_t  channel 
)
Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
Returns
Current major count of this channel.
static void EDMA_HAL_STCDSetSrcAddr ( edma_software_tcd_t stcd,
uint32_t  address 
)
inlinestatic
Parameters
stcdThe pointer to the software TCD.
addressThe source memory address.
static void EDMA_HAL_STCDSetSrcOffset ( edma_software_tcd_t stcd,
int16_t  offset 
)
inlinestatic

Sign-extended offset applied to the current source address to form the next-state value as each source read is complete.

Parameters
stcdThe pointer to the software TCD.
offsetsigned-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 
)
Parameters
stcdThe pointer to the software TCD.
srcModuloenum 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.
destModuloEnum type for an allowed destination modulo.
srcTransferSizeEnum type for source transfer size.
destTransferSizeEnum 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.

Parameters
baseRegister base address for eDMA module.
stcdThe pointer to the software TCD.
nbytesNumber 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.

Parameters
baseRegister base address for eDMA module.
stcdThe pointer to the software TCD.
configConfiguration data structure for the minor loop offset
static void EDMA_HAL_STCDSetSrcLastAdjust ( edma_software_tcd_t stcd,
int32_t  size 
)
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.

Parameters
stcdThe pointer to the software TCD.
sizeadjustment value
static void EDMA_HAL_STCDSetDestAddr ( edma_software_tcd_t stcd,
uint32_t  address 
)
inlinestatic
Parameters
stcdThe pointer to the software TCD.
addressThe pointer to the destination address.
static void EDMA_HAL_STCDSetDestOffset ( edma_software_tcd_t stcd,
int16_t  offset 
)
inlinestatic

Sign-extended offset applied to the current source address to form the next-state value as the each destination write is complete.

Parameters
stcdThe pointer to the software TCD.
offsetsigned-offset
static void EDMA_HAL_STCDSetDestLastAdjust ( edma_software_tcd_t stcd,
uint32_t  adjust 
)
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.

Parameters
stcdThe pointer to the software TCD.
adjustadjustment 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.

Parameters
stcdThe pointer to the software TCD.
nextStcdThe pointer to the TCD to be linked to this software TCD.
static void EDMA_HAL_STCDSetBandwidth ( edma_software_tcd_t stcd,
edma_bandwidth_config_t  bandwidth 
)
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.

Parameters
stcdThe pointer to the software TCD.
bandwidthenum type for bandwidth control
static void EDMA_HAL_STCDSetChannelMajorLink ( edma_software_tcd_t stcd,
uint32_t  majorChannel,
bool  enable 
)
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.

Parameters
stcdThe pointer to the software TCD.
majorChannelchannel number for major link
enableEnables (true) or Disables (false) channel major link.
static void EDMA_HAL_STCDSetScatterGatherCmd ( edma_software_tcd_t stcd,
bool  enable 
)
inlinestatic
Parameters
stcdThe pointer to the software TCD.
enableEnables (true) /Disables (false) scatter/gather feature.
static void EDMA_HAL_STCDSetDisableDmaRequestAfterTCDDoneCmd ( edma_software_tcd_t stcd,
bool  disable 
)
inlinestatic

If disabled, the eDMA hardware automatically clears the corresponding DMA request when the current major iteration count reaches zero.

Parameters
stcdThe pointer to the software TCD.
disableDisable (true)/Enable (true) DMA request after TCD complete.
static void EDMA_HAL_STCDSetHalfCompleteIntCmd ( edma_software_tcd_t stcd,
bool  enable 
)
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.

Parameters
stcdThe pointer to the software TCD.
enableEnable (true) /Disable (false) half complete interrupt.
static void EDMA_HAL_STCDSetIntCmd ( edma_software_tcd_t stcd,
bool  enable 
)
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.

Parameters
stcdThe pointer to the software TCD.
enableEnable (true) /Disable (false) interrupt after TCD done.
static void EDMA_HAL_STCDTriggerChannelStart ( edma_software_tcd_t stcd)
inlinestatic

The eDMA hardware automatically clears this flag after the channel begins execution.

Parameters
stcdThe pointer to the software TCD.
void EDMA_HAL_STCDSetChannelMinorLink ( edma_software_tcd_t stcd,
uint32_t  linkChannel,
bool  enable 
)
Parameters
stcdThe pointer to the software TCD.
linkChannelChannel to be linked on minor loop complete.
enableEnable (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.

Parameters
stcdThe pointer to the software TCD.
countmajor loop count
void EDMA_HAL_PushSTCDToHTCD ( DMA_Type *  base,
uint32_t  channel,
edma_software_tcd_t stcd 
)
Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
stcdThe 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.

Parameters
baseRegister base address for eDMA module.
stcdThe pointer to the software TCD.
configThe pointer to the transfer configuration structure.
enableIntEnables (true) or Disables (false) interrupt on TCD complete.
disableDmaRequestDisables (true) or Enable (false) DMA request on TCD complete.
Returns
An eDMA error codes or kStatus_EDMA_Success.