edma_driver.c File Reference
#include "edma_irq.h"
#include "clock_manager.h"
#include "interrupt_manager.h"

Go to the source code of this file.

Functions

static status_t EDMA_DRV_RequestChannel (uint8_t virtualChannel, dma_request_source_t reqSrc, edma_chn_state_t *reqChn)
 
static void EDMA_DRV_ClearIntStatus (uint8_t virtualChannel)
 
static void EDMA_DRV_ClearSoftwareTCD (edma_software_tcd_t *stcd)
 
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[], uint32_t chnCount)
 Initializes the eDMA module. More...
 
status_t EDMA_DRV_Deinit (void)
 De-initializes the eDMA module. More...
 
status_t EDMA_DRV_ChannelInit (edma_chn_state_t *edmaChannelState, const edma_channel_config_t *edmaChannelConfig)
 Initializes an eDMA channel. More...
 
status_t EDMA_DRV_InstallCallback (uint8_t virtualChannel, edma_callback_t callback, void *parameter)
 Registers the callback function and the parameter for eDMA channel. More...
 
status_t EDMA_DRV_ReleaseChannel (uint8_t virtualChannel)
 Releases an eDMA channel. More...
 
void EDMA_DRV_IRQHandler (uint8_t virtualChannel)
 DMA channel interrupt handler, implemented in driver c file. More...
 
void EDMA_DRV_ErrorIRQHandler (uint8_t virtualChannel)
 
