fsl_edma.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015, Freescale Semiconductor, Inc.
3  * Copyright 2016-2019 NXP
4  * All rights reserved.
5  *
6  * SPDX-License-Identifier: BSD-3-Clause
7  */
8 
9 #ifndef _FSL_EDMA_H_
10 #define _FSL_EDMA_H_
11 
12 #include "fsl_common.h"
13 
19 /*******************************************************************************
20  * Definitions
21  ******************************************************************************/
22 
26 #define FSL_EDMA_DRIVER_VERSION (MAKE_VERSION(2, 3, 2))
28 
29 
30 #define DMA_DCHPRI_INDEX(channel) (((channel) & ~0x03U) | (3U - ((channel)&0x03U)))
31 
33 typedef enum _edma_transfer_size
34 {
42 
44 typedef enum _edma_modulo
45 {
79 
81 typedef enum _edma_bandwidth
82 {
87 
90 {
91  kEDMA_LinkNone = 0x0U,
95 
97 enum
98 {
99  kEDMA_DoneFlag = 0x1U,
102 };
103 
105 enum
106 {
118 #if defined(FSL_FEATURE_EDMA_CHANNEL_GROUP_COUNT) && (FSL_FEATURE_EDMA_CHANNEL_GROUP_COUNT > 1)
119  kEDMA_GroupPriorityErrorFlag = DMA_ES_GPE_MASK,
120 #endif
122 };
123 
126 {
131 
134 {
140 
142 enum
143 {
147 };
148 
150 typedef struct _edma_config
151 {
161 } edma_config_t;
162 
168 typedef struct _edma_transfer_config
169 {
170  uint32_t srcAddr;
171  uint32_t destAddr;
174  int16_t srcOffset;
176  int16_t destOffset;
178  uint32_t minorLoopBytes;
179  uint32_t majorLoopCounts;
181 
184 {
187  uint8_t channelPriority;
189 
192 {
195  uint32_t minorOffset;
197 
204 typedef struct _edma_tcd
205 {
206  __IO uint32_t SADDR;
207  __IO uint16_t SOFF;
208  __IO uint16_t ATTR;
209  __IO uint32_t NBYTES;
210  __IO uint32_t SLAST;
211  __IO uint32_t DADDR;
212  __IO uint16_t DOFF;
213  __IO uint16_t CITER;
214  __IO uint32_t DLAST_SGA;
215  __IO uint16_t CSR;
216  __IO uint16_t BITER;
217 } edma_tcd_t;
218 
220 struct _edma_handle;
221 
240 typedef void (*edma_callback)(struct _edma_handle *handle, void *userData, bool transferDone, uint32_t tcds);
241 
243 typedef struct _edma_handle
244 {
246  void *userData;
249  uint8_t channel;
250  volatile int8_t header;
251  volatile int8_t tail;
252  volatile int8_t tcdUsed;
254  volatile int8_t tcdSize;
255  uint8_t flags;
256 } edma_handle_t;
257 
258 /*******************************************************************************
259  * APIs
260  ******************************************************************************/
261 #if defined(__cplusplus)
262 extern "C" {
263 #endif /* __cplusplus */
264 
280 void EDMA_Init(DMA_Type *base, const edma_config_t *config);
281 
289 void EDMA_Deinit(DMA_Type *base);
290 
298 void EDMA_InstallTCD(DMA_Type *base, uint32_t channel, edma_tcd_t *tcd);
299 
315 
316 /* @} */
333 void EDMA_ResetChannel(DMA_Type *base, uint32_t channel);
334 
361  uint32_t channel,
363  edma_tcd_t *nextTcd);
364 
375 void EDMA_SetMinorOffsetConfig(DMA_Type *base, uint32_t channel, const edma_minor_offset_config_t *config);
376 
387 
404 void EDMA_SetChannelLink(DMA_Type *base, uint32_t channel, edma_channel_link_type_t type, uint32_t linkedChannel);
405 
420 void EDMA_SetBandWidth(DMA_Type *base, uint32_t channel, edma_bandwidth_t bandWidth);
421 
434 void EDMA_SetModulo(DMA_Type *base, uint32_t channel, edma_modulo_t srcModulo, edma_modulo_t destModulo);
435 
436 #if defined(FSL_FEATURE_EDMA_ASYNCHRO_REQUEST_CHANNEL_COUNT) && FSL_FEATURE_EDMA_ASYNCHRO_REQUEST_CHANNEL_COUNT
437 
444 static inline void EDMA_EnableAsyncRequest(DMA_Type *base, uint32_t channel, bool enable)
445 {
446  assert(channel < (uint32_t)FSL_FEATURE_DMAMUX_MODULE_CHANNEL);
447 
448  base->EARS &= ~((uint32_t)1U << channel);
449  base->EARS |= ((uint32_t)(true == enable ? 1U : 0U) << channel);
450 }
451 #endif /* FSL_FEATURE_EDMA_ASYNCHRO_REQUEST_CHANNEL_COUNT */
452 
462 static inline void EDMA_EnableAutoStopRequest(DMA_Type *base, uint32_t channel, bool enable)
463 {
464  assert(channel < (uint32_t)FSL_FEATURE_DMAMUX_MODULE_CHANNEL);
465 
466  base->TCD[channel].CSR =
467  (uint16_t)((base->TCD[channel].CSR & (~DMA_CSR_DREQ_MASK)) | DMA_CSR_DREQ((true == enable ? 1U : 0U)));
468 }
469 
478 void EDMA_EnableChannelInterrupts(DMA_Type *base, uint32_t channel, uint32_t mask);
479 
488 void EDMA_DisableChannelInterrupts(DMA_Type *base, uint32_t channel, uint32_t mask);
489 
490 /* @} */
504 void EDMA_TcdReset(edma_tcd_t *tcd);
505 
534 
545 
561 void EDMA_TcdSetChannelLink(edma_tcd_t *tcd, edma_channel_link_type_t type, uint32_t linkedChannel);
562 
575 static inline void EDMA_TcdSetBandWidth(edma_tcd_t *tcd, edma_bandwidth_t bandWidth)
576 {
577  assert(tcd != NULL);
578  assert(((uint32_t)tcd & 0x1FU) == 0U);
579 
580  tcd->CSR = (uint16_t)((tcd->CSR & (~DMA_CSR_BWC_MASK)) | DMA_CSR_BWC(bandWidth));
581 }
582 
594 void EDMA_TcdSetModulo(edma_tcd_t *tcd, edma_modulo_t srcModulo, edma_modulo_t destModulo);
595 
604 static inline void EDMA_TcdEnableAutoStopRequest(edma_tcd_t *tcd, bool enable)
605 {
606  assert(tcd != NULL);
607  assert(((uint32_t)tcd & 0x1FU) == 0U);
608 
609  tcd->CSR = (uint16_t)((tcd->CSR & (~DMA_CSR_DREQ_MASK)) | DMA_CSR_DREQ((true == enable ? 1U : 0U)));
610 }
611 
619 void EDMA_TcdEnableInterrupts(edma_tcd_t *tcd, uint32_t mask);
620 
628 void EDMA_TcdDisableInterrupts(edma_tcd_t *tcd, uint32_t mask);
629 
644 static inline void EDMA_EnableChannelRequest(DMA_Type *base, uint32_t channel)
645 {
646  assert(channel < (uint32_t)FSL_FEATURE_DMAMUX_MODULE_CHANNEL);
647 
648  base->SERQ = DMA_SERQ_SERQ(channel);
649 }
650 
659 static inline void EDMA_DisableChannelRequest(DMA_Type *base, uint32_t channel)
660 {
661  assert(channel < (uint32_t)FSL_FEATURE_DMAMUX_MODULE_CHANNEL);
662 
663  base->CERQ = DMA_CERQ_CERQ(channel);
664 }
665 
674 static inline void EDMA_TriggerChannelStart(DMA_Type *base, uint32_t channel)
675 {
676  assert(channel < (uint32_t)FSL_FEATURE_DMAMUX_MODULE_CHANNEL);
677 
678  base->SSRT = DMA_SSRT_SSRT(channel);
679 }
680 
708 uint32_t EDMA_GetRemainingMajorLoopCount(DMA_Type *base, uint32_t channel);
709 
717 static inline uint32_t EDMA_GetErrorStatusFlags(DMA_Type *base)
718 {
719  return base->ES;
720 }
721 
730 uint32_t EDMA_GetChannelStatusFlags(DMA_Type *base, uint32_t channel);
731 
740 void EDMA_ClearChannelStatusFlags(DMA_Type *base, uint32_t channel, uint32_t mask);
741 
758 void EDMA_CreateHandle(edma_handle_t *handle, DMA_Type *base, uint32_t channel);
759 
772 void EDMA_InstallTCDMemory(edma_handle_t *handle, edma_tcd_t *tcdPool, uint32_t tcdSize);
773 
784 void EDMA_SetCallback(edma_handle_t *handle, edma_callback callback, void *userData);
785 
805  void *srcAddr,
806  uint32_t srcWidth,
807  int16_t srcOffset,
808  void *destAddr,
809  uint32_t destWidth,
810  int16_t destOffset,
811  uint32_t bytesEachRequest,
812  uint32_t transferBytes);
813 
832  void *srcAddr,
833  uint32_t srcWidth,
834  void *destAddr,
835  uint32_t destWidth,
836  uint32_t bytesEachRequest,
837  uint32_t transferBytes,
838  edma_transfer_type_t type);
839 
854 
863 void EDMA_StartTransfer(edma_handle_t *handle);
864 
873 void EDMA_StopTransfer(edma_handle_t *handle);
874 
883 void EDMA_AbortTransfer(edma_handle_t *handle);
884 
893 static inline uint32_t EDMA_GetUnusedTCDNumber(edma_handle_t *handle)
894 {
895  int8_t tmpTcdSize = handle->tcdSize;
896  int8_t tmpTcdUsed = handle->tcdUsed;
897  return ((uint32_t)tmpTcdSize - (uint32_t)tmpTcdUsed);
898 }
899 
908 static inline uint32_t EDMA_GetNextTCDAddress(edma_handle_t *handle)
909 {
910  return (handle->base->TCD[handle->channel].DLAST_SGA);
911 }
912 
941 void EDMA_HandleIRQ(edma_handle_t *handle);
942 
943 /* @} */
944 
945 #if defined(__cplusplus)
946 }
947 #endif /* __cplusplus */
948 
949 /* @} */
950 
951 #endif /*_FSL_EDMA_H_*/
kEDMA_SourceAddressErrorFlag
@ kEDMA_SourceAddressErrorFlag
Definition: fsl_edma.h:114
EDMA_TcdSetChannelLink
void EDMA_TcdSetChannelLink(edma_tcd_t *tcd, edma_channel_link_type_t type, uint32_t linkedChannel)
Sets the channel link for the eDMA TCD.
Definition: fsl_edma.c:549
fsl_common.h
__IO
#define __IO
Definition: imxrt1050/imxrt1050-evkb/CMSIS/core_cm7.h:237
EDMA_SetChannelLink
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.
Definition: fsl_edma.c:300
EDMA_ResetChannel
void EDMA_ResetChannel(DMA_Type *base, uint32_t channel)
Sets all TCD registers to default values.
Definition: fsl_edma.c:194
_edma_handle
eDMA transfer handle structure
Definition: fsl_edma.h:243
_edma_tcd::CITER
__IO uint16_t CITER
Definition: fsl_edma.h:213
EDMA_DisableChannelInterrupts
void EDMA_DisableChannelInterrupts(DMA_Type *base, uint32_t channel, uint32_t mask)
Disables the interrupt source for the eDMA transfer.
Definition: fsl_edma.c:390
kEDMA_BandwidthStall8Cycle
@ kEDMA_BandwidthStall8Cycle
Definition: fsl_edma.h:85
_edma_handle::tcdSize
volatile int8_t tcdSize
Definition: fsl_edma.h:254
kEDMA_Modulo16Mbytes
@ kEDMA_Modulo16Mbytes
Definition: fsl_edma.h:70
EDMA_Deinit
void EDMA_Deinit(DMA_Type *base)
Deinitializes the eDMA peripheral.
Definition: fsl_edma.c:148
kEDMA_Modulo2Mbytes
@ kEDMA_Modulo2Mbytes
Definition: fsl_edma.h:67
kEDMA_LinkNone
@ kEDMA_LinkNone
Definition: fsl_edma.h:91
NULL
#define NULL
Definition: porcupine/demo/c/dr_libs/tests/external/miniaudio/extras/speex_resampler/thirdparty/resample.c:92
EDMA_EnableChannelInterrupts
void EDMA_EnableChannelInterrupts(DMA_Type *base, uint32_t channel, uint32_t mask)
Enables the interrupt source for the eDMA transfer.
Definition: fsl_edma.c:359
kEDMA_Modulo32Kbytes
@ kEDMA_Modulo32Kbytes
Definition: fsl_edma.h:61
EDMA_TriggerChannelStart
static void EDMA_TriggerChannelStart(DMA_Type *base, uint32_t channel)
Starts the eDMA transfer by using the software trigger.
Definition: fsl_edma.h:674
edma_minor_offset_config_t
struct _edma_minor_offset_config edma_minor_offset_config_t
eDMA minor offset configuration
_edma_transfer_config::minorLoopBytes
uint32_t minorLoopBytes
Definition: fsl_edma.h:178
kEDMA_DestinationOffsetErrorFlag
@ kEDMA_DestinationOffsetErrorFlag
Definition: fsl_edma.h:111
DMA_ES_DBE_MASK
#define DMA_ES_DBE_MASK
Definition: MIMXRT1052.h:12136
edma_transfer_type_t
enum _edma_transfer_type edma_transfer_type_t
eDMA transfer type
kEDMA_InterruptFlag
@ kEDMA_InterruptFlag
Definition: fsl_edma.h:101
kEDMA_Modulo1Kbytes
@ kEDMA_Modulo1Kbytes
Definition: fsl_edma.h:56
EDMA_TcdEnableAutoStopRequest
static void EDMA_TcdEnableAutoStopRequest(edma_tcd_t *tcd, bool enable)
Sets the auto stop request for the eDMA TCD.
Definition: fsl_edma.h:604
_edma_transfer_config::destTransferSize
edma_transfer_size_t destTransferSize
Definition: fsl_edma.h:173
_edma_tcd::SOFF
__IO uint16_t SOFF
Definition: fsl_edma.h:207
EDMA_InstallTCDMemory
void EDMA_InstallTCDMemory(edma_handle_t *handle, edma_tcd_t *tcdPool, uint32_t tcdSize)
Installs the TCDs memory pool into the eDMA handle.
Definition: fsl_edma.c:843
EDMA_SubmitTransfer
status_t EDMA_SubmitTransfer(edma_handle_t *handle, const edma_transfer_config_t *config)
Submits the eDMA transfer request.
Definition: fsl_edma.c:1040
edma_transfer_size_t
enum _edma_transfer_size edma_transfer_size_t
eDMA transfer configuration
kEDMA_Modulo8Kbytes
@ kEDMA_Modulo8Kbytes
Definition: fsl_edma.h:59
_edma_transfer_config::majorLoopCounts
uint32_t majorLoopCounts
Definition: fsl_edma.h:179
EDMA_GetErrorStatusFlags
static uint32_t EDMA_GetErrorStatusFlags(DMA_Type *base)
Gets the eDMA channel error status flags.
Definition: fsl_edma.h:717
DMA_ES_SGE_MASK
#define DMA_ES_SGE_MASK
Definition: MIMXRT1052.h:12150
kStatusGroup_EDMA
@ kStatusGroup_EDMA
Definition: fsl_common.h:107
kEDMA_Modulo2Gbytes
@ kEDMA_Modulo2Gbytes
Definition: fsl_edma.h:77
edma_channel_Preemption_config_t
struct _edma_channel_Preemption_config edma_channel_Preemption_config_t
eDMA channel priority configuration
kEDMA_TransferSize2Bytes
@ kEDMA_TransferSize2Bytes
Definition: fsl_edma.h:36
_edma_transfer_size
_edma_transfer_size
eDMA transfer configuration
Definition: fsl_edma.h:33
kEDMA_Modulo32bytes
@ kEDMA_Modulo32bytes
Definition: fsl_edma.h:51
_edma_tcd::SADDR
__IO uint32_t SADDR
Definition: fsl_edma.h:206
DMA_ES_NCE_MASK
#define DMA_ES_NCE_MASK
Definition: MIMXRT1052.h:12159
edma_bandwidth_t
enum _edma_bandwidth edma_bandwidth_t
Bandwidth control.
kEDMA_Modulo128Mbytes
@ kEDMA_Modulo128Mbytes
Definition: fsl_edma.h:73
edma_channel_link_type_t
enum _edma_channel_link_type edma_channel_link_type_t
Channel link type.
_edma_minor_offset_config
eDMA minor offset configuration
Definition: fsl_edma.h:191
kEDMA_Modulo16bytes
@ kEDMA_Modulo16bytes
Definition: fsl_edma.h:50
DMA_Type::DLAST_SGA
__IO uint32_t DLAST_SGA
Definition: MIMXRT1052.h:12020
FSL_FEATURE_DMAMUX_MODULE_CHANNEL
#define FSL_FEATURE_DMAMUX_MODULE_CHANNEL
Definition: MIMXRT1052_features.h:264
DMA_ES_DAE_MASK
#define DMA_ES_DAE_MASK
Definition: MIMXRT1052.h:12175
kEDMA_Modulo2bytes
@ kEDMA_Modulo2bytes
Definition: fsl_edma.h:47
_edma_handle::tcdUsed
volatile int8_t tcdUsed
Definition: fsl_edma.h:252
kStatus_EDMA_QueueFull
@ kStatus_EDMA_QueueFull
Definition: fsl_edma.h:144
DMA_ES_VLD_MASK
#define DMA_ES_VLD_MASK
Definition: MIMXRT1052.h:12223
DMA_CSR_INTHALF_MASK
#define DMA_CSR_INTHALF_MASK
Definition: MIMXRT1052.h:14925
_edma_tcd::DADDR
__IO uint32_t DADDR
Definition: fsl_edma.h:211
EDMA_SetChannelPreemptionConfig
void EDMA_SetChannelPreemptionConfig(DMA_Type *base, uint32_t channel, const edma_channel_Preemption_config_t *config)
Configures the eDMA channel preemption feature.
Definition: fsl_edma.c:269
DMA_SSRT_SSRT
#define DMA_SSRT_SSRT(x)
Definition: MIMXRT1052.h:12809
kEDMA_Modulo4bytes
@ kEDMA_Modulo4bytes
Definition: fsl_edma.h:48
EDMA_PrepareTransfer
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.
Definition: fsl_edma.c:986
kEDMA_ErrorChannelFlag
@ kEDMA_ErrorChannelFlag
Definition: fsl_edma.h:115
_edma_config::enableHaltOnError
bool enableHaltOnError
Definition: fsl_edma.h:155
DMA_Type
Definition: MIMXRT1052.h:11947
DMA_ES_ERRCHN_MASK
#define DMA_ES_ERRCHN_MASK
Definition: MIMXRT1052.h:12196
EDMA_TcdReset
void EDMA_TcdReset(edma_tcd_t *tcd)
Sets all fields to default values for the TCD structure.
Definition: fsl_edma.c:421
EDMA_SetCallback
void EDMA_SetCallback(edma_handle_t *handle, edma_callback callback, void *userData)
Installs a callback function for the eDMA transfer.
Definition: fsl_edma.c:867
kEDMA_Modulo64Kbytes
@ kEDMA_Modulo64Kbytes
Definition: fsl_edma.h:62
EDMA_TcdEnableInterrupts
void EDMA_TcdEnableInterrupts(edma_tcd_t *tcd, uint32_t mask)
Enables the interrupt source for the eDMA TCD.
Definition: fsl_edma.c:617
DMA_CSR_BWC
#define DMA_CSR_BWC(x)
Definition: MIMXRT1052.h:14977
_edma_channel_link_type
_edma_channel_link_type
Channel link type.
Definition: fsl_edma.h:89
DMA_Type::CSR
__IO uint16_t CSR
Definition: MIMXRT1052.h:12021
DMA_CSR_DREQ_MASK
#define DMA_CSR_DREQ_MASK
Definition: MIMXRT1052.h:14932
_edma_channel_Preemption_config::enableChannelPreemption
bool enableChannelPreemption
Definition: fsl_edma.h:185
kEDMA_DestinationBusErrorFlag
@ kEDMA_DestinationBusErrorFlag
Definition: fsl_edma.h:107
kEDMA_PeripheralToMemory
@ kEDMA_PeripheralToMemory
Definition: fsl_edma.h:136
_edma_minor_offset_config::enableSrcMinorOffset
bool enableSrcMinorOffset
Definition: fsl_edma.h:193
kEDMA_TransferSize4Bytes
@ kEDMA_TransferSize4Bytes
Definition: fsl_edma.h:37
kEDMA_Modulo128Kbytes
@ kEDMA_Modulo128Kbytes
Definition: fsl_edma.h:63
kEDMA_Modulo4Mbytes
@ kEDMA_Modulo4Mbytes
Definition: fsl_edma.h:68
DMA_ES_GPE_MASK
#define DMA_ES_GPE_MASK
Definition: MIMXRT1052.h:12209
MAKE_STATUS
#define MAKE_STATUS(group, code)
Construct a status code value from a group and code number.
Definition: fsl_common.h:43
DMA_CERQ_CERQ
#define DMA_CERQ_CERQ(x)
Definition: MIMXRT1052.h:12740
DMA_SERQ_SERQ
#define DMA_SERQ_SERQ(x)
Definition: MIMXRT1052.h:12763
_edma_transfer_config
eDMA transfer configuration
Definition: fsl_edma.h:168
EDMA_HandleIRQ
void EDMA_HandleIRQ(edma_handle_t *handle)
eDMA IRQ handler for the current major loop transfer completion.
Definition: fsl_edma.c:1313
_edma_tcd::ATTR
__IO uint16_t ATTR
Definition: fsl_edma.h:208
DMA_CSR_BWC_MASK
#define DMA_CSR_BWC_MASK
Definition: MIMXRT1052.h:14969
_edma_handle::flags
uint8_t flags
Definition: fsl_edma.h:255
kEDMA_PeripheralToPeripheral
@ kEDMA_PeripheralToPeripheral
Definition: fsl_edma.h:138
kEDMA_Modulo8bytes
@ kEDMA_Modulo8bytes
Definition: fsl_edma.h:49
kEDMA_SourceBusErrorFlag
@ kEDMA_SourceBusErrorFlag
Definition: fsl_edma.h:108
EDMA_SetModulo
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.
Definition: fsl_edma.c:341
kEDMA_Modulo8Mbytes
@ kEDMA_Modulo8Mbytes
Definition: fsl_edma.h:69
EDMA_StopTransfer
void EDMA_StopTransfer(edma_handle_t *handle)
eDMA stops transfer.
Definition: fsl_edma.c:1248
DMA_Type::CERQ
__O uint8_t CERQ
Definition: MIMXRT1052.h:11956
kEDMA_Modulo512bytes
@ kEDMA_Modulo512bytes
Definition: fsl_edma.h:55
_edma_modulo
_edma_modulo
eDMA modulo configuration
Definition: fsl_edma.h:44
EDMA_DisableChannelRequest
static void EDMA_DisableChannelRequest(DMA_Type *base, uint32_t channel)
Disables the eDMA hardware channel request.
Definition: fsl_edma.h:659
kEDMA_BandwidthStallNone
@ kEDMA_BandwidthStallNone
Definition: fsl_edma.h:83
kEDMA_Modulo256Mbytes
@ kEDMA_Modulo256Mbytes
Definition: fsl_edma.h:74
_edma_minor_offset_config::enableDestMinorOffset
bool enableDestMinorOffset
Definition: fsl_edma.h:194
edma_transfer_config_t
struct _edma_transfer_config edma_transfer_config_t
eDMA transfer configuration
kEDMA_TransferSize8Bytes
@ kEDMA_TransferSize8Bytes
Definition: fsl_edma.h:38
_edma_transfer_config::srcAddr
uint32_t srcAddr
Definition: fsl_edma.h:170
_edma_transfer_config::srcOffset
int16_t srcOffset
Definition: fsl_edma.h:174
_edma_transfer_config::destAddr
uint32_t destAddr
Definition: fsl_edma.h:171
EDMA_GetDefaultConfig
void EDMA_GetDefaultConfig(edma_config_t *config)
Gets the eDMA default configuration structure.
Definition: fsl_edma.c:170
_edma_channel_Preemption_config::channelPriority
uint8_t channelPriority
Definition: fsl_edma.h:187
DMA_CSR_DREQ
#define DMA_CSR_DREQ(x)
Definition: MIMXRT1052.h:14938
edma_config_t
struct _edma_config edma_config_t
eDMA global configuration structure.
kEDMA_TransferCanceledFlag
@ kEDMA_TransferCanceledFlag
Definition: fsl_edma.h:117
_edma_handle::base
DMA_Type * base
Definition: fsl_edma.h:247
kEDMA_ErrorFlag
@ kEDMA_ErrorFlag
Definition: fsl_edma.h:100
EDMA_TcdDisableInterrupts
void EDMA_TcdDisableInterrupts(edma_tcd_t *tcd, uint32_t mask)
Disables the interrupt source for the eDMA TCD.
Definition: fsl_edma.c:641
EDMA_AbortTransfer
void EDMA_AbortTransfer(edma_handle_t *handle)
eDMA aborts transfer.
Definition: fsl_edma.c:1264
kEDMA_MinorLink
@ kEDMA_MinorLink
Definition: fsl_edma.h:92
kEDMA_Modulo32Mbytes
@ kEDMA_Modulo32Mbytes
Definition: fsl_edma.h:71
DMA_ES_SOE_MASK
#define DMA_ES_SOE_MASK
Definition: MIMXRT1052.h:12182
_edma_interrupt_enable
_edma_interrupt_enable
eDMA interrupt source
Definition: fsl_edma.h:125
EDMA_CreateHandle
void EDMA_CreateHandle(edma_handle_t *handle, DMA_Type *base, uint32_t channel)
Creates the eDMA handle.
Definition: fsl_edma.c:790
kEDMA_TransferSize32Bytes
@ kEDMA_TransferSize32Bytes
Definition: fsl_edma.h:40
kEDMA_Modulo1Gbytes
@ kEDMA_Modulo1Gbytes
Definition: fsl_edma.h:76
EDMA_TcdSetMinorOffsetConfig
void EDMA_TcdSetMinorOffsetConfig(edma_tcd_t *tcd, const edma_minor_offset_config_t *config)
Configures the eDMA TCD minor offset feature.
Definition: fsl_edma.c:519
EDMA_Init
void EDMA_Init(DMA_Type *base, const edma_config_t *config)
Initializes the eDMA peripheral.
Definition: fsl_edma.c:118
EDMA_PrepareTransferConfig
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.
Definition: fsl_edma.c:937
EDMA_SetMinorOffsetConfig
void EDMA_SetMinorOffsetConfig(DMA_Type *base, uint32_t channel, const edma_minor_offset_config_t *config)
Configures the eDMA minor offset feature.
Definition: fsl_edma.c:245
edma_callback
void(* edma_callback)(struct _edma_handle *handle, void *userData, bool transferDone, uint32_t tcds)
Define callback function for eDMA.
Definition: fsl_edma.h:240
DMA_Type::SERQ
__O uint8_t SERQ
Definition: MIMXRT1052.h:11957
kEDMA_MemoryToMemory
@ kEDMA_MemoryToMemory
Definition: fsl_edma.h:135
DMA_Type::SSRT
__O uint8_t SSRT
Definition: MIMXRT1052.h:11959
DMA_ES_SBE_MASK
#define DMA_ES_SBE_MASK
Definition: MIMXRT1052.h:12143
kEDMA_MajorLink
@ kEDMA_MajorLink
Definition: fsl_edma.h:93
kEDMA_ScatterGatherErrorFlag
@ kEDMA_ScatterGatherErrorFlag
Definition: fsl_edma.h:109
kEDMA_Modulo64bytes
@ kEDMA_Modulo64bytes
Definition: fsl_edma.h:52
kEDMA_ChannelPriorityErrorFlag
@ kEDMA_ChannelPriorityErrorFlag
Definition: fsl_edma.h:116
_edma_tcd::DLAST_SGA
__IO uint32_t DLAST_SGA
Definition: fsl_edma.h:214
EDMA_SetTransferConfig
void EDMA_SetTransferConfig(DMA_Type *base, uint32_t channel, const edma_transfer_config_t *config, edma_tcd_t *nextTcd)
Configures the eDMA transfer attribute.
Definition: fsl_edma.c:226
_edma_transfer_config::destOffset
int16_t destOffset
Definition: fsl_edma.h:176
DMA_Type::TCD
struct DMA_Type::@304 TCD[32]
kEDMA_Modulo512Kbytes
@ kEDMA_Modulo512Kbytes
Definition: fsl_edma.h:65
kEDMA_Modulo512Mbytes
@ kEDMA_Modulo512Mbytes
Definition: fsl_edma.h:75
kEDMA_BandwidthStall4Cycle
@ kEDMA_BandwidthStall4Cycle
Definition: fsl_edma.h:84
_edma_transfer_config::srcTransferSize
edma_transfer_size_t srcTransferSize
Definition: fsl_edma.h:172
kEDMA_Modulo16Kbytes
@ kEDMA_Modulo16Kbytes
Definition: fsl_edma.h:60
_edma_handle::userData
void * userData
Definition: fsl_edma.h:246
_edma_tcd::BITER
__IO uint16_t BITER
Definition: fsl_edma.h:216
DMA_ES_CPE_MASK
#define DMA_ES_CPE_MASK
Definition: MIMXRT1052.h:12201
_edma_transfer_type
_edma_transfer_type
eDMA transfer type
Definition: fsl_edma.h:133
kEDMA_Modulo256Kbytes
@ kEDMA_Modulo256Kbytes
Definition: fsl_edma.h:64
_edma_tcd::NBYTES
__IO uint32_t NBYTES
Definition: fsl_edma.h:209
kEDMA_MemoryToPeripheral
@ kEDMA_MemoryToPeripheral
Definition: fsl_edma.h:137
kStatus_EDMA_Busy
@ kStatus_EDMA_Busy
Definition: fsl_edma.h:145
EDMA_InstallTCD
void EDMA_InstallTCD(DMA_Type *base, uint32_t channel, edma_tcd_t *tcd)
Push content of TCD structure into hardware TCD register.
Definition: fsl_edma.c:86
DMA_ES_SAE_MASK
#define DMA_ES_SAE_MASK
Definition: MIMXRT1052.h:12189
EDMA_TcdSetBandWidth
static void EDMA_TcdSetBandWidth(edma_tcd_t *tcd, edma_bandwidth_t bandWidth)
Sets the bandwidth for the eDMA TCD.
Definition: fsl_edma.h:575
DMA_CSR_INTMAJOR_MASK
#define DMA_CSR_INTMAJOR_MASK
Definition: MIMXRT1052.h:14918
edma_tcd_t
struct _edma_tcd edma_tcd_t
eDMA TCD.
DMA_Type::EARS
__IO uint32_t EARS
Definition: MIMXRT1052.h:11969
DMA_ES_DOE_MASK
#define DMA_ES_DOE_MASK
Definition: MIMXRT1052.h:12168
kEDMA_Modulo128bytes
@ kEDMA_Modulo128bytes
Definition: fsl_edma.h:53
_edma_handle::callback
edma_callback callback
Definition: fsl_edma.h:245
kEDMA_Modulo256bytes
@ kEDMA_Modulo256bytes
Definition: fsl_edma.h:54
kEDMA_ErrorInterruptEnable
@ kEDMA_ErrorInterruptEnable
Definition: fsl_edma.h:127
_edma_config
eDMA global configuration structure.
Definition: fsl_edma.h:150
DMA_Type::ES
__I uint32_t ES
Definition: MIMXRT1052.h:11949
kEDMA_HalfInterruptEnable
@ kEDMA_HalfInterruptEnable
Definition: fsl_edma.h:129
_edma_tcd::DOFF
__IO uint16_t DOFF
Definition: fsl_edma.h:212
_edma_channel_Preemption_config
eDMA channel priority configuration
Definition: fsl_edma.h:183
_edma_tcd::CSR
__IO uint16_t CSR
Definition: fsl_edma.h:215
EDMA_EnableAutoStopRequest
static void EDMA_EnableAutoStopRequest(DMA_Type *base, uint32_t channel, bool enable)
Enables an auto stop request for the eDMA transfer.
Definition: fsl_edma.h:462
EDMA_GetUnusedTCDNumber
static uint32_t EDMA_GetUnusedTCDNumber(edma_handle_t *handle)
Get unused TCD slot number.
Definition: fsl_edma.h:893
_edma_tcd
eDMA TCD.
Definition: fsl_edma.h:204
kEDMA_TransferSize1Bytes
@ kEDMA_TransferSize1Bytes
Definition: fsl_edma.h:35
kEDMA_DoneFlag
@ kEDMA_DoneFlag
Definition: fsl_edma.h:99
EDMA_EnableChannelRequest
static void EDMA_EnableChannelRequest(DMA_Type *base, uint32_t channel)
Enables the eDMA hardware channel request.
Definition: fsl_edma.h:644
kEDMA_ModuloDisable
@ kEDMA_ModuloDisable
Definition: fsl_edma.h:46
kEDMA_DestinationAddressErrorFlag
@ kEDMA_DestinationAddressErrorFlag
Definition: fsl_edma.h:112
config
static sai_transceiver_t config
Definition: imxrt1050/imxrt1050-evkb/source/pv_audio_rec.c:75
EDMA_GetChannelStatusFlags
uint32_t EDMA_GetChannelStatusFlags(DMA_Type *base, uint32_t channel)
Gets the eDMA channel status flags.
Definition: fsl_edma.c:715
_edma_config::enableRoundRobinArbitration
bool enableRoundRobinArbitration
Definition: fsl_edma.h:157
edma_handle_t
struct _edma_handle edma_handle_t
eDMA transfer handle structure
_edma_handle::channel
uint8_t channel
Definition: fsl_edma.h:249
EDMA_TcdSetTransferConfig
void EDMA_TcdSetTransferConfig(edma_tcd_t *tcd, const edma_transfer_config_t *config, edma_tcd_t *nextTcd)
Configures the eDMA TCD transfer attribute.
Definition: fsl_edma.c:468
edma_interrupt_enable_t
enum _edma_interrupt_enable edma_interrupt_enable_t
eDMA interrupt source
EDMA_GetNextTCDAddress
static uint32_t EDMA_GetNextTCDAddress(edma_handle_t *handle)
Get the next tcd address.
Definition: fsl_edma.h:908
_edma_bandwidth
_edma_bandwidth
Bandwidth control.
Definition: fsl_edma.h:81
_edma_handle::header
volatile int8_t header
Definition: fsl_edma.h:250
_edma_handle::tail
volatile int8_t tail
Definition: fsl_edma.h:251
kEDMA_SourceOffsetErrorFlag
@ kEDMA_SourceOffsetErrorFlag
Definition: fsl_edma.h:113
kEDMA_Modulo2Kbytes
@ kEDMA_Modulo2Kbytes
Definition: fsl_edma.h:57
DMA_ES_ECX_MASK
#define DMA_ES_ECX_MASK
Definition: MIMXRT1052.h:12216
status_t
int32_t status_t
Type used for all status and error return values.
Definition: fsl_common.h:189
EDMA_ClearChannelStatusFlags
void EDMA_ClearChannelStatusFlags(DMA_Type *base, uint32_t channel, uint32_t mask)
Clears the eDMA channel status flags.
Definition: fsl_edma.c:739
EDMA_StartTransfer
void EDMA_StartTransfer(edma_handle_t *handle)
eDMA starts transfer.
Definition: fsl_edma.c:1201
edma_modulo_t
enum _edma_modulo edma_modulo_t
eDMA modulo configuration
kEDMA_MajorInterruptEnable
@ kEDMA_MajorInterruptEnable
Definition: fsl_edma.h:128
kEDMA_Modulo1Mbytes
@ kEDMA_Modulo1Mbytes
Definition: fsl_edma.h:66
kEDMA_Modulo64Mbytes
@ kEDMA_Modulo64Mbytes
Definition: fsl_edma.h:72
_edma_minor_offset_config::minorOffset
uint32_t minorOffset
Definition: fsl_edma.h:195
_edma_config::enableDebugMode
bool enableDebugMode
Definition: fsl_edma.h:159
EDMA_GetRemainingMajorLoopCount
uint32_t EDMA_GetRemainingMajorLoopCount(DMA_Type *base, uint32_t channel)
Gets the remaining major loop count from the eDMA current channel TCD.
Definition: fsl_edma.c:679
_edma_channel_Preemption_config::enablePreemptAbility
bool enablePreemptAbility
Definition: fsl_edma.h:186
EDMA_TcdSetModulo
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.
Definition: fsl_edma.c:599
_edma_config::enableContinuousLinkMode
bool enableContinuousLinkMode
Definition: fsl_edma.h:152
_edma_tcd::SLAST
__IO uint32_t SLAST
Definition: fsl_edma.h:210
kEDMA_ValidFlag
@ kEDMA_ValidFlag
Definition: fsl_edma.h:121
kEDMA_Modulo4Kbytes
@ kEDMA_Modulo4Kbytes
Definition: fsl_edma.h:58
EDMA_SetBandWidth
void EDMA_SetBandWidth(DMA_Type *base, uint32_t channel, edma_bandwidth_t bandWidth)
Sets the bandwidth for the eDMA transfer.
Definition: fsl_edma.c:322
kEDMA_TransferSize16Bytes
@ kEDMA_TransferSize16Bytes
Definition: fsl_edma.h:39
_edma_handle::tcdPool
edma_tcd_t * tcdPool
Definition: fsl_edma.h:248
kEDMA_NbytesErrorFlag
@ kEDMA_NbytesErrorFlag
Definition: fsl_edma.h:110


picovoice_driver
Author(s):
autogenerated on Fri Apr 1 2022 02:13:56