35 #if !defined(EDMA_DRIVER_H)
58 #define STCD_SIZE(number) (((number) * 32U) - 1U)
59 #define STCD_ADDR(address) (((uint32_t)address + 31UL) & ~0x1FUL)
67 #define EDMA_ERR_LSB_MASK 1U
109 #if FEATURE_EDMA_CHANNEL_GROUP_COUNT > 0x1U
114 EDMA_GRP0_PRIO_LOW_GRP1_PRIO_HIGH = 0U,
115 EDMA_GRP0_PRIO_HIGH_GRP1_PRIO_LOW = 1U
116 } edma_group_priority_t;
177 #if FEATURE_EDMA_CHANNEL_GROUP_COUNT > 0x1U
179 edma_group_priority_t groupPriority;
328 #if (defined(CORE_LITTLE_ENDIAN))
341 } edma_software_tcd_t;
342 #elif (defined(CORE_BIG_ENDIAN))
355 } edma_software_tcd_t;
357 #error "Endianness not defined!"
364 #if defined(__cplusplus)
504 uint32_t srcAddr, uint32_t destAddr,
540 uint32_t srcAddr, uint32_t destAddr,
542 uint32_t blockCount,
bool disableReqOnCompletion);
858 #if defined(__cplusplus)
void EDMA_DRV_PushConfigToSTCD(const edma_transfer_config_t *config, edma_software_tcd_t *stcd)
Copies the channel configuration to the software TCD structure.
edma_arbitration_algorithm_t
eDMA channel arbitration algorithm used for selection among channels. Implements : edma_arbitration_a...
void EDMA_DRV_SetDestLastAddrAdjustment(uint8_t channel, int32_t adjust)
Configures the destination address last adjustment.
edma_modulo_t
eDMA modulo configuration Implements : edma_modulo_t_Class
uint32_t minorByteTransferCount
void EDMA_DRV_SetSrcReadChunkSize(uint8_t channel, edma_transfer_size_t size)
Configures the source data chunk size (transferred in a read sequence).
uint32_t EDMA_DRV_GetRemainingMajorIterationsCount(uint8_t channel)
Returns the remaining major loop iteration count.
uint8_t minorLoopChnLinkNumber
The user configuration structure for the eDMA driver.
edma_transfer_type_t
A type for the DMA transfer. Implements : edma_transfer_type_t_Class.
The user configuration structure for the an eDMA driver channel.
status_t EDMA_DRV_ReleaseChannel(uint8_t channel)
Releases an eDMA channel.
status_t EDMA_DRV_StopChannel(uint8_t channel)
Stops the eDMA channel.
uint8_t majorLoopChnLinkNumber
void EDMA_DRV_SetDestOffset(uint8_t channel, int16_t offset)
Configures the destination address signed offset for the eDMA channel.
status_t EDMA_DRV_Deinit(void)
De-initializes the eDMA module.
status_t EDMA_DRV_Init(edma_state_t *edmaState, const edma_user_config_t *userConfig, edma_chn_state_t *const chnStateArray[], const edma_channel_config_t *const chnConfigArray[], uint8_t chnCount)
Initializes the eDMA module.
edma_channel_priority_t priority
void EDMA_DRV_SetMinorLoopBlockSize(uint8_t channel, uint32_t nbytes)
Configures the number of bytes to be transferred in each service request of the channel.
status_t EDMA_DRV_SetChannelRequest(uint8_t channel, uint8_t req)
Configures the DMA request for the eDMA channel.
dma_request_source_t
Structure for the DMA hardware request.
void EDMA_DRV_DisableRequestsOnTransferComplete(uint8_t channel, bool disable)
Disables/Enables the DMA request after the major loop completes for the TCD.
void EDMA_DRV_SetSrcLastAddrAdjustment(uint8_t channel, int32_t adjust)
Configures the source address last adjustment.
void EDMA_DRV_SetScatterGatherLink(uint8_t channel, uint32_t nextTCDAddr)
Configures the memory address of the next TCD, in scatter/gather mode.
edma_channel_interrupt_t
eDMA channel interrupts. Implements : edma_channel_interrupt_t_Class
uint32_t scatterGatherNextDescAddr
status_t EDMA_DRV_ConfigLoopTransfer(uint8_t channel, const edma_transfer_config_t *transferConfig)
Configures the DMA transfer in loop mode.
status_t EDMA_DRV_ChannelInit(edma_chn_state_t *edmaChannelState, const edma_channel_config_t *edmaChannelConfig)
Initializes an eDMA channel.
Runtime state structure for the eDMA driver.
edma_chn_status_t
Channel status for eDMA channel.
edma_transfer_size_t destTransferSize
bool majorLoopChnLinkEnable
int32_t srcLastAddrAdjust
edma_transfer_size_t
eDMA transfer configuration Implements : edma_transfer_size_t_Class
void EDMA_DRV_PushConfigToReg(uint8_t channel, const edma_transfer_config_t *tcd)
Copies the channel configuration to the TCD registers.
void EDMA_DRV_SetSrcAddr(uint8_t channel, uint32_t address)
Configures the source address for the eDMA channel.
edma_channel_priority_t
eDMA channel priority setting Implements : edma_channel_priority_t_Class
edma_arbitration_algorithm_t chnArbitration
uint32_t majorLoopIterationCount
status_t
Status return codes. Common error codes will be a unified enumeration (C enum) that will contain all ...
status_t EDMA_DRV_ConfigScatterGatherTransfer(uint8_t channel, edma_software_tcd_t *stcd, edma_transfer_size_t transferSize, uint32_t bytesOnEachRequest, const edma_scatter_gather_list_t *srcList, const edma_scatter_gather_list_t *destList, uint8_t tcdCount)
Configures the DMA transfer in a scatter-gather mode.
edma_transfer_size_t srcTransferSize
Data structure for configuring a discrete memory transfer. Implements : edma_scatter_gather_list_t_Cl...
void EDMA_DRV_SetMajorLoopIterationCount(uint8_t channel, uint32_t majorLoopCount)
Configures the number of major loop iterations.
volatile edma_chn_status_t status
void EDMA_DRV_SetDestAddr(uint8_t channel, uint32_t address)
Configures the destination address for the eDMA channel.
edma_chn_status_t EDMA_DRV_GetChannelStatus(uint8_t channel)
Gets the eDMA channel status.
edma_transfer_type_t type
void EDMA_DRV_SetDestWriteChunkSize(uint8_t channel, edma_transfer_size_t size)
Configures the destination data chunk size (transferred in a write sequence).
status_t EDMA_DRV_StartChannel(uint8_t channel)
Starts an eDMA channel.
void EDMA_DRV_SetSrcOffset(uint8_t channel, int16_t offset)
Configures the source address signed offset for the eDMA channel.
void EDMA_DRV_TriggerSwRequest(uint8_t channel)
Triggers a sw request for the current channel.
void EDMA_DRV_ClearTCD(uint8_t channel)
Clears all registers to 0 for the channel's TCD.
int32_t destLastAddrAdjust
void EDMA_DRV_CancelTransfer(bool error)
Cancel the running transfer.
bool minorLoopChnLinkEnable
void(* edma_callback_t)(void *parameter, edma_chn_status_t status)
Definition for the eDMA channel callback function.
dma_request_source_t source
status_t EDMA_DRV_ConfigSingleBlockTransfer(uint8_t channel, edma_transfer_type_t type, uint32_t srcAddr, uint32_t destAddr, edma_transfer_size_t transferSize, uint32_t dataBufferSize)
Configures a simple single block data transfer with DMA.
eDMA loop transfer configuration.
void EDMA_DRV_ConfigureInterrupt(uint8_t channel, edma_channel_interrupt_t intSrc, bool enable)
Disables/Enables the channel interrupt requests.
eDMA transfer size configuration.
edma_loop_transfer_config_t * loopTransferConfig
status_t EDMA_DRV_ConfigMultiBlockTransfer(uint8_t channel, edma_transfer_type_t type, uint32_t srcAddr, uint32_t destAddr, edma_transfer_size_t transferSize, uint32_t blockSize, uint32_t blockCount, bool disableReqOnCompletion)
Configures a multiple block data transfer with DMA.
status_t EDMA_DRV_InstallCallback(uint8_t channel, edma_callback_t callback, void *parameter)
Registers the callback function and the parameter for eDMA channel.
#define FEATURE_EDMA_MODULE_CHANNELS
Data structure for the eDMA channel state. Implements : edma_chn_state_t_Class.