S32 SDK

Detailed Description

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.

Enumerations

enum  edma_arbitration_algorithm_t { EDMA_ARBITRATION_FIXED_PRIORITY = 0U, EDMA_ARBITRATION_ROUND_ROBIN }
 eDMA channel arbitration algorithm used for selection among channels. Implements : edma_arbitration_algorithm_t_Class More...
 
enum  edma_channel_priority_t {
  EDMA_CHN_PRIORITY_0 = 0U, EDMA_CHN_PRIORITY_1 = 1U, EDMA_CHN_PRIORITY_2 = 2U, EDMA_CHN_PRIORITY_3 = 3U,
  EDMA_CHN_PRIORITY_4 = 4U, EDMA_CHN_PRIORITY_5 = 5U, EDMA_CHN_PRIORITY_6 = 6U, EDMA_CHN_PRIORITY_7 = 7U,
  EDMA_CHN_PRIORITY_8 = 8U, EDMA_CHN_PRIORITY_9 = 9U, EDMA_CHN_PRIORITY_10 = 10U, EDMA_CHN_PRIORITY_11 = 11U,
  EDMA_CHN_PRIORITY_12 = 12U, EDMA_CHN_PRIORITY_13 = 13U, EDMA_CHN_PRIORITY_14 = 14U, EDMA_CHN_PRIORITY_15 = 15U,
  EDMA_CHN_DEFAULT_PRIORITY = 255U
}
 eDMA channel priority setting Implements : edma_channel_priority_t_Class More...
 
enum  edma_modulo_t {
  EDMA_MODULO_OFF = 0U, EDMA_MODULO_2B, EDMA_MODULO_4B, EDMA_MODULO_8B,
  EDMA_MODULO_16B, EDMA_MODULO_32B, EDMA_MODULO_64B, EDMA_MODULO_128B,
  EDMA_MODULO_256B, EDMA_MODULO_512B, EDMA_MODULO_1KB, EDMA_MODULO_2KB,
  EDMA_MODULO_4KB, EDMA_MODULO_8KB, EDMA_MODULO_16KB, EDMA_MODULO_32KB,
  EDMA_MODULO_64KB, EDMA_MODULO_128KB, EDMA_MODULO_256KB, EDMA_MODULO_512KB,
  EDMA_MODULO_1MB, EDMA_MODULO_2MB, EDMA_MODULO_4MB, EDMA_MODULO_8MB,
  EDMA_MODULO_16MB, EDMA_MODULO_32MB, EDMA_MODULO_64MB, EDMA_MODULO_128MB,
  EDMA_MODULO_256MB, EDMA_MODULO_512MB, EDMA_MODULO_1GB, EDMA_MODULO_2GB
}
 eDMA modulo configuration Implements : edma_modulo_t_Class More...
 
enum  edma_transfer_size_t {
  EDMA_TRANSFER_SIZE_1B = 0x0U, EDMA_TRANSFER_SIZE_2B = 0x1U, EDMA_TRANSFER_SIZE_4B = 0x2U, EDMA_TRANSFER_SIZE_16B = 0x4U,
  EDMA_TRANSFER_SIZE_32B = 0x5U
}
 eDMA transfer configuration Implements : edma_transfer_size_t_Class More...
 
enum  edma_bandwidth_config_t { EDMA_BANDWIDTH_STALL_NONE = 0U, EDMA_BANDWIDTH_STALL_4_CYCLES = 2U, EDMA_BANDWIDTH_STALL_8_CYCLES = 3U }
 Bandwidth control configuration Implements : edma_bandwidth_config_t_Class. More...
 

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

Enumeration Type Documentation

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.

Enumerator
EDMA_BANDWIDTH_STALL_NONE 

No eDMA engine stalls.

EDMA_BANDWIDTH_STALL_4_CYCLES 

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

EDMA_BANDWIDTH_STALL_8_CYCLES 

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

