Go to the documentation of this file.
26 #define FSL_EDMA_DRIVER_VERSION (MAKE_VERSION(2, 3, 2))
30 #define DMA_DCHPRI_INDEX(channel) (((channel) & ~0x03U) | (3U - ((channel)&0x03U)))
118 #if defined(FSL_FEATURE_EDMA_CHANNEL_GROUP_COUNT) && (FSL_FEATURE_EDMA_CHANNEL_GROUP_COUNT > 1)
261 #if defined(__cplusplus)
436 #if defined(FSL_FEATURE_EDMA_ASYNCHRO_REQUEST_CHANNEL_COUNT) && FSL_FEATURE_EDMA_ASYNCHRO_REQUEST_CHANNEL_COUNT
444 static inline void EDMA_EnableAsyncRequest(
DMA_Type *base, uint32_t channel,
bool enable)
448 base->
EARS &= ~((uint32_t)1U << channel);
449 base->
EARS |= ((uint32_t)(
true == enable ? 1U : 0U) << channel);
578 assert(((uint32_t)tcd & 0x1FU) == 0U);
607 assert(((uint32_t)tcd & 0x1FU) == 0U);
811 uint32_t bytesEachRequest,
812 uint32_t transferBytes);
836 uint32_t bytesEachRequest,
837 uint32_t transferBytes,
895 int8_t tmpTcdSize = handle->
tcdSize;
896 int8_t tmpTcdUsed = handle->
tcdUsed;
897 return ((uint32_t)tmpTcdSize - (uint32_t)tmpTcdUsed);
945 #if defined(__cplusplus)
@ kEDMA_SourceAddressErrorFlag
void EDMA_TcdSetChannelLink(edma_tcd_t *tcd, edma_channel_link_type_t type, uint32_t linkedChannel)
Sets the channel link for the eDMA TCD.
void EDMA_SetChannelLink(DMA_Type *base, uint32_t channel, edma_channel_link_type_t type, uint32_t linkedChannel)
Sets the channel link for the eDMA transfer.
void EDMA_ResetChannel(DMA_Type *base, uint32_t channel)
Sets all TCD registers to default values.
eDMA transfer handle structure
void EDMA_DisableChannelInterrupts(DMA_Type *base, uint32_t channel, uint32_t mask)
Disables the interrupt source for the eDMA transfer.
@ kEDMA_BandwidthStall8Cycle
void EDMA_Deinit(DMA_Type *base)
Deinitializes the eDMA peripheral.
void EDMA_EnableChannelInterrupts(DMA_Type *base, uint32_t channel, uint32_t mask)
Enables the interrupt source for the eDMA transfer.
static void EDMA_TriggerChannelStart(DMA_Type *base, uint32_t channel)
Starts the eDMA transfer by using the software trigger.
struct _edma_minor_offset_config edma_minor_offset_config_t
eDMA minor offset configuration
@ kEDMA_DestinationOffsetErrorFlag
enum _edma_transfer_type edma_transfer_type_t
eDMA transfer type
static void EDMA_TcdEnableAutoStopRequest(edma_tcd_t *tcd, bool enable)
Sets the auto stop request for the eDMA TCD.
edma_transfer_size_t destTransferSize
void EDMA_InstallTCDMemory(edma_handle_t *handle, edma_tcd_t *tcdPool, uint32_t tcdSize)
Installs the TCDs memory pool into the eDMA handle.
status_t EDMA_SubmitTransfer(edma_handle_t *handle, const edma_transfer_config_t *config)
Submits the eDMA transfer request.
enum _edma_transfer_size edma_transfer_size_t
eDMA transfer configuration
static uint32_t EDMA_GetErrorStatusFlags(DMA_Type *base)
Gets the eDMA channel error status flags.
struct _edma_channel_Preemption_config edma_channel_Preemption_config_t
eDMA channel priority configuration
@ kEDMA_TransferSize2Bytes
_edma_transfer_size
eDMA transfer configuration
enum _edma_bandwidth edma_bandwidth_t
Bandwidth control.
enum _edma_channel_link_type edma_channel_link_type_t
Channel link type.
eDMA minor offset configuration
#define FSL_FEATURE_DMAMUX_MODULE_CHANNEL
#define DMA_CSR_INTHALF_MASK
void EDMA_SetChannelPreemptionConfig(DMA_Type *base, uint32_t channel, const edma_channel_Preemption_config_t *config)
Configures the eDMA channel preemption feature.
void EDMA_PrepareTransfer(edma_transfer_config_t *config, void *srcAddr, uint32_t srcWidth, void *destAddr, uint32_t destWidth, uint32_t bytesEachRequest, uint32_t transferBytes, edma_transfer_type_t type)
Prepares the eDMA transfer structure.
#define DMA_ES_ERRCHN_MASK
void EDMA_TcdReset(edma_tcd_t *tcd)
Sets all fields to default values for the TCD structure.
void EDMA_SetCallback(edma_handle_t *handle, edma_callback callback, void *userData)
Installs a callback function for the eDMA transfer.
void EDMA_TcdEnableInterrupts(edma_tcd_t *tcd, uint32_t mask)
Enables the interrupt source for the eDMA TCD.
_edma_channel_link_type
Channel link type.
#define DMA_CSR_DREQ_MASK
bool enableChannelPreemption
@ kEDMA_DestinationBusErrorFlag
@ kEDMA_PeripheralToMemory
bool enableSrcMinorOffset
@ kEDMA_TransferSize4Bytes
#define MAKE_STATUS(group, code)
Construct a status code value from a group and code number.
eDMA transfer configuration
void EDMA_HandleIRQ(edma_handle_t *handle)
eDMA IRQ handler for the current major loop transfer completion.
@ kEDMA_PeripheralToPeripheral
@ kEDMA_SourceBusErrorFlag
void EDMA_SetModulo(DMA_Type *base, uint32_t channel, edma_modulo_t srcModulo, edma_modulo_t destModulo)
Sets the source modulo and the destination modulo for the eDMA transfer.
void EDMA_StopTransfer(edma_handle_t *handle)
eDMA stops transfer.
_edma_modulo
eDMA modulo configuration
static void EDMA_DisableChannelRequest(DMA_Type *base, uint32_t channel)
Disables the eDMA hardware channel request.
@ kEDMA_BandwidthStallNone
bool enableDestMinorOffset
struct _edma_transfer_config edma_transfer_config_t
eDMA transfer configuration
@ kEDMA_TransferSize8Bytes
void EDMA_GetDefaultConfig(edma_config_t *config)
Gets the eDMA default configuration structure.
struct _edma_config edma_config_t
eDMA global configuration structure.
@ kEDMA_TransferCanceledFlag
void EDMA_TcdDisableInterrupts(edma_tcd_t *tcd, uint32_t mask)
Disables the interrupt source for the eDMA TCD.
void EDMA_AbortTransfer(edma_handle_t *handle)
eDMA aborts transfer.
_edma_interrupt_enable
eDMA interrupt source
void EDMA_CreateHandle(edma_handle_t *handle, DMA_Type *base, uint32_t channel)
Creates the eDMA handle.
@ kEDMA_TransferSize32Bytes
void EDMA_TcdSetMinorOffsetConfig(edma_tcd_t *tcd, const edma_minor_offset_config_t *config)
Configures the eDMA TCD minor offset feature.
void EDMA_Init(DMA_Type *base, const edma_config_t *config)
Initializes the eDMA peripheral.
void EDMA_PrepareTransferConfig(edma_transfer_config_t *config, void *srcAddr, uint32_t srcWidth, int16_t srcOffset, void *destAddr, uint32_t destWidth, int16_t destOffset, uint32_t bytesEachRequest, uint32_t transferBytes)
Prepares the eDMA transfer structure configurations.
void EDMA_SetMinorOffsetConfig(DMA_Type *base, uint32_t channel, const edma_minor_offset_config_t *config)
Configures the eDMA minor offset feature.
void(* edma_callback)(struct _edma_handle *handle, void *userData, bool transferDone, uint32_t tcds)
Define callback function for eDMA.
@ kEDMA_ScatterGatherErrorFlag
@ kEDMA_ChannelPriorityErrorFlag
void EDMA_SetTransferConfig(DMA_Type *base, uint32_t channel, const edma_transfer_config_t *config, edma_tcd_t *nextTcd)
Configures the eDMA transfer attribute.
struct DMA_Type::@304 TCD[32]
@ kEDMA_BandwidthStall4Cycle
edma_transfer_size_t srcTransferSize
_edma_transfer_type
eDMA transfer type
@ kEDMA_MemoryToPeripheral
void EDMA_InstallTCD(DMA_Type *base, uint32_t channel, edma_tcd_t *tcd)
Push content of TCD structure into hardware TCD register.
static void EDMA_TcdSetBandWidth(edma_tcd_t *tcd, edma_bandwidth_t bandWidth)
Sets the bandwidth for the eDMA TCD.
#define DMA_CSR_INTMAJOR_MASK
struct _edma_tcd edma_tcd_t
eDMA TCD.
@ kEDMA_ErrorInterruptEnable
eDMA global configuration structure.
@ kEDMA_HalfInterruptEnable
eDMA channel priority configuration
static void EDMA_EnableAutoStopRequest(DMA_Type *base, uint32_t channel, bool enable)
Enables an auto stop request for the eDMA transfer.
static uint32_t EDMA_GetUnusedTCDNumber(edma_handle_t *handle)
Get unused TCD slot number.
@ kEDMA_TransferSize1Bytes
static void EDMA_EnableChannelRequest(DMA_Type *base, uint32_t channel)
Enables the eDMA hardware channel request.
@ kEDMA_DestinationAddressErrorFlag
static sai_transceiver_t config
uint32_t EDMA_GetChannelStatusFlags(DMA_Type *base, uint32_t channel)
Gets the eDMA channel status flags.
bool enableRoundRobinArbitration
struct _edma_handle edma_handle_t
eDMA transfer handle structure
void EDMA_TcdSetTransferConfig(edma_tcd_t *tcd, const edma_transfer_config_t *config, edma_tcd_t *nextTcd)
Configures the eDMA TCD transfer attribute.
enum _edma_interrupt_enable edma_interrupt_enable_t
eDMA interrupt source
static uint32_t EDMA_GetNextTCDAddress(edma_handle_t *handle)
Get the next tcd address.
_edma_bandwidth
Bandwidth control.
@ kEDMA_SourceOffsetErrorFlag
int32_t status_t
Type used for all status and error return values.
void EDMA_ClearChannelStatusFlags(DMA_Type *base, uint32_t channel, uint32_t mask)
Clears the eDMA channel status flags.
void EDMA_StartTransfer(edma_handle_t *handle)
eDMA starts transfer.
enum _edma_modulo edma_modulo_t
eDMA modulo configuration
@ kEDMA_MajorInterruptEnable
uint32_t EDMA_GetRemainingMajorLoopCount(DMA_Type *base, uint32_t channel)
Gets the remaining major loop count from the eDMA current channel TCD.
bool enablePreemptAbility
void EDMA_TcdSetModulo(edma_tcd_t *tcd, edma_modulo_t srcModulo, edma_modulo_t destModulo)
Sets the source modulo and the destination modulo for the eDMA TCD.
bool enableContinuousLinkMode
void EDMA_SetBandWidth(DMA_Type *base, uint32_t channel, edma_bandwidth_t bandWidth)
Sets the bandwidth for the eDMA transfer.
@ kEDMA_TransferSize16Bytes