rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Data Structures
fsl_edma.h File Reference

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

Functions

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.
 

Driver version

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

Go to the source code of this file.