Definition at line 143 of file edma_hal.h.

eDMA channel priority setting Implements : edma_channel_priority_t_Class

Enumerator
EDMA_CHN_PRIORITY_0 
EDMA_CHN_PRIORITY_1 
EDMA_CHN_PRIORITY_2 
EDMA_CHN_PRIORITY_3 
EDMA_CHN_PRIORITY_4 
EDMA_CHN_PRIORITY_5 
EDMA_CHN_PRIORITY_6 
EDMA_CHN_PRIORITY_7 
EDMA_CHN_PRIORITY_8 
EDMA_CHN_PRIORITY_9 
EDMA_CHN_PRIORITY_10 
EDMA_CHN_PRIORITY_11 
EDMA_CHN_PRIORITY_12 
EDMA_CHN_PRIORITY_13 
EDMA_CHN_PRIORITY_14 
EDMA_CHN_PRIORITY_15 
EDMA_CHN_DEFAULT_PRIORITY 

Definition at line 62 of file edma_hal.h.

eDMA modulo configuration Implements : edma_modulo_t_Class

Enumerator
EDMA_MODULO_OFF 
EDMA_MODULO_2B 
EDMA_MODULO_4B 
EDMA_MODULO_8B 
EDMA_MODULO_16B 
EDMA_MODULO_32B 
EDMA_MODULO_64B 
EDMA_MODULO_128B 
EDMA_MODULO_256B 
EDMA_MODULO_512B 
EDMA_MODULO_1KB 
EDMA_MODULO_2KB 
EDMA_MODULO_4KB 
EDMA_MODULO_8KB 
EDMA_MODULO_16KB 
EDMA_MODULO_32KB 
EDMA_MODULO_64KB 
EDMA_MODULO_128KB 
EDMA_MODULO_256KB 
EDMA_MODULO_512KB 
EDMA_MODULO_1MB 
EDMA_MODULO_2MB 
EDMA_MODULO_4MB 
EDMA_MODULO_8MB 
EDMA_MODULO_16MB 
EDMA_MODULO_32MB 
EDMA_MODULO_64MB 
EDMA_MODULO_128MB 
EDMA_MODULO_256MB 
EDMA_MODULO_512MB 
EDMA_MODULO_1GB 
EDMA_MODULO_2GB 

Definition at line 94 of file edma_hal.h.

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.

Function Documentation

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.

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

Parameters
baseRegister base address for eDMA module.

Definition at line 88 of file edma_hal.c.

static void EDMA_HAL_ClearDoneStatusFlag ( DMA_Type base,
uint8_t  channel 
)
inlinestatic

Clears the done status for a channel or all channels.

Parameters
baseRegister base address for eDMA module.
channelChannel 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.

static void EDMA_HAL_ClearErrorIntStatusFlag ( DMA_Type base,
uint8_t  channel 
)
inlinestatic

Clears the error interrupt status for the eDMA channel or channels.

Parameters
baseRegister base address for eDMA module.
channelChannel 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.

static void EDMA_HAL_ClearIntStatusFlag ( DMA_Type base,
uint8_t  channel 
)
inlinestatic

Clears the interrupt status for the eDMA channel or all channels.

Parameters
baseRegister base address for eDMA module.
channelChannel 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.

static edma_arbitration_algorithm_t EDMA_HAL_GetChannelArbitrationMode ( const DMA_Type base)
inlinestatic

Gets the channel arbitration algorithm.

Parameters
baseRegister base address for eDMA module.
Returns
edma_arbitration_algorithm_t variable indicating the selected channel arbitration: Round-Robin way or fixed priority way Implements : EDMA_HAL_GetChannelArbitrationMode_Activity

Definition at line 512 of file edma_hal.h.

static bool EDMA_HAL_GetChannelPriorityError ( const DMA_Type base)
inlinestatic

Checks for channel priority errors.

Returns whether the channel priorities configuration was erroneous (priorities not unique).