status_t EDMA_DRV_ConfigSingleBlockTransfer (uint8_t virtualChannel, 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. More...
 
status_t EDMA_DRV_ConfigMultiBlockTransfer (uint8_t virtualChannel, 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. More...
 
status_t EDMA_DRV_ConfigLoopTransfer (uint8_t virtualChannel, const edma_transfer_config_t *transferConfig)
 Configures the DMA transfer in loop mode. More...
 
status_t EDMA_DRV_ConfigScatterGatherTransfer (uint8_t virtualChannel, 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. More...
 
status_t EDMA_DRV_StartChannel (uint8_t virtualChannel)
 Starts an eDMA channel. More...
 
status_t EDMA_DRV_StopChannel (uint8_t virtualChannel)
 Stops the eDMA channel. More...
 
status_t EDMA_DRV_SetChannelRequest (uint8_t virtualChannel, uint8_t req)
 Configures the DMA request for the eDMA channel. More...
 
void EDMA_DRV_ClearTCD (uint8_t virtualChannel)
 Clears all registers to 0 for the channel's TCD. More...
 
void EDMA_DRV_SetSrcAddr (uint8_t virtualChannel, uint32_t address)
 Configures the source address for the eDMA channel. More...
 
void EDMA_DRV_SetSrcOffset (uint8_t virtualChannel, int16_t offset)
 Configures the source address signed offset for the eDMA channel. More...
 
void EDMA_DRV_SetSrcReadChunkSize (uint8_t virtualChannel, edma_transfer_size_t size)
 Configures the source data chunk size (transferred in a read sequence). More...
 
void EDMA_DRV_SetSrcLastAddrAdjustment (uint8_t virtualChannel, int32_t adjust)
 Configures the source address last adjustment. More...
 
void EDMA_DRV_SetDestLastAddrAdjustment (uint8_t virtualChannel, int32_t adjust)
 Configures the destination address last adjustment. More...
 
void EDMA_DRV_SetDestAddr (uint8_t virtualChannel, uint32_t address)
 Configures the destination address for the eDMA channel. More...
 
void EDMA_DRV_SetDestOffset (uint8_t virtualChannel, int16_t offset)
 Configures the destination address signed offset for the eDMA channel. More...
 
void EDMA_DRV_SetDestWriteChunkSize (uint8_t virtualChannel, edma_transfer_size_t size)
 Configures the destination data chunk size (transferred in a write sequence). More...
 
void EDMA_DRV_SetMinorLoopBlockSize (uint8_t virtualChannel, uint32_t nbytes)
 Configures the number of bytes to be transferred in each service request of the channel. More...
 
void EDMA_DRV_SetMajorLoopIterationCount (uint8_t virtualChannel, uint32_t majorLoopCount)
 Configures the number of major loop iterations. More...
 
uint32_t EDMA_DRV_GetRemainingMajorIterationsCount (uint8_t virtualChannel)
 Returns the remaining major loop iteration count. More...
 
void EDMA_DRV_SetScatterGatherLink (uint8_t virtualChannel, uint32_t nextTCDAddr)
 Configures the memory address of the next TCD, in scatter/gather mode. More...
 
void EDMA_DRV_DisableRequestsOnTransferComplete (uint8_t virtualChannel, bool disable)
 Disables/Enables the DMA request after the major loop completes for the TCD. More...
 
void EDMA_DRV_ConfigureInterrupt (uint8_t virtualChannel, edma_channel_interrupt_t intSrc, bool enable)
 Disables/Enables the channel interrupt requests. More...
 
void EDMA_DRV_CancelTransfer (bool error)
 Cancel the running transfer. More...
 
void EDMA_DRV_TriggerSwRequest (uint8_t virtualChannel)
 Triggers a sw request for the current channel. More...
 
void EDMA_DRV_PushConfigToSTCD (const edma_transfer_config_t *config, edma_software_tcd_t *stcd)
 Copies the channel configuration to the software TCD structure. More...
 
void EDMA_DRV_PushConfigToReg (uint8_t virtualChannel, const edma_transfer_config_t *tcd)
 Copies the channel configuration to the TCD registers. More...
 
edma_chn_status_t EDMA_DRV_GetChannelStatus (uint8_t virtualChannel)
 Gets the eDMA channel status. More...
 
DMA_TypeEDMA_DRV_GetDmaRegBaseAddr (uint32_t instance)
 

Variables

static DMA_Type *const s_edmaBase [DMA_INSTANCE_COUNT] = DMA_BASE_PTRS
 Array of base addresses for DMA instances. More...
 
static DMAMUX_Type *const s_dmaMuxBase [DMAMUX_INSTANCE_COUNT] = DMAMUX_BASE_PTRS
 Array of base addresses for DMAMUX instances. More...
 
static const IRQn_Type s_edmaIrqId [FEATURE_DMA_VIRTUAL_CHANNELS_INTERRUPT_LINES] = DMA_CHN_IRQS
 Array of default DMA channel interrupt handlers. More...
 
static edma_state_ts_virtEdmaState
 Array of default DMA error interrupt handlers. More...
 

Function Documentation

static void EDMA_DRV_ClearIntStatus ( uint8_t  virtualChannel)
static

Definition at line 467 of file edma_driver.c.

static void EDMA_DRV_ClearSoftwareTCD ( edma_software_tcd_t stcd)
static

Definition at line 486 of file edma_driver.c.

void EDMA_DRV_ErrorIRQHandler ( uint8_t  virtualChannel)

Definition at line 523 of file edma_driver.c.

DMA_Type* EDMA_DRV_GetDmaRegBaseAddr ( uint32_t  instance)

Definition at line 1731 of file edma_driver.c.

void EDMA_DRV_IRQHandler ( uint8_t  virtualChannel)

DMA channel interrupt handler, implemented in driver c file.

Definition at line 503 of file edma_driver.c.

static status_t EDMA_DRV_RequestChannel ( uint8_t  virtualChannel,
dma_request_source_t  reqSrc,
edma_chn_state_t reqChn 
)
static

Definition at line 358 of file edma_driver.c.

Variable Documentation

DMAMUX_Type* const s_dmaMuxBase[DMAMUX_INSTANCE_COUNT] = DMAMUX_BASE_PTRS
static

Array of base addresses for DMAMUX instances.

Definition at line 77 of file edma_driver.c.

DMA_Type* const s_edmaBase[DMA_INSTANCE_COUNT] = DMA_BASE_PTRS
static

Array of base addresses for DMA instances.

Definition at line 74 of file edma_driver.c.

Array of default DMA channel interrupt handlers.

Definition at line 80 of file edma_driver.c.

edma_state_t* s_virtEdmaState
static

Array of default DMA error interrupt handlers.

EDMA global structure to maintain eDMA state

Definition at line 95 of file edma_driver.c.