Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Edma
Data Structures | |
| struct | _edma_config |
| eDMA global configuration structure. More... | |
| struct | _edma_transfer_config |
| eDMA transfer configuration More... | |
| struct | _edma_channel_Preemption_config |
| eDMA channel priority configuration More... | |
| struct | _edma_minor_offset_config |
| eDMA minor offset configuration More... | |
| struct | _edma_tcd |
| eDMA TCD. More... | |
| struct | _edma_handle |
| eDMA transfer handle structure More... | |
Typedefs | |
| typedef enum _edma_transfer_size | edma_transfer_size_t |
| eDMA transfer configuration | |
| typedef enum _edma_modulo | edma_modulo_t |
| eDMA modulo configuration | |
| typedef enum _edma_bandwidth | edma_bandwidth_t |
| Bandwidth control. | |
| typedef enum _edma_channel_link_type | edma_channel_link_type_t |
| Channel link type. | |
| typedef enum _edma_interrupt_enable | edma_interrupt_enable_t |
| eDMA interrupt source | |
| typedef enum _edma_transfer_type | edma_transfer_type_t |
| eDMA transfer type | |
| typedef struct _edma_config | edma_config_t |
| eDMA global configuration structure. | |
| typedef struct _edma_transfer_config | edma_transfer_config_t |
| eDMA transfer configuration | |
| typedef struct _edma_channel_Preemption_config | edma_channel_Preemption_config_t |
| eDMA channel priority configuration | |
| typedef struct _edma_minor_offset_config | edma_minor_offset_config_t |
| eDMA minor offset configuration | |
| typedef struct _edma_tcd | edma_tcd_t |
| eDMA TCD. | |
| typedef void(* | edma_callback )(struct _edma_handle *handle, void *userData, bool transferDone, uint32_t tcds) |
| Define callback function for eDMA. | |
| typedef struct _edma_handle | edma_handle_t |
| eDMA transfer handle structure | |
Enumerations | |
| enum | _edma_transfer_size { kEDMA_TransferSize1Bytes = 0x0U, kEDMA_TransferSize2Bytes = 0x1U, kEDMA_TransferSize4Bytes = 0x2U, kEDMA_TransferSize8Bytes = 0x3U, kEDMA_TransferSize16Bytes = 0x4U, kEDMA_TransferSize32Bytes = 0x5U } |
eDMA transfer configuration More... | |
| enum | _edma_modulo { kEDMA_ModuloDisable = 0x0U, kEDMA_Modulo2bytes, kEDMA_Modulo4bytes, kEDMA_Modulo8bytes, kEDMA_Modulo16bytes, kEDMA_Modulo32bytes, kEDMA_Modulo64bytes, kEDMA_Modulo128bytes, kEDMA_Modulo256bytes, kEDMA_Modulo512bytes, kEDMA_Modulo1Kbytes, kEDMA_Modulo2Kbytes, kEDMA_Modulo4Kbytes, kEDMA_Modulo8Kbytes, kEDMA_Modulo16Kbytes, kEDMA_Modulo32Kbytes, kEDMA_Modulo64Kbytes, kEDMA_Modulo128Kbytes, kEDMA_Modulo256Kbytes, kEDMA_Modulo512Kbytes, kEDMA_Modulo1Mbytes, kEDMA_Modulo2Mbytes, kEDMA_Modulo4Mbytes, kEDMA_Modulo8Mbytes, kEDMA_Modulo16Mbytes, kEDMA_Modulo32Mbytes, kEDMA_Modulo64Mbytes, kEDMA_Modulo128Mbytes, kEDMA_Modulo256Mbytes, kEDMA_Modulo512Mbytes, kEDMA_Modulo1Gbytes, kEDMA_Modulo2Gbytes } |
eDMA modulo configuration More... | |
| enum | _edma_bandwidth { kEDMA_BandwidthStallNone = 0x0U, kEDMA_BandwidthStall4Cycle = 0x2U, kEDMA_BandwidthStall8Cycle = 0x3U } |
Bandwidth control. More... | |
| enum | _edma_channel_link_type { kEDMA_LinkNone = 0x0U, kEDMA_MinorLink, kEDMA_MajorLink } |
Channel link type. More... | |
| enum | _edma_channel_status_flags { kEDMA_DoneFlag = 0x1U, kEDMA_ErrorFlag = 0x2U, kEDMA_InterruptFlag = 0x4U } |
eDMA channel status flags. More... | |
| enum | _edma_error_status_flags { kEDMA_DestinationBusErrorFlag = DMA_ES_DBE_MASK, kEDMA_SourceBusErrorFlag = DMA_ES_SBE_MASK, kEDMA_ScatterGatherErrorFlag = DMA_ES_SGE_MASK, kEDMA_NbytesErrorFlag = DMA_ES_NCE_MASK, kEDMA_DestinationOffsetErrorFlag = DMA_ES_DOE_MASK, kEDMA_DestinationAddressErrorFlag = DMA_ES_DAE_MASK, kEDMA_SourceOffsetErrorFlag = DMA_ES_SOE_MASK, kEDMA_SourceAddressErrorFlag = DMA_ES_SAE_MASK, kEDMA_ErrorChannelFlag = DMA_ES_ERRCHN_MASK, kEDMA_ChannelPriorityErrorFlag = DMA_ES_CPE_MASK, kEDMA_TransferCanceledFlag = DMA_ES_ECX_MASK, kEDMA_GroupPriorityErrorFlag = DMA_ES_GPE_MASK, kEDMA_ValidFlag = (int)DMA_ES_VLD_MASK } |
eDMA channel error status flags. More... | |
| enum | _edma_interrupt_enable { kEDMA_ErrorInterruptEnable = 0x1U, kEDMA_MajorInterruptEnable = DMA_CSR_INTMAJOR_MASK, kEDMA_HalfInterruptEnable = DMA_CSR_INTHALF_MASK } |
eDMA interrupt source More... | |
| enum | _edma_transfer_type { kEDMA_MemoryToMemory = 0x0U, kEDMA_PeripheralToMemory, kEDMA_MemoryToPeripheral } |
eDMA transfer type More... | |
| enum | _edma_transfer_status { kStatus_EDMA_QueueFull = MAKE_STATUS(kStatusGroup_EDMA, 0), kStatus_EDMA_Busy = MAKE_STATUS(kStatusGroup_EDMA, 1) } |
eDMA transfer status More... | |
eDMA initialization and de-initialization | |
| void | EDMA_Init (DMA_Type *base, const edma_config_t *config) |
| Initializes the eDMA peripheral. | |
| void | EDMA_Deinit (DMA_Type *base) |
| Deinitializes the eDMA peripheral. | |
| void | EDMA_InstallTCD (DMA_Type *base, uint32_t channel, edma_tcd_t *tcd) |
| Push content of TCD structure into hardware TCD register. | |
| void | EDMA_GetDefaultConfig (edma_config_t *config) |
| Gets the eDMA default configuration structure. | |
eDMA Channel Operation | |
| void | EDMA_ResetChannel (DMA_Type *base, uint32_t channel) |
| Sets all TCD registers to default values. | |
| void | EDMA_SetTransferConfig (DMA_Type *base, uint32_t channel, const edma_transfer_config_t *config, edma_tcd_t *nextTcd) |
| Configures the eDMA transfer attribute. | |
| void | EDMA_SetMinorOffsetConfig (DMA_Type *base, uint32_t channel, const edma_minor_offset_config_t *config) |
| Configures the eDMA minor offset feature. | |
| static void | EDMA_SetChannelPreemptionConfig (DMA_Type *base, uint32_t channel, const edma_channel_Preemption_config_t *config) |
| Configures the eDMA channel preemption feature. | |
| 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_SetBandWidth (DMA_Type *base, uint32_t channel, edma_bandwidth_t bandWidth) |
| Sets the bandwidth for the eDMA transfer. | |
| 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. | |
| static void | EDMA_EnableAsyncRequest (DMA_Type *base, uint32_t channel, bool enable) |
| Enables an async request for the eDMA transfer. | |
| static void | EDMA_EnableAutoStopRequest (DMA_Type *base, uint32_t channel, bool enable) |
| Enables an auto stop request for the eDMA transfer. | |
| void | EDMA_EnableChannelInterrupts (DMA_Type *base, uint32_t channel, uint32_t mask) |
| Enables the interrupt source for the eDMA transfer. | |
| void | EDMA_DisableChannelInterrupts (DMA_Type *base, uint32_t channel, uint32_t mask) |
| Disables the interrupt source for the eDMA transfer. | |
eDMA TCD Operation | |
| void | EDMA_TcdReset (edma_tcd_t *tcd) |
| Sets all fields to default values for the TCD structure. | |
| void | EDMA_TcdSetTransferConfig (edma_tcd_t *tcd, const edma_transfer_config_t *config, edma_tcd_t *nextTcd) |
| Configures the eDMA TCD transfer attribute. | |
| void | EDMA_TcdSetMinorOffsetConfig (edma_tcd_t *tcd, const edma_minor_offset_config_t *config) |
| Configures the eDMA TCD minor offset feature. | |
| void | EDMA_TcdSetChannelLink (edma_tcd_t *tcd, edma_channel_link_type_t type, uint32_t linkedChannel) |
| Sets the channel link for the eDMA TCD. | |
| static void | EDMA_TcdSetBandWidth (edma_tcd_t *tcd, edma_bandwidth_t bandWidth) |
| Sets the bandwidth for the eDMA TCD. | |
| 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. | |
| static void | EDMA_TcdEnableAutoStopRequest (edma_tcd_t *tcd, bool enable) |
| Sets the auto stop request for the eDMA TCD. | |
| void | EDMA_TcdEnableInterrupts (edma_tcd_t *tcd, uint32_t mask) |
| Enables the interrupt source for the eDMA TCD. | |
| void | EDMA_TcdDisableInterrupts (edma_tcd_t *tcd, uint32_t mask) |
| Disables the interrupt source for the eDMA TCD. | |
eDMA Channel Transfer Operation | |
| static void | EDMA_EnableChannelRequest (DMA_Type *base, uint32_t channel) |
| Enables the eDMA hardware channel request. | |
| static void | EDMA_DisableChannelRequest (DMA_Type *base, uint32_t channel) |
| Disables the eDMA hardware channel request. | |
| static void | EDMA_TriggerChannelStart (DMA_Type *base, uint32_t channel) |
| Starts the eDMA transfer by using the software trigger. | |
eDMA Channel Status Operation | |
| uint32_t | EDMA_GetRemainingMajorLoopCount (DMA_Type *base, uint32_t channel) |
| Gets the remaining major loop count from the eDMA current channel TCD. | |
| static uint32_t | EDMA_GetErrorStatusFlags (DMA_Type *base) |
| Gets the eDMA channel error status flags. | |
| uint32_t | EDMA_GetChannelStatusFlags (DMA_Type *base, uint32_t channel) |
| Gets the eDMA channel status flags. | |
| void | EDMA_ClearChannelStatusFlags (DMA_Type *base, uint32_t channel, uint32_t mask) |
| Clears the eDMA channel status flags. | |
eDMA Transactional Operation | |
| void | EDMA_CreateHandle (edma_handle_t *handle, DMA_Type *base, uint32_t channel) |
| Creates the eDMA handle. | |
| void | EDMA_InstallTCDMemory (edma_handle_t *handle, edma_tcd_t *tcdPool, uint32_t tcdSize) |
| Installs the TCDs memory pool into the eDMA handle. | |
| void | EDMA_SetCallback (edma_handle_t *handle, edma_callback callback, void *userData) |
| Installs a callback function for the eDMA transfer. | |
| 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. | |
| status_t | EDMA_SubmitTransfer (edma_handle_t *handle, const edma_transfer_config_t *config) |
| Submits the eDMA transfer request. | |
| void | EDMA_StartTransfer (edma_handle_t *handle) |
| eDMA starts transfer. | |
| void | EDMA_StopTransfer (edma_handle_t *handle) |
| eDMA stops transfer. | |
| void | EDMA_AbortTransfer (edma_handle_t *handle) |
| eDMA aborts transfer. | |
| static uint32_t | EDMA_GetUnusedTCDNumber (edma_handle_t *handle) |
| Get unused TCD slot number. | |
| static uint32_t | EDMA_GetNextTCDAddress (edma_handle_t *handle) |
| Get the next tcd address. | |
| void | EDMA_HandleIRQ (edma_handle_t *handle) |
| eDMA IRQ handler for the current major loop transfer completion. | |
Typedef Documentation
| typedef enum _edma_bandwidth edma_bandwidth_t |
Bandwidth control.
| typedef void(* edma_callback)(struct _edma_handle *handle, void *userData, bool transferDone, uint32_t tcds) |
Define callback function for eDMA.
This callback function is called in the EDMA interrupt handle. In normal mode, run into callback function means the transfer users need is done. In scatter gather mode, run into callback function means a transfer control block (tcd) is finished. Not all transfer finished, users can get the finished tcd numbers using interface EDMA_GetUnusedTCDNumber.
- Parameters:
-
handle EDMA handle pointer, users shall not touch the values inside. userData The callback user parameter pointer. Users can use this parameter to involve things users need to change in EDMA callback function. transferDone If the current loaded transfer done. In normal mode it means if all transfer done. In scatter gather mode, this parameter shows is the current transfer block in EDMA register is done. As the load of core is different, it will be different if the new tcd loaded into EDMA registers while this callback called. If true, it always means new tcd still not loaded into registers, while false means new tcd already loaded into registers. tcds How many tcds are done from the last callback. This parameter only used in scatter gather mode. It tells user how many tcds are finished between the last callback and this.
Definition at line 242 of file fsl_edma.h.
| typedef enum _edma_channel_link_type edma_channel_link_type_t |
Channel link type.
| typedef struct _edma_channel_Preemption_config edma_channel_Preemption_config_t |
eDMA channel priority configuration
| typedef struct _edma_config edma_config_t |
eDMA global configuration structure.
| typedef struct _edma_handle edma_handle_t |
eDMA transfer handle structure
| typedef enum _edma_interrupt_enable edma_interrupt_enable_t |
eDMA interrupt source
| typedef struct _edma_minor_offset_config edma_minor_offset_config_t |
eDMA minor offset configuration
| typedef enum _edma_modulo edma_modulo_t |
eDMA modulo configuration
| typedef struct _edma_tcd edma_tcd_t |
eDMA TCD.
This structure is same as TCD register which is described in reference manual, and is used to configure the scatter/gather feature as a next hardware TCD.
| typedef struct _edma_transfer_config edma_transfer_config_t |
eDMA transfer configuration
This structure configures the source/destination transfer attribute.
| typedef enum _edma_transfer_size edma_transfer_size_t |
eDMA transfer configuration
| typedef enum _edma_transfer_type edma_transfer_type_t |
eDMA transfer type
Enumeration Type Documentation
| enum _edma_bandwidth |
Bandwidth control.
- Enumerator:
Definition at line 84 of file fsl_edma.h.
Channel link type.
- Enumerator:
kEDMA_LinkNone No channel link
kEDMA_MinorLink Channel link after each minor loop
kEDMA_MajorLink Channel link while major loop count exhausted
Definition at line 92 of file fsl_edma.h.
eDMA channel status flags.
- Enumerator:
Definition at line 100 of file fsl_edma.h.
eDMA channel error status flags.
- Enumerator:
Definition at line 108 of file fsl_edma.h.
eDMA interrupt source
- Enumerator:
Definition at line 128 of file fsl_edma.h.
| enum _edma_modulo |
eDMA modulo configuration
- Enumerator:
Definition at line 47 of file fsl_edma.h.
| enum _edma_transfer_size |
eDMA transfer configuration
- Enumerator:
Definition at line 36 of file fsl_edma.h.
eDMA transfer status
- Enumerator:
kStatus_EDMA_QueueFull TCD queue is full.
kStatus_EDMA_Busy Channel is busy and can't handle the transfer request.
Definition at line 144 of file fsl_edma.h.
| enum _edma_transfer_type |
eDMA transfer type
- Enumerator:
kEDMA_MemoryToMemory Transfer from memory to memory
kEDMA_PeripheralToMemory Transfer from peripheral to memory
kEDMA_MemoryToPeripheral Transfer from memory to peripheral
Definition at line 136 of file fsl_edma.h.
Function Documentation
| void EDMA_AbortTransfer | ( | edma_handle_t * | handle ) |
eDMA aborts transfer.
This function disables the channel request and clear transfer status bits. Users can submit another transfer after calling this API.
- Parameters:
-
handle DMA handle pointer.
brief eDMA aborts transfer.
This function disables the channel request and clear transfer status bits. Users can submit another transfer after calling this API.
param handle DMA handle pointer.
Definition at line 1164 of file fsl_edma.c.
| void EDMA_ClearChannelStatusFlags | ( | DMA_Type * | base, |
| uint32_t | channel, | ||
| uint32_t | mask | ||
| ) |
Clears the eDMA channel status flags.
- Parameters:
-
base eDMA peripheral base address. channel eDMA channel number. mask The mask of channel status to be cleared. Users need to use the defined _edma_channel_status_flags type.
brief Clears the eDMA channel status flags.
param base eDMA peripheral base address. param channel eDMA channel number. param mask The mask of channel status to be cleared. Users need to use the defined _edma_channel_status_flags type.
Definition at line 708 of file fsl_edma.c.
| void EDMA_CreateHandle | ( | edma_handle_t * | handle, |
| DMA_Type * | base, | ||
| uint32_t | channel | ||
| ) |
Creates the eDMA handle.
This function is called if using the transactional API for eDMA. This function initializes the internal state of the eDMA handle.
- Parameters:
-
handle eDMA handle pointer. The eDMA handle stores callback function and parameters. base eDMA peripheral base address. channel eDMA channel number.
brief Creates the eDMA handle.
This function is called if using the transactional API for eDMA. This function initializes the internal state of the eDMA handle.
param handle eDMA handle pointer. The eDMA handle stores callback function and parameters. param base eDMA peripheral base address. param channel eDMA channel number.
Definition at line 757 of file fsl_edma.c.
| void EDMA_Deinit | ( | DMA_Type * | base ) |
Deinitializes the eDMA peripheral.
This function gates the eDMA clock.
- Parameters:
-
base eDMA peripheral base address.
brief Deinitializes the eDMA peripheral.
This function gates the eDMA clock.
param base eDMA peripheral base address.
Definition at line 143 of file fsl_edma.c.
| void EDMA_DisableChannelInterrupts | ( | DMA_Type * | base, |
| uint32_t | channel, | ||
| uint32_t | mask | ||
| ) |
Disables the interrupt source for the eDMA transfer.
- Parameters:
-
base eDMA peripheral base address. channel eDMA channel number. mask The mask of the interrupt source to be set. Use the defined edma_interrupt_enable_t type.
brief Disables the interrupt source for the eDMA transfer.
param base eDMA peripheral base address. param channel eDMA channel number. param mask The mask of the interrupt source to be set. Use the defined edma_interrupt_enable_t type.
Definition at line 361 of file fsl_edma.c.
| static void EDMA_DisableChannelRequest | ( | DMA_Type * | base, |
| uint32_t | channel | ||
| ) | [static] |
Disables the eDMA hardware channel request.
This function disables the hardware channel request.
- Parameters:
-
base eDMA peripheral base address. channel eDMA channel number.
Definition at line 669 of file fsl_edma.h.
| static void EDMA_EnableAsyncRequest | ( | DMA_Type * | base, |
| uint32_t | channel, | ||
| bool | enable | ||
| ) | [static] |
Enables an async request for the eDMA transfer.
- Parameters:
-
base eDMA peripheral base address. channel eDMA channel number. enable The command to enable (true) or disable (false).
Definition at line 456 of file fsl_edma.h.
| static void EDMA_EnableAutoStopRequest | ( | DMA_Type * | base, |
| uint32_t | channel, | ||
| bool | enable | ||
| ) | [static] |
Enables an auto stop request for the eDMA transfer.
If enabling the auto stop request, the eDMA hardware automatically disables the hardware channel request.
- Parameters:
-
base eDMA peripheral base address. channel eDMA channel number. enable The command to enable (true) or disable (false).
Definition at line 473 of file fsl_edma.h.
| void EDMA_EnableChannelInterrupts | ( | DMA_Type * | base, |
| uint32_t | channel, | ||
| uint32_t | mask | ||
| ) |
Enables the interrupt source for the eDMA transfer.
- Parameters:
-
base eDMA peripheral base address. channel eDMA channel number. mask The mask of interrupt source to be set. Users need to use the defined edma_interrupt_enable_t type.
brief Enables the interrupt source for the eDMA transfer.
param base eDMA peripheral base address. param channel eDMA channel number. param mask The mask of interrupt source to be set. Users need to use the defined edma_interrupt_enable_t type.
Definition at line 330 of file fsl_edma.c.
| static void EDMA_EnableChannelRequest | ( | DMA_Type * | base, |
| uint32_t | channel | ||
| ) | [static] |
Enables the eDMA hardware channel request.
This function enables the hardware channel request.
- Parameters:
-
base eDMA peripheral base address. channel eDMA channel number.
Definition at line 654 of file fsl_edma.h.
| uint32_t EDMA_GetChannelStatusFlags | ( | DMA_Type * | base, |
| uint32_t | channel | ||
| ) |
Gets the eDMA channel status flags.
- Parameters:
-
base eDMA peripheral base address. channel eDMA channel number.
- Returns:
- The mask of channel status flags. Users need to use the _edma_channel_status_flags type to decode the return variables.
brief Gets the eDMA channel status flags.
param base eDMA peripheral base address. param channel eDMA channel number. return The mask of channel status flags. Users need to use the _edma_channel_status_flags type to decode the return variables.
Definition at line 684 of file fsl_edma.c.
| void EDMA_GetDefaultConfig | ( | edma_config_t * | config ) |
Gets the eDMA default configuration structure.
This function sets the configuration structure to default values. The default configuration is set to the following values.
config.enableContinuousLinkMode = false; config.enableHaltOnError = true; config.enableRoundRobinArbitration = false; config.enableDebugMode = false;
- Parameters:
-
config A pointer to the eDMA configuration structure.
brief Gets the eDMA default configuration structure.
This function sets the configuration structure to default values. The default configuration is set to the following values. code config.enableContinuousLinkMode = false; config.enableHaltOnError = true; config.enableRoundRobinArbitration = false; config.enableDebugMode = false; endcode
param config A pointer to the eDMA configuration structure.
Definition at line 165 of file fsl_edma.c.
| static uint32_t EDMA_GetErrorStatusFlags | ( | DMA_Type * | base ) | [static] |
Gets the eDMA channel error status flags.
- Parameters:
-
base eDMA peripheral base address.
- Returns:
- The mask of error status flags. Users need to use the _edma_error_status_flags type to decode the return variables.
Definition at line 727 of file fsl_edma.h.
| static uint32_t EDMA_GetNextTCDAddress | ( | edma_handle_t * | handle ) | [static] |
Get the next tcd address.
This function gets the next tcd address. If this is last TCD, return 0.
- Parameters:
-
handle DMA handle pointer.
- Returns:
- The next TCD address.
Definition at line 888 of file fsl_edma.h.
| uint32_t EDMA_GetRemainingMajorLoopCount | ( | DMA_Type * | base, |
| uint32_t | channel | ||
| ) |
Gets the remaining major loop count from the eDMA current channel TCD.
This function checks the TCD (Task Control Descriptor) status for a specified eDMA channel and returns the number of major loop count that has not finished.
- Parameters:
-
base eDMA peripheral base address. channel eDMA channel number.
- Returns:
- Major loop count which has not been transferred yet for the current TCD.
- Note:
- 1. This function can only be used to get unfinished major loop count of transfer without the next TCD, or it might be inaccuracy. 2. The unfinished/remaining transfer bytes cannot be obtained directly from registers while the channel is running. Because to calculate the remaining bytes, the initial NBYTES configured in DMA_TCDn_NBYTES_MLNO register is needed while the eDMA IP does not support getting it while a channel is active. In another word, the NBYTES value reading is always the actual (decrementing) NBYTES value the dma_engine is working with while a channel is running. Consequently, to get the remaining transfer bytes, a software-saved initial value of NBYTES (for example copied before enabling the channel) is needed. The formula to calculate it is shown below: RemainingBytes = RemainingMajorLoopCount * NBYTES(initially configured)
brief Gets the remaining major loop count from the eDMA current channel TCD.
This function checks the TCD (Task Control Descriptor) status for a specified eDMA channel and returns the number of major loop count that has not finished.
param base eDMA peripheral base address. param channel eDMA channel number. return Major loop count which has not been transferred yet for the current TCD. note 1. This function can only be used to get unfinished major loop count of transfer without the next TCD, or it might be inaccuracy. 2. The unfinished/remaining transfer bytes cannot be obtained directly from registers while the channel is running. Because to calculate the remaining bytes, the initial NBYTES configured in DMA_TCDn_NBYTES_MLNO register is needed while the eDMA IP does not support getting it while a channel is active. In another word, the NBYTES value reading is always the actual (decrementing) NBYTES value the dma_engine is working with while a channel is running. Consequently, to get the remaining transfer bytes, a software-saved initial value of NBYTES (for example copied before enabling the channel) is needed. The formula to calculate it is shown below: RemainingBytes = RemainingMajorLoopCount * NBYTES(initially configured)
Definition at line 648 of file fsl_edma.c.
| static uint32_t EDMA_GetUnusedTCDNumber | ( | edma_handle_t * | handle ) | [static] |
Get unused TCD slot number.
This function gets current tcd index which is run. If the TCD pool pointer is NULL, it will return 0.
- Parameters:
-
handle DMA handle pointer.
- Returns:
- The unused tcd slot number.
Definition at line 875 of file fsl_edma.h.
| void EDMA_HandleIRQ | ( | edma_handle_t * | handle ) |
eDMA IRQ handler for the current major loop transfer completion.
This function clears the channel major interrupt flag and calls the callback function if it is not NULL.
Note: For the case using TCD queue, when the major iteration count is exhausted, additional operations are performed. These include the final address adjustments and reloading of the BITER field into the CITER. Assertion of an optional interrupt request also occurs at this time, as does a possible fetch of a new TCD from memory using the scatter/gather address pointer included in the descriptor (if scatter/gather is enabled).
For instance, when the time interrupt of TCD[0] happens, the TCD[1] has already been loaded into the eDMA engine. As sga and sga_index are calculated based on the DLAST_SGA bitfield lies in the TCD_CSR register, the sga_index in this case should be 2 (DLAST_SGA of TCD[1] stores the address of TCD[2]). Thus, the "tcdUsed" updated should be (tcdUsed - 2U) which indicates the number of TCDs can be loaded in the memory pool (because TCD[0] and TCD[1] have been loaded into the eDMA engine at this point already.).
For the last two continuous ISRs in a scatter/gather process, they both load the last TCD (The last ISR does not load a new TCD) from the memory pool to the eDMA engine when major loop completes. Therefore, ensure that the header and tcdUsed updated are identical for them. tcdUsed are both 0 in this case as no TCD to be loaded.
See the "eDMA basic data flow" in the eDMA Functional description section of the Reference Manual for further details.
- Parameters:
-
handle eDMA handle pointer.
brief eDMA IRQ handler for the current major loop transfer completion.
This function clears the channel major interrupt flag and calls the callback function if it is not NULL.
Note: For the case using TCD queue, when the major iteration count is exhausted, additional operations are performed. These include the final address adjustments and reloading of the BITER field into the CITER. Assertion of an optional interrupt request also occurs at this time, as does a possible fetch of a new TCD from memory using the scatter/gather address pointer included in the descriptor (if scatter/gather is enabled).
For instance, when the time interrupt of TCD[0] happens, the TCD[1] has already been loaded into the eDMA engine. As sga and sga_index are calculated based on the DLAST_SGA bitfield lies in the TCD_CSR register, the sga_index in this case should be 2 (DLAST_SGA of TCD[1] stores the address of TCD[2]). Thus, the "tcdUsed" updated should be (tcdUsed - 2U) which indicates the number of TCDs can be loaded in the memory pool (because TCD[0] and TCD[1] have been loaded into the eDMA engine at this point already.).
For the last two continuous ISRs in a scatter/gather process, they both load the last TCD (The last ISR does not load a new TCD) from the memory pool to the eDMA engine when major loop completes. Therefore, ensure that the header and tcdUsed updated are identical for them. tcdUsed are both 0 in this case as no TCD to be loaded.
See the "eDMA basic data flow" in the eDMA Functional description section of the Reference Manual for further details.
param handle eDMA handle pointer.
Definition at line 1213 of file fsl_edma.c.
| void EDMA_Init | ( | DMA_Type * | base, |
| const edma_config_t * | config | ||
| ) |
Initializes the eDMA peripheral.
This function ungates the eDMA clock and configures the eDMA peripheral according to the configuration structure.
- Parameters:
-
base eDMA peripheral base address. config A pointer to the configuration structure, see "edma_config_t".
- Note:
- This function enables the minor loop map feature.
brief Initializes the eDMA peripheral.
This function ungates the eDMA clock and configures the eDMA peripheral according to the configuration structure.
param base eDMA peripheral base address. param config A pointer to the configuration structure, see "edma_config_t". note This function enables the minor loop map feature.
Definition at line 113 of file fsl_edma.c.
| void EDMA_InstallTCD | ( | DMA_Type * | base, |
| uint32_t | channel, | ||
| edma_tcd_t * | tcd | ||
| ) |
Push content of TCD structure into hardware TCD register.
- Parameters:
-
base EDMA peripheral base address. channel EDMA channel number. tcd Point to TCD structure.
brief Push content of TCD structure into hardware TCD register.
param base EDMA peripheral base address. param channel EDMA channel number. param tcd Point to TCD structure.
Definition at line 81 of file fsl_edma.c.
| void EDMA_InstallTCDMemory | ( | edma_handle_t * | handle, |
| edma_tcd_t * | tcdPool, | ||
| uint32_t | tcdSize | ||
| ) |
Installs the TCDs memory pool into the eDMA handle.
This function is called after the EDMA_CreateHandle to use scatter/gather feature. This function shall only be used while users need to use scatter gather mode. Scatter gather mode enables EDMA to load a new transfer control block (tcd) in hardware, and automatically reconfigure that DMA channel for a new transfer. Users need to prepare tcd memory and also configure tcds using interface EDMA_SubmitTransfer.
- Parameters:
-
handle eDMA handle pointer. tcdPool A memory pool to store TCDs. It must be 32 bytes aligned. tcdSize The number of TCD slots.
brief Installs the TCDs memory pool into the eDMA handle.
This function is called after the EDMA_CreateHandle to use scatter/gather feature. This function shall only be used while users need to use scatter gather mode. Scatter gather mode enables EDMA to load a new transfer control block (tcd) in hardware, and automatically reconfigure that DMA channel for a new transfer. Users need to prepare tcd memory and also configure tcds using interface EDMA_SubmitTransfer.
param handle eDMA handle pointer. param tcdPool A memory pool to store TCDs. It must be 32 bytes aligned. param tcdSize The number of TCD slots.
Definition at line 812 of file fsl_edma.c.
| 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.
This function prepares the transfer configuration structure according to the user input.
- Parameters:
-
config The user configuration structure of type edma_transfer_t. srcAddr eDMA transfer source address. srcWidth eDMA transfer source address width(bytes). destAddr eDMA transfer destination address. destWidth eDMA transfer destination address width(bytes). bytesEachRequest eDMA transfer bytes per channel request. transferBytes eDMA transfer bytes to be transferred. type eDMA transfer type.
- Note:
- The data address and the data width must be consistent. For example, if the SRC is 4 bytes, the source address must be 4 bytes aligned, or it results in source address error (SAE).
brief Prepares the eDMA transfer structure.
This function prepares the transfer configuration structure according to the user input.
param config The user configuration structure of type edma_transfer_t. param srcAddr eDMA transfer source address. param srcWidth eDMA transfer source address width(bytes). param destAddr eDMA transfer destination address. param destWidth eDMA transfer destination address width(bytes). param bytesEachRequest eDMA transfer bytes per channel request. param transferBytes eDMA transfer bytes to be transferred. param type eDMA transfer type. note The data address and the data width must be consistent. For example, if the SRC is 4 bytes, the source address must be 4 bytes aligned, or it results in source address error (SAE).
Definition at line 861 of file fsl_edma.c.
| void EDMA_ResetChannel | ( | DMA_Type * | base, |
| uint32_t | channel | ||
| ) |
Sets all TCD registers to default values.
This function sets TCD registers for this channel to default values.
- Parameters:
-
base eDMA peripheral base address. channel eDMA channel number.
- Note:
- This function must not be called while the channel transfer is ongoing or it causes unpredictable results.
- This function enables the auto stop request feature.
brief Sets all TCD registers to default values.
This function sets TCD registers for this channel to default values.
param base eDMA peripheral base address. param channel eDMA channel number. note This function must not be called while the channel transfer is ongoing or it causes unpredictable results. note This function enables the auto stop request feature.
Definition at line 189 of file fsl_edma.c.
| void EDMA_SetBandWidth | ( | DMA_Type * | base, |
| uint32_t | channel, | ||
| edma_bandwidth_t | bandWidth | ||
| ) |
Sets the bandwidth for the eDMA transfer.
Because the eDMA processes the minor loop, it continuously generates read/write sequences until the minor count is exhausted. The bandwidth 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:
-
base eDMA peripheral base address. channel eDMA channel number. bandWidth A bandwidth setting, which can be one of the following: - kEDMABandwidthStallNone
- kEDMABandwidthStall4Cycle
- kEDMABandwidthStall8Cycle
brief Sets the bandwidth for the eDMA transfer.
Because the eDMA processes the minor loop, it continuously generates read/write sequences until the minor count is exhausted. The bandwidth forces the eDMA to stall after the completion of each read/write access to control the bus request bandwidth seen by the crossbar switch.
param base eDMA peripheral base address. param channel eDMA channel number. param bandWidth A bandwidth setting, which can be one of the following: arg kEDMABandwidthStallNone arg kEDMABandwidthStall4Cycle arg kEDMABandwidthStall8Cycle
Definition at line 293 of file fsl_edma.c.
| void EDMA_SetCallback | ( | edma_handle_t * | handle, |
| edma_callback | callback, | ||
| void * | userData | ||
| ) |
Installs a callback function for the eDMA transfer.
This callback is called in the eDMA IRQ handler. Use the callback to do something after the current major loop transfer completes. This function will be called every time one tcd finished transfer.
- Parameters:
-
handle eDMA handle pointer. callback eDMA callback function pointer. userData A parameter for the callback function.
brief Installs a callback function for the eDMA transfer.
This callback is called in the eDMA IRQ handler. Use the callback to do something after the current major loop transfer completes. This function will be called every time one tcd finished transfer.
param handle eDMA handle pointer. param callback eDMA callback function pointer. param userData A parameter for the callback function.
Definition at line 836 of file fsl_edma.c.
| 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.
This function configures either the minor link or the major link mode. The minor link means that the channel link is triggered every time CITER decreases by 1. The major link means that the channel link is triggered when the CITER is exhausted.
- Parameters:
-
base eDMA peripheral base address. channel eDMA channel number. type A channel link type, which can be one of the following: - kEDMA_LinkNone
- kEDMA_MinorLink
- kEDMA_MajorLink
linkedChannel The linked channel number.
- Note:
- Users should ensure that DONE flag is cleared before calling this interface, or the configuration is invalid.
brief Sets the channel link for the eDMA transfer.
This function configures either the minor link or the major link mode. The minor link means that the channel link is triggered every time CITER decreases by 1. The major link means that the channel link is triggered when the CITER is exhausted.
param base eDMA peripheral base address. param channel eDMA channel number. param type A channel link type, which can be one of the following: arg kEDMA_LinkNone arg kEDMA_MinorLink arg kEDMA_MajorLink param linkedChannel The linked channel number. note Users should ensure that DONE flag is cleared before calling this interface, or the configuration is invalid.
Definition at line 271 of file fsl_edma.c.
| static void EDMA_SetChannelPreemptionConfig | ( | DMA_Type * | base, |
| uint32_t | channel, | ||
| const edma_channel_Preemption_config_t * | config | ||
| ) | [static] |
Configures the eDMA channel preemption feature.
This function configures the channel preemption attribute and the priority of the channel.
- Parameters:
-
base eDMA peripheral base address. channel eDMA channel number config A pointer to the channel preemption configuration structure.
Definition at line 388 of file fsl_edma.h.
| void EDMA_SetMinorOffsetConfig | ( | DMA_Type * | base, |
| uint32_t | channel, | ||
| const edma_minor_offset_config_t * | config | ||
| ) |
Configures the eDMA minor offset feature.
The minor offset means that the signed-extended value is added to the source address or destination address after each minor loop.
- Parameters:
-
base eDMA peripheral base address. channel eDMA channel number. config A pointer to the minor offset configuration structure.
brief Configures the eDMA minor offset feature.
The minor offset means that the signed-extended value is added to the source address or destination address after each minor loop.
param base eDMA peripheral base address. param channel eDMA channel number. param config A pointer to the minor offset configuration structure.
Definition at line 240 of file fsl_edma.c.
| 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.
This function defines a specific address range specified to be the value after (SADDR + SOFF)/(DADDR + DOFF) calculation is performed or the original register value. It provides the ability to implement a circular data queue easily.
- Parameters:
-
base eDMA peripheral base address. channel eDMA channel number. srcModulo A source modulo value. destModulo A destination modulo value.
brief Sets the source modulo and the destination modulo for the eDMA transfer.
This function defines a specific address range specified to be the value after (SADDR + SOFF)/(DADDR + DOFF) calculation is performed or the original register value. It provides the ability to implement a circular data queue easily.
param base eDMA peripheral base address. param channel eDMA channel number. param srcModulo A source modulo value. param destModulo A destination modulo value.
Definition at line 312 of file fsl_edma.c.
| void EDMA_SetTransferConfig | ( | DMA_Type * | base, |
| uint32_t | channel, | ||
| const edma_transfer_config_t * | config, | ||
| edma_tcd_t * | nextTcd | ||
| ) |
Configures the eDMA transfer attribute.
This function configures the transfer attribute, including source address, destination address, transfer size, address offset, and so on. It also configures the scatter gather feature if the user supplies the TCD address. Example:
edma_transfer_t config; edma_tcd_t tcd; config.srcAddr = ..; config.destAddr = ..; ... EDMA_SetTransferConfig(DMA0, channel, &config, &stcd);
- Parameters:
-
base eDMA peripheral base address. channel eDMA channel number. config Pointer to eDMA transfer configuration structure. nextTcd Point to TCD structure. It can be NULL if users do not want to enable scatter/gather feature.
- Note:
- If nextTcd is not NULL, it means scatter gather feature is enabled and DREQ bit is cleared in the previous transfer configuration, which is set in the eDMA_ResetChannel.
brief Configures the eDMA transfer attribute.
This function configures the transfer attribute, including source address, destination address, transfer size, address offset, and so on. It also configures the scatter gather feature if the user supplies the TCD address. Example: code edma_transfer_t config; edma_tcd_t tcd; config.srcAddr = ..; config.destAddr = ..; ... EDMA_SetTransferConfig(DMA0, channel, &config, &stcd); endcode
param base eDMA peripheral base address. param channel eDMA channel number. param config Pointer to eDMA transfer configuration structure. param nextTcd Point to TCD structure. It can be NULL if users do not want to enable scatter/gather feature. note If nextTcd is not NULL, it means scatter gather feature is enabled and DREQ bit is cleared in the previous transfer configuration, which is set in the eDMA_ResetChannel.
Definition at line 221 of file fsl_edma.c.
| void EDMA_StartTransfer | ( | edma_handle_t * | handle ) |
eDMA starts transfer.
This function enables the channel request. Users can call this function after submitting the transfer request or before submitting the transfer request.
- Parameters:
-
handle eDMA handle pointer.
brief eDMA starts transfer.
This function enables the channel request. Users can call this function after submitting the transfer request or before submitting the transfer request.
param handle eDMA handle pointer.
Definition at line 1103 of file fsl_edma.c.
| void EDMA_StopTransfer | ( | edma_handle_t * | handle ) |
eDMA stops transfer.
This function disables the channel request to pause the transfer. Users can call EDMA_StartTransfer() again to resume the transfer.
- Parameters:
-
handle eDMA handle pointer.
brief eDMA stops transfer.
This function disables the channel request to pause the transfer. Users can call EDMA_StartTransfer() again to resume the transfer.
param handle eDMA handle pointer.
Definition at line 1148 of file fsl_edma.c.
| status_t EDMA_SubmitTransfer | ( | edma_handle_t * | handle, |
| const edma_transfer_config_t * | config | ||
| ) |
Submits the eDMA transfer request.
This function submits the eDMA transfer request according to the transfer configuration structure. In scatter gather mode, call this function will add a configured tcd to the circular list of tcd pool. The tcd pools is setup by call function EDMA_InstallTCDMemory before.
- Parameters:
-
handle eDMA handle pointer. config Pointer to eDMA transfer configuration structure.
- Return values:
-
kStatus_EDMA_Success It means submit transfer request succeed. kStatus_EDMA_QueueFull It means TCD queue is full. Submit transfer request is not allowed. kStatus_EDMA_Busy It means the given channel is busy, need to submit request later.
brief Submits the eDMA transfer request.
This function submits the eDMA transfer request according to the transfer configuration structure. In scatter gather mode, call this function will add a configured tcd to the circular list of tcd pool. The tcd pools is setup by call function EDMA_InstallTCDMemory before.
param handle eDMA handle pointer. param config Pointer to eDMA transfer configuration structure. retval kStatus_EDMA_Success It means submit transfer request succeed. retval kStatus_EDMA_QueueFull It means TCD queue is full. Submit transfer request is not allowed. retval kStatus_EDMA_Busy It means the given channel is busy, need to submit request later.
Definition at line 956 of file fsl_edma.c.
| void EDMA_TcdDisableInterrupts | ( | edma_tcd_t * | tcd, |
| uint32_t | mask | ||
| ) |
Disables the interrupt source for the eDMA TCD.
- Parameters:
-
tcd Point to the TCD structure. mask The mask of interrupt source to be set. Users need to use the defined edma_interrupt_enable_t type.
brief Disables the interrupt source for the eDMA TCD.
param tcd Point to the TCD structure. param mask The mask of interrupt source to be set. Users need to use the defined edma_interrupt_enable_t type.
Definition at line 610 of file fsl_edma.c.
| static void EDMA_TcdEnableAutoStopRequest | ( | edma_tcd_t * | tcd, |
| bool | enable | ||
| ) | [static] |
Sets the auto stop request for the eDMA TCD.
If enabling the auto stop request, the eDMA hardware automatically disables the hardware channel request.
- Parameters:
-
tcd A pointer to the TCD structure. enable The command to enable (true) or disable (false).
Definition at line 614 of file fsl_edma.h.
| void EDMA_TcdEnableInterrupts | ( | edma_tcd_t * | tcd, |
| uint32_t | mask | ||
| ) |
Enables the interrupt source for the eDMA TCD.
- Parameters:
-
tcd Point to the TCD structure. mask The mask of interrupt source to be set. Users need to use the defined edma_interrupt_enable_t type.
brief Enables the interrupt source for the eDMA TCD.
param tcd Point to the TCD structure. param mask The mask of interrupt source to be set. Users need to use the defined edma_interrupt_enable_t type.
Definition at line 586 of file fsl_edma.c.
| void EDMA_TcdReset | ( | edma_tcd_t * | tcd ) |
Sets all fields to default values for the TCD structure.
This function sets all fields for this TCD structure to default value.
- Parameters:
-
tcd Pointer to the TCD structure.
- Note:
- This function enables the auto stop request feature.
brief Sets all fields to default values for the TCD structure.
This function sets all fields for this TCD structure to default value.
param tcd Pointer to the TCD structure. note This function enables the auto stop request feature.
Definition at line 392 of file fsl_edma.c.
| static void EDMA_TcdSetBandWidth | ( | edma_tcd_t * | tcd, |
| edma_bandwidth_t | bandWidth | ||
| ) | [static] |
Sets the bandwidth for the eDMA TCD.
Because the eDMA processes the minor loop, it continuously generates read/write sequences until the minor count is exhausted. The bandwidth 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:
-
tcd A pointer to the TCD structure. bandWidth A bandwidth setting, which can be one of the following: - kEDMABandwidthStallNone
- kEDMABandwidthStall4Cycle
- kEDMABandwidthStall8Cycle
Definition at line 585 of file fsl_edma.h.
| void EDMA_TcdSetChannelLink | ( | edma_tcd_t * | tcd, |
| edma_channel_link_type_t | type, | ||
| uint32_t | linkedChannel | ||
| ) |
Sets the channel link for the eDMA TCD.
This function configures either a minor link or a major link. The minor link means the channel link is triggered every time CITER decreases by 1. The major link means that the channel link is triggered when the CITER is exhausted.
- Note:
- Users should ensure that DONE flag is cleared before calling this interface, or the configuration is invalid.
- Parameters:
-
tcd Point to the TCD structure. type Channel link type, it can be one of: - kEDMA_LinkNone
- kEDMA_MinorLink
- kEDMA_MajorLink
linkedChannel The linked channel number.
brief Sets the channel link for the eDMA TCD.
This function configures either a minor link or a major link. The minor link means the channel link is triggered every time CITER decreases by 1. The major link means that the channel link is triggered when the CITER is exhausted.
note Users should ensure that DONE flag is cleared before calling this interface, or the configuration is invalid. param tcd Point to the TCD structure. param type Channel link type, it can be one of: arg kEDMA_LinkNone arg kEDMA_MinorLink arg kEDMA_MajorLink param linkedChannel The linked channel number.
Definition at line 518 of file fsl_edma.c.
| void EDMA_TcdSetMinorOffsetConfig | ( | edma_tcd_t * | tcd, |
| const edma_minor_offset_config_t * | config | ||
| ) |
Configures the eDMA TCD minor offset feature.
A minor offset is a signed-extended value added to the source address or a destination address after each minor loop.
- Parameters:
-
tcd A point to the TCD structure. config A pointer to the minor offset configuration structure.
brief Configures the eDMA TCD minor offset feature.
A minor offset is a signed-extended value added to the source address or a destination address after each minor loop.
param tcd A point to the TCD structure. param config A pointer to the minor offset configuration structure.
Definition at line 488 of file fsl_edma.c.
| 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.
This function defines a specific address range specified to be the value after (SADDR + SOFF)/(DADDR + DOFF) calculation is performed or the original register value. It provides the ability to implement a circular data queue easily.
- Parameters:
-
tcd A pointer to the TCD structure. srcModulo A source modulo value. destModulo A destination modulo value.
brief Sets the source modulo and the destination modulo for the eDMA TCD.
This function defines a specific address range specified to be the value after (SADDR + SOFF)/(DADDR + DOFF) calculation is performed or the original register value. It provides the ability to implement a circular data queue easily.
param tcd A pointer to the TCD structure. param srcModulo A source modulo value. param destModulo A destination modulo value.
Definition at line 568 of file fsl_edma.c.
| void EDMA_TcdSetTransferConfig | ( | edma_tcd_t * | tcd, |
| const edma_transfer_config_t * | config, | ||
| edma_tcd_t * | nextTcd | ||
| ) |
Configures the eDMA TCD transfer attribute.
The TCD is a transfer control descriptor. The content of the TCD is the same as the hardware TCD registers. The STCD is used in the scatter-gather mode. This function configures the TCD transfer attribute, including source address, destination address, transfer size, address offset, and so on. It also configures the scatter gather feature if the user supplies the next TCD address. Example:
edma_transfer_t config = {
...
}
edma_tcd_t tcd __aligned(32);
edma_tcd_t nextTcd __aligned(32);
EDMA_TcdSetTransferConfig(&tcd, &config, &nextTcd);
- Parameters:
-
tcd Pointer to the TCD structure. config Pointer to eDMA transfer configuration structure. nextTcd Pointer to the next TCD structure. It can be NULL if users do not want to enable scatter/gather feature.
- Note:
- TCD address should be 32 bytes aligned or it causes an eDMA error.
- If the nextTcd is not NULL, the scatter gather feature is enabled and DREQ bit is cleared in the previous transfer configuration, which is set in the EDMA_TcdReset.
brief Configures the eDMA TCD transfer attribute.
The TCD is a transfer control descriptor. The content of the TCD is the same as the hardware TCD registers. The STCD is used in the scatter-gather mode. This function configures the TCD transfer attribute, including source address, destination address, transfer size, address offset, and so on. It also configures the scatter gather feature if the user supplies the next TCD address. Example: code edma_transfer_t config = { ... } edma_tcd_t tcd __aligned(32); edma_tcd_t nextTcd __aligned(32); EDMA_TcdSetTransferConfig(&tcd, &config, &nextTcd); endcode
param tcd Pointer to the TCD structure. param config Pointer to eDMA transfer configuration structure. param nextTcd Pointer to the next TCD structure. It can be NULL if users do not want to enable scatter/gather feature. note TCD address should be 32 bytes aligned or it causes an eDMA error. note If the nextTcd is not NULL, the scatter gather feature is enabled and DREQ bit is cleared in the previous transfer configuration, which is set in the EDMA_TcdReset.
Definition at line 439 of file fsl_edma.c.
| static void EDMA_TriggerChannelStart | ( | DMA_Type * | base, |
| uint32_t | channel | ||
| ) | [static] |
Starts the eDMA transfer by using the software trigger.
This function starts a minor loop transfer.
- Parameters:
-
base eDMA peripheral base address. channel eDMA channel number.
Definition at line 684 of file fsl_edma.h.
Generated on Tue Jul 12 2022 15:37:33 by
1.7.2