Parameters
baseRegister base address for eDMA module.
Returns
true, if the channels priorities were misconfigured, false otherwise. Implements : EDMA_HAL_GetChannelPriorityError_Activity

Definition at line 300 of file edma_hal.h.

static uint8_t EDMA_HAL_GetChannelWithError ( const DMA_Type base)
inlinestatic

Error channel number.

Returns the channel number of the last recorded error.

Parameters
baseRegister base address for eDMA module.
Returns
the channel number of the last recorded error. Implements : EDMA_HAL_GetChannelWithError_Activity

Definition at line 426 of file edma_hal.h.

static bool EDMA_HAL_GetDestinationAddressError ( const DMA_Type base)
inlinestatic

Checks for destination address errors.

Returns whether the destination address configuration was erroneous.

Parameters
baseRegister base address for eDMA module.
Returns
true, if the destination address was misconfigured, false otherwise. Implements : EDMA_HAL_GetDestinationAddressError_Activity

Definition at line 342 of file edma_hal.h.

static bool EDMA_HAL_GetDestinationBusError ( const DMA_Type base)
inlinestatic

Checks for destination bus errors.

Returns whether there was a bus error on a destination write.

Parameters
baseRegister base address for eDMA module.
Returns
true, if there was a destination bus error, false otherwise. Implements : EDMA_HAL_GetDestinationBusError_Activity

Definition at line 412 of file edma_hal.h.

static bool EDMA_HAL_GetDestinationOffsetError ( const DMA_Type base)
inlinestatic

Checks for destination offset errors.

Returns whether the destination offset configuration was erroneous.

Parameters
baseRegister base address for eDMA module.
Returns
true, if the destination offset was misconfigured, false otherwise. Implements : EDMA_HAL_GetDestinationOffsetError_Activity

Definition at line 356 of file edma_hal.h.

static bool EDMA_HAL_GetDmaRequestStatusFlag ( const DMA_Type base,
uint32_t  channel 
)
inlinestatic

Gets the eDMA channel DMA request status.

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). Implements : EDMA_HAL_GetDmaRequestStatusFlag_Activity

Definition at line 672 of file edma_hal.h.

static uint32_t EDMA_HAL_GetErrorIntStatusFlag ( const DMA_Type base)
inlinestatic

Gets the eDMA error interrupt status.

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'. Implements : EDMA_HAL_GetErrorIntStatusFlag_Activity

Definition at line 632 of file edma_hal.h.

static bool EDMA_HAL_GetIntStatusFlag ( const DMA_Type base,
uint32_t  channel 
)
inlinestatic

Gets the eDMA channel interrupt request status.

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). Implements : EDMA_HAL_GetIntStatusFlag_Activity

Definition at line 720 of file edma_hal.h.

static bool EDMA_HAL_GetMinorMajorLoopConfigError ( const DMA_Type base)
inlinestatic

Checks for minor/major loop configuration errors.

Returns whether the NBYTES or CITER fields configuration was erroneous.

Parameters
baseRegister base address for eDMA module.
Returns
true, if the NBYTES/CITER was misconfigured, false otherwise. Implements : EDMA_HAL_GetMinorMajorLoopConfigError_Activity

Definition at line 370 of file edma_hal.h.

static bool EDMA_HAL_GetScatterGatherError ( const DMA_Type base)
inlinestatic

Checks for scatter/gather configuration errors.

Returns whether the scatter/gather configuration was erroneous.

Parameters
baseRegister base address for eDMA module.
Returns
true, if the scatter/gather feature was misconfigured, false otherwise. Implements : EDMA_HAL_GetScatterGatherError_Activity

Definition at line 384 of file edma_hal.h.

static bool EDMA_HAL_GetSourceAddressError ( const DMA_Type base)
inlinestatic

Checks for source address errors.

Returns whether the source address configuration was erroneous.

Parameters
baseRegister base address for eDMA module.
Returns
true, if the source address was misconfigured, false otherwise. Implements : EDMA_HAL_GetSourceAddressError_Activity

Definition at line 314 of file edma_hal.h.

static bool EDMA_HAL_GetSourceBusError ( const DMA_Type base)
inlinestatic

Checks for source bus errors.

Returns whether there was a bus error on a source read.

Parameters
baseRegister base address for eDMA module.
Returns
true, if there was a source bus error, false otherwise. Implements : EDMA_HAL_GetSourceBusError_Activity

Definition at line 398 of file edma_hal.h.

static bool EDMA_HAL_GetSourceOffsetError ( const DMA_Type base)
inlinestatic

Checks for source offset errors.

Returns whether the source offset configuration was erroneous.

Parameters
baseRegister base address for eDMA module.
Returns
true, if the source offset was misconfigured, false otherwise. Implements : EDMA_HAL_GetSourceOffsetError_Activity

Definition at line 328 of file edma_hal.h.

static bool EDMA_HAL_GetTransferCancelledError ( const DMA_Type base)
inlinestatic

Checks for cancelled transfers.

Returns whether the last entry was a cancelled transfer, by the error cancel transfer input

Parameters
baseRegister base address for eDMA module.
Returns
true, if the last transfer was cancelled, false otherwise. Implements : EDMA_HAL_GetTransferCancelledError_Activity

Definition at line 285 of file edma_hal.h.

static bool EDMA_HAL_GetValidErrorNotCleared ( const DMA_Type base)
inlinestatic

Checks for valid errors.

Returns whether a valid error exists, that has not been cleared.

Parameters
baseRegister base address for eDMA module.
Returns
true, if a valid uncleared error exists, false otherwise. Implements : EDMA_HAL_GetValidErrorNotCleared_Activity

Definition at line 270 of file edma_hal.h.

void EDMA_HAL_Init ( DMA_Type base)

Initializes eDMA module to known state.

Parameters
baseRegister base address for eDMA module.

Definition at line 42 of file edma_hal.c.

static void EDMA_HAL_SetAsyncRequestInStopModeCmd ( DMA_Type base,
uint32_t  channel,
bool  enable 
)
inlinestatic

Enables/Disables an asynchronous request in stop mode.

Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
enableEnable (true) or Disable (false) async DMA request. Implements : EDMA_HAL_SetAsyncRequestInStopModeCmd_Activity

Definition at line 755 of file edma_hal.h.

static void EDMA_HAL_SetChannelArbitrationMode ( DMA_Type base,
edma_arbitration_algorithm_t  channelArbitration 
)
inlinestatic

Sets the channel arbitration algorithm.

Parameters
baseRegister base address for eDMA module.
channelArbitrationRound-Robin way or fixed priority way. Implements : EDMA_HAL_SetChannelArbitrationMode_Activity

Definition at line 496 of file edma_hal.h.

static void EDMA_HAL_SetChannelPreemptMode ( DMA_Type base,
uint32_t  channel,
bool  preemptive,
bool  preemptible 
)
inlinestatic

Sets the preemption feature for the eDMA channel.

This function sets the preemption features.

Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
preemptiveeDMA channel can suspend a lower priority channel (true). eDMA channel cannot suspend a lower priority channel (false).
preemptibleeDMA 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.

static void EDMA_HAL_SetChannelPriority ( DMA_Type base,
uint32_t  channel,
edma_channel_priority_t  priority 
)
inlinestatic

Sets the eDMA channel priority.

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. Implements : EDMA_HAL_SetChannelPriority_Activity

Definition at line 475 of file edma_hal.h.

static void EDMA_HAL_SetContinuousLinkCmd ( DMA_Type base,
bool  continuous 
)
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.

Parameters
baseRegister base address for eDMA module.
continuousEnables (true) or Disable (false) continuous transfer mode. Implements : EDMA_HAL_SetContinuousLinkCmd_Activity

Definition at line 605 of file edma_hal.h.

static void EDMA_HAL_SetDebugCmd ( DMA_Type base,
bool  enable 
)
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.

Parameters
baseRegister base address for eDMA module.
enableEnables (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.

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.

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.

Parameters
baseRegister base address for eDMA module.
channelChannel indicator. If kEDMAAllChannel is selected, all channels' error interrupt will be enabled/disabled.
enableEnable(true) or Disable (false) error interrupt.

Definition at line 106 of file edma_hal.c.

static void EDMA_HAL_SetHaltCmd ( DMA_Type base,
bool  halt 
)
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.

Parameters
baseRegister base address for eDMA module.
haltHalts (true) or un-halts (false) eDMA transfer. Implements : EDMA_HAL_SetHaltCmd_Activity

Definition at line 206 of file edma_hal.h.

static void EDMA_HAL_SetHaltOnErrorCmd ( DMA_Type base,
bool  haltOnError 
)
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.

Parameters
baseRegister base address for eDMA module.
haltOnErrorHalts (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.

static void EDMA_HAL_SetMinorLoopMappingCmd ( DMA_Type base,
bool  enable 
)
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.

Parameters
baseRegister base address for eDMA module.
enableEnables (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.

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

Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
Returns
begin iteration count

Definition at line 429 of file edma_hal.c.

static bool EDMA_HAL_TCDGetChannelActiveStatus ( const DMA_Type base,
uint32_t  channel 
)
inlinestatic

Checks whether the channel is running for the TCD.

Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
Returns
True stands for running. False stands for not. Implements : EDMA_HAL_TCDGetChannelActiveStatus_Activity

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.

Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
Returns
current iteration count

Definition at line 454 of file edma_hal.c.

static bool EDMA_HAL_TCDGetDoneStatusFlag ( const DMA_Type base,
uint32_t  channel 
)
inlinestatic

Gets the channel done status.

Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
Returns
If channel done. Implements : EDMA_HAL_TCDGetDoneStatusFlag_Activity

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.

Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
Returns
data bytes already transferred

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.

Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
Returns
nbytes configuration according to minor loop setting.

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.

Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
Returns
data bytes already transferred

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.

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.

Definition at line 194 of file edma_hal.c.

static void EDMA_HAL_TCDSetBandwidth ( DMA_Type base,
uint32_t  channel,
edma_bandwidth_config_t  bandwidth 
)
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.

Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
bandwidthenum type for bandwidth control Implements : EDMA_HAL_TCDSetBandwidth_Activity

Definition at line 1044 of file edma_hal.h.

static void EDMA_HAL_TCDSetChannelMajorLink ( DMA_Type base,
uint32_t  channel,
uint32_t  majorLinkChannel,
bool  enable 
)
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.

Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
majorLinkChannelchannel number for major link
enableEnables (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.

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.

Definition at line 347 of file edma_hal.c.

static void EDMA_HAL_TCDSetDestAddr ( DMA_Type base,
uint32_t  channel,
uint32_t  address 
)
inlinestatic

Configures the destination address for the TCD.

Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
addressThe pointer to the destination address. Implements : EDMA_HAL_TCDSetDestAddr_Activity

Definition at line 968 of file edma_hal.h.

static void EDMA_HAL_TCDSetDestLastAdjust ( DMA_Type base,
uint32_t  channel,
int32_t  adjust 
)
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.

Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
adjustadjustment value Implements : EDMA_HAL_TCDSetDestLastAdjust_Activity

Definition at line 1007 of file edma_hal.h.

static void EDMA_HAL_TCDSetDestMinorLoopOffsetCmd ( DMA_Type base,
uint32_t  channel,
bool  enable 
)
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.

Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
enableEnables (true) or disables (false) destination minor loop offset. Implements : EDMA_HAL_TCDSetDestMinorLoopOffsetCmd_Activity

Definition at line 910 of file edma_hal.h.

static void EDMA_HAL_TCDSetDestOffset ( DMA_Type base,
uint32_t  channel,
int16_t  offset 
)
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.

Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
offsetsigned-offset Implements : EDMA_HAL_TCDSetDestOffset_Activity

Definition at line 987 of file edma_hal.h.

static void EDMA_HAL_TCDSetDisableDmaRequestAfterTCDDoneCmd ( DMA_Type base,
uint32_t  channel,
bool  disable 
)
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.

Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
disableDisable (true)/Enable (false) DMA request after TCD complete. Implements : EDMA_HAL_TCDSetDisableDmaRequestAfterTCDDoneCmd_Activity

Definition at line 1117 of file edma_hal.h.

static void EDMA_HAL_TCDSetHalfCompleteIntCmd ( DMA_Type base,
uint32_t  channel,
bool  enable 
)
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.

Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
enableEnable (true) /Disable (false) half complete interrupt. Implements : EDMA_HAL_TCDSetHalfCompleteIntCmd_Activity

Definition at line 1143 of file edma_hal.h.

static void EDMA_HAL_TCDSetIntCmd ( DMA_Type base,
uint32_t  channel,
bool  enable 
)
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.

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

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

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

Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
nbytesNumber of bytes to be transferred in each service request of the channel

Definition at line 215 of file edma_hal.c.

static void EDMA_HAL_TCDSetScatterGatherCmd ( DMA_Type base,
uint32_t  channel,
bool  enable 
)
inlinestatic

Enables/Disables the scatter/gather feature for the TCD.

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

Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
nextTCDAddrThe address of the next TCD to be linked to this TCD.

Definition at line 332 of file edma_hal.c.

static void EDMA_HAL_TCDSetSrcAddr ( DMA_Type base,
uint32_t  channel,
uint32_t  address 
)
inlinestatic

Configures the source address for the hardware TCD.

Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
addressThe pointer to the source memory address. Implements : EDMA_HAL_TCDSetSrcAddr_Activity

Definition at line 794 of file edma_hal.h.

static void EDMA_HAL_TCDSetSrcLastAdjust ( DMA_Type base,
uint32_t  channel,
int32_t  size 
)
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.

Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
sizeadjustment value Implements : EDMA_HAL_TCDSetSrcLastAdjust_Activity

Definition at line 952 of file edma_hal.h.

static void EDMA_HAL_TCDSetSrcMinorLoopOffsetCmd ( DMA_Type base,
uint32_t  channel,
bool  enable 
)
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.

Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
enableEnables (true) or disables (false) source minor loop offset. Implements : EDMA_HAL_TCDSetSrcMinorLoopOffsetCmd_Activity

Definition at line 881 of file edma_hal.h.

static void EDMA_HAL_TCDSetSrcOffset ( DMA_Type base,
uint32_t  channel,
int16_t  offset 
)
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.

Parameters
baseRegister base address for eDMA module.
channeleDMA channel number.
offsetsigned-offset for source address. Implements : EDMA_HAL_TCDSetSrcOffset_Activity

Definition at line 813 of file edma_hal.h.

static void EDMA_HAL_TCDTriggerChannelStart ( DMA_Type base,
uint32_t  channel 
)
inlinestatic

Triggers the start bits for the TCD.

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

Parameters
baseRegister base address for eDMA module.
channeleDMA channel number. Implements : EDMA_HAL_TCDTriggerChannelStart_Activity

Definition at line 1187 of file edma_hal.h.

static void EDMA_HAL_TriggerChannelStart ( DMA_Type base,
uint8_t  channel 
)
inlinestatic

Triggers the eDMA channel.

Parameters
baseRegister base address for eDMA module.
channelChannel indicator. If kEDMAAllChannel is selected, all channels are tirggere. Implements : EDMA_HAL_TriggerChannelStart_Activity

Definition at line 703 of file edma_hal.h.