fsl_edma.c
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 #include "fsl_edma.h"
10 
11 /*******************************************************************************
12  * Definitions
13  ******************************************************************************/
14 
15 /* Component ID definition, used by tools. */
16 #ifndef FSL_COMPONENT_ID
17 #define FSL_COMPONENT_ID "platform.drivers.edma"
18 #endif
19 
20 #define EDMA_TRANSFER_ENABLED_MASK 0x80U
21 
22 /*******************************************************************************
23  * Prototypes
24  ******************************************************************************/
25 
31 static uint32_t EDMA_GetInstanceOffset(uint32_t instance);
32 
38 static edma_transfer_size_t EDMA_TransferWidthMapping(uint32_t width);
39 /*******************************************************************************
40  * Variables
41  ******************************************************************************/
42 
45 
46 #if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL)
47 
49 #endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */
50 
53 
56 
57 /*******************************************************************************
58  * Code
59  ******************************************************************************/
60 
61 static uint32_t EDMA_GetInstance(DMA_Type *base)
62 {
63  uint32_t instance;
64 
65  /* Find the instance index from base address mappings. */
66  for (instance = 0; instance < ARRAY_SIZE(s_edmaBases); instance++)
67  {
68  if (s_edmaBases[instance] == base)
69  {
70  break;
71  }
72  }
73 
74  assert(instance < ARRAY_SIZE(s_edmaBases));
75 
76  return instance;
77 }
78 
86 void EDMA_InstallTCD(DMA_Type *base, uint32_t channel, edma_tcd_t *tcd)
87 {
88  assert(channel < (uint32_t)FSL_FEATURE_EDMA_MODULE_CHANNEL);
89  assert(tcd != NULL);
90  assert(((uint32_t)tcd & 0x1FU) == 0U);
91 
92  /* Push tcd into hardware TCD register */
93  base->TCD[channel].SADDR = tcd->SADDR;
94  base->TCD[channel].SOFF = tcd->SOFF;
95  base->TCD[channel].ATTR = tcd->ATTR;
96  base->TCD[channel].NBYTES_MLNO = tcd->NBYTES;
97  base->TCD[channel].SLAST = tcd->SLAST;
98  base->TCD[channel].DADDR = tcd->DADDR;
99  base->TCD[channel].DOFF = tcd->DOFF;
100  base->TCD[channel].CITER_ELINKNO = tcd->CITER;
101  base->TCD[channel].DLAST_SGA = tcd->DLAST_SGA;
102  /* Clear DONE bit first, otherwise ESG cannot be set */
103  base->TCD[channel].CSR = 0;
104  base->TCD[channel].CSR = tcd->CSR;
105  base->TCD[channel].BITER_ELINKNO = tcd->BITER;
106 }
107 
119 {
120  assert(config != NULL);
121 
122  uint32_t tmpreg;
123 
124 #if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL)
125  /* Ungate EDMA peripheral clock */
127 #endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */
128 
129  /* clear all the enabled request, status to make sure EDMA status is in normal condition */
130  base->ERQ = 0U;
131  base->INT = 0xFFFFFFFFU;
132  base->ERR = 0xFFFFFFFFU;
133  /* Configure EDMA peripheral according to the configuration structure. */
134  tmpreg = base->CR;
136  tmpreg |= (DMA_CR_ERCA(config->enableRoundRobinArbitration) | DMA_CR_HOE(config->enableHaltOnError) |
137  DMA_CR_CLM(config->enableContinuousLinkMode) | DMA_CR_EDBG(config->enableDebugMode) | DMA_CR_EMLM(1U));
138  base->CR = tmpreg;
139 }
140 
149 {
150 #if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL)
151  /* Gate EDMA peripheral clock */
153 #endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */
154 }
155 
171 {
172  assert(config != NULL);
173 
174  /* Initializes the configure structure to zero. */
175  (void)memset(config, 0, sizeof(*config));
176 
177  config->enableRoundRobinArbitration = false;
178  config->enableHaltOnError = true;
179  config->enableContinuousLinkMode = false;
180  config->enableDebugMode = false;
181 }
182 
194 void EDMA_ResetChannel(DMA_Type *base, uint32_t channel)
195 {
196  assert(channel < (uint32_t)FSL_FEATURE_EDMA_MODULE_CHANNEL);
197 
198  EDMA_TcdReset((edma_tcd_t *)(uint32_t)&base->TCD[channel]);
199 }
200 
226 void EDMA_SetTransferConfig(DMA_Type *base, uint32_t channel, const edma_transfer_config_t *config, edma_tcd_t *nextTcd)
227 {
228  assert(channel < (uint32_t)FSL_FEATURE_EDMA_MODULE_CHANNEL);
229  assert(config != NULL);
230  assert(((uint32_t)nextTcd & 0x1FU) == 0U);
231 
232  EDMA_TcdSetTransferConfig((edma_tcd_t *)(uint32_t)&base->TCD[channel], config, nextTcd);
233 }
234 
246 {
247  assert(channel < (uint32_t)FSL_FEATURE_EDMA_MODULE_CHANNEL);
248  assert(config != NULL);
249 
250  uint32_t tmpreg;
251 
252  tmpreg = base->TCD[channel].NBYTES_MLOFFYES;
254  tmpreg |=
255  (DMA_NBYTES_MLOFFYES_SMLOE(config->enableSrcMinorOffset) |
256  DMA_NBYTES_MLOFFYES_DMLOE(config->enableDestMinorOffset) | DMA_NBYTES_MLOFFYES_MLOFF(config->minorOffset));
257  base->TCD[channel].NBYTES_MLOFFYES = tmpreg;
258 }
259 
270 {
271  assert(channel < (uint32_t)FSL_FEATURE_EDMA_MODULE_CHANNEL);
272  assert(config != NULL);
273 
274  bool tmpEnablePreemptAbility = config->enablePreemptAbility;
275  bool tmpEnableChannelPreemption = config->enableChannelPreemption;
276  uint8_t tmpChannelPriority = config->channelPriority;
277  volatile uint8_t *tmpReg = &base->DCHPRI3;
278 
279  ((volatile uint8_t *)tmpReg)[DMA_DCHPRI_INDEX(channel)] =
280  (DMA_DCHPRI0_DPA((true == tmpEnablePreemptAbility ? 0U : 1U)) |
281  DMA_DCHPRI0_ECP((true == tmpEnableChannelPreemption ? 1U : 0U)) | DMA_DCHPRI0_CHPRI(tmpChannelPriority));
282 }
283 
300 void EDMA_SetChannelLink(DMA_Type *base, uint32_t channel, edma_channel_link_type_t type, uint32_t linkedChannel)
301 {
302  assert(channel < (uint32_t)FSL_FEATURE_EDMA_MODULE_CHANNEL);
303  assert(linkedChannel < (uint32_t)FSL_FEATURE_EDMA_MODULE_CHANNEL);
304 
305  EDMA_TcdSetChannelLink((edma_tcd_t *)(uint32_t)&base->TCD[channel], type, linkedChannel);
306 }
307 
322 void EDMA_SetBandWidth(DMA_Type *base, uint32_t channel, edma_bandwidth_t bandWidth)
323 {
324  assert(channel < (uint32_t)FSL_FEATURE_EDMA_MODULE_CHANNEL);
325 
326  base->TCD[channel].CSR = (uint16_t)((base->TCD[channel].CSR & (~DMA_CSR_BWC_MASK)) | DMA_CSR_BWC(bandWidth));
327 }
328 
341 void EDMA_SetModulo(DMA_Type *base, uint32_t channel, edma_modulo_t srcModulo, edma_modulo_t destModulo)
342 {
343  assert(channel < (uint32_t)FSL_FEATURE_EDMA_MODULE_CHANNEL);
344 
345  uint16_t tmpreg;
346 
347  tmpreg = base->TCD[channel].ATTR & (~(uint16_t)(DMA_ATTR_SMOD_MASK | DMA_ATTR_DMOD_MASK));
348  base->TCD[channel].ATTR = tmpreg | DMA_ATTR_DMOD(destModulo) | DMA_ATTR_SMOD(srcModulo);
349 }
350 
359 void EDMA_EnableChannelInterrupts(DMA_Type *base, uint32_t channel, uint32_t mask)
360 {
361  assert(channel < (uint32_t)FSL_FEATURE_EDMA_MODULE_CHANNEL);
362 
363  /* Enable error interrupt */
364  if (0U != (mask & (uint32_t)kEDMA_ErrorInterruptEnable))
365  {
366  base->EEI |= ((uint32_t)0x1U << channel);
367  }
368 
369  /* Enable Major interrupt */
370  if (0U != (mask & (uint32_t)kEDMA_MajorInterruptEnable))
371  {
372  base->TCD[channel].CSR |= DMA_CSR_INTMAJOR_MASK;
373  }
374 
375  /* Enable Half major interrupt */
376  if (0U != (mask & (uint32_t)kEDMA_HalfInterruptEnable))
377  {
378  base->TCD[channel].CSR |= DMA_CSR_INTHALF_MASK;
379  }
380 }
381 
390 void EDMA_DisableChannelInterrupts(DMA_Type *base, uint32_t channel, uint32_t mask)
391 {
392  assert(channel < (uint32_t)FSL_FEATURE_EDMA_MODULE_CHANNEL);
393 
394  /* Disable error interrupt */
395  if (0U != (mask & (uint32_t)kEDMA_ErrorInterruptEnable))
396  {
397  base->EEI &= (~((uint32_t)0x1U << channel));
398  }
399 
400  /* Disable Major interrupt */
401  if (0U != (mask & (uint32_t)kEDMA_MajorInterruptEnable))
402  {
403  base->TCD[channel].CSR &= ~(uint16_t)DMA_CSR_INTMAJOR_MASK;
404  }
405 
406  /* Disable Half major interrupt */
407  if (0U != (mask & (uint32_t)kEDMA_HalfInterruptEnable))
408  {
409  base->TCD[channel].CSR &= ~(uint16_t)DMA_CSR_INTHALF_MASK;
410  }
411 }
412 
422 {
423  assert(tcd != NULL);
424  assert(((uint32_t)tcd & 0x1FU) == 0U);
425 
426  /* Reset channel TCD */
427  tcd->SADDR = 0U;
428  tcd->SOFF = 0U;
429  tcd->ATTR = 0U;
430  tcd->NBYTES = 0U;
431  tcd->SLAST = 0U;
432  tcd->DADDR = 0U;
433  tcd->DOFF = 0U;
434  tcd->CITER = 0U;
435  tcd->DLAST_SGA = 0U;
436  /* Enable auto disable request feature */
437  tcd->CSR = DMA_CSR_DREQ(true);
438  tcd->BITER = 0U;
439 }
440 
469 {
470  assert(tcd != NULL);
471  assert(((uint32_t)tcd & 0x1FU) == 0U);
472  assert(config != NULL);
473  assert(((uint32_t)nextTcd & 0x1FU) == 0U);
474  assert((config->srcAddr % (1UL << (uint32_t)config->srcTransferSize)) == 0U);
475  assert((config->destAddr % (1UL << (uint32_t)config->destTransferSize)) == 0U);
476 
477  /* source address */
478  tcd->SADDR = config->srcAddr;
479  /* destination address */
480  tcd->DADDR = config->destAddr;
481  /* Source data and destination data transfer size */
482  tcd->ATTR = DMA_ATTR_SSIZE(config->srcTransferSize) | DMA_ATTR_DSIZE(config->destTransferSize);
483  /* Source address signed offset */
484  tcd->SOFF = (uint16_t)config->srcOffset;
485  /* Destination address signed offset */
486  tcd->DOFF = (uint16_t)config->destOffset;
487  /* Minor byte transfer count */
488  tcd->NBYTES = config->minorLoopBytes;
489  /* Current major iteration count */
490  tcd->CITER = (uint16_t)config->majorLoopCounts;
491  /* Starting major iteration count */
492  tcd->BITER = (uint16_t)config->majorLoopCounts;
493  /* Enable scatter/gather processing */
494  if (nextTcd != NULL)
495  {
496  tcd->DLAST_SGA = (uint32_t)nextTcd;
497  /*
498  Before call EDMA_TcdSetTransferConfig or EDMA_SetTransferConfig,
499  user must call EDMA_TcdReset or EDMA_ResetChannel which will set
500  DREQ, so must use "|" or "&" rather than "=".
501 
502  Clear the DREQ bit because scatter gather has been enabled, so the
503  previous transfer is not the last transfer, and channel request should
504  be enabled at the next transfer(the next TCD).
505  */
506  tcd->CSR = (tcd->CSR | (uint16_t)DMA_CSR_ESG_MASK) & ~(uint16_t)DMA_CSR_DREQ_MASK;
507  }
508 }
509 
520 {
521  assert(tcd != NULL);
522  assert(((uint32_t)tcd & 0x1FU) == 0U);
523 
524  uint32_t tmpreg;
525 
526  tmpreg = tcd->NBYTES &
528  tmpreg |=
529  (DMA_NBYTES_MLOFFYES_SMLOE(config->enableSrcMinorOffset) |
530  DMA_NBYTES_MLOFFYES_DMLOE(config->enableDestMinorOffset) | DMA_NBYTES_MLOFFYES_MLOFF(config->minorOffset));
531  tcd->NBYTES = tmpreg;
532 }
533 
549 void EDMA_TcdSetChannelLink(edma_tcd_t *tcd, edma_channel_link_type_t type, uint32_t linkedChannel)
550 {
551  assert(tcd != NULL);
552  assert(((uint32_t)tcd & 0x1FU) == 0U);
553  assert(linkedChannel < (uint32_t)FSL_FEATURE_EDMA_MODULE_CHANNEL);
554 
555  if (type == kEDMA_MinorLink) /* Minor link config */
556  {
557  uint16_t tmpreg;
558 
559  /* Enable minor link */
562  /* Set linked channel */
563  tmpreg = tcd->CITER & (~(uint16_t)DMA_CITER_ELINKYES_LINKCH_MASK);
564  tmpreg |= DMA_CITER_ELINKYES_LINKCH(linkedChannel);
565  tcd->CITER = tmpreg;
566  tmpreg = tcd->BITER & (~(uint16_t)DMA_BITER_ELINKYES_LINKCH_MASK);
567  tmpreg |= DMA_BITER_ELINKYES_LINKCH(linkedChannel);
568  tcd->BITER = tmpreg;
569  }
570  else if (type == kEDMA_MajorLink) /* Major link config */
571  {
572  uint16_t tmpreg;
573 
574  /* Enable major link */
576  /* Set major linked channel */
577  tmpreg = tcd->CSR & (~(uint16_t)DMA_CSR_MAJORLINKCH_MASK);
578  tcd->CSR = tmpreg | DMA_CSR_MAJORLINKCH(linkedChannel);
579  }
580  else /* Link none */
581  {
582  tcd->CITER &= ~(uint16_t)DMA_CITER_ELINKYES_ELINK_MASK;
583  tcd->BITER &= ~(uint16_t)DMA_BITER_ELINKYES_ELINK_MASK;
584  tcd->CSR &= ~(uint16_t)DMA_CSR_MAJORELINK_MASK;
585  }
586 }
587 
599 void EDMA_TcdSetModulo(edma_tcd_t *tcd, edma_modulo_t srcModulo, edma_modulo_t destModulo)
600 {
601  assert(tcd != NULL);
602  assert(((uint32_t)tcd & 0x1FU) == 0U);
603 
604  uint16_t tmpreg;
605 
606  tmpreg = tcd->ATTR & (~(uint16_t)(DMA_ATTR_SMOD_MASK | DMA_ATTR_DMOD_MASK));
607  tcd->ATTR = tmpreg | DMA_ATTR_DMOD(destModulo) | DMA_ATTR_SMOD(srcModulo);
608 }
609 
617 void EDMA_TcdEnableInterrupts(edma_tcd_t *tcd, uint32_t mask)
618 {
619  assert(tcd != NULL);
620 
621  /* Enable Major interrupt */
622  if (0U != (mask & (uint32_t)kEDMA_MajorInterruptEnable))
623  {
624  tcd->CSR |= DMA_CSR_INTMAJOR_MASK;
625  }
626 
627  /* Enable Half major interrupt */
628  if (0U != (mask & (uint32_t)kEDMA_HalfInterruptEnable))
629  {
630  tcd->CSR |= DMA_CSR_INTHALF_MASK;
631  }
632 }
633 
641 void EDMA_TcdDisableInterrupts(edma_tcd_t *tcd, uint32_t mask)
642 {
643  assert(tcd != NULL);
644 
645  /* Disable Major interrupt */
646  if (0U != (mask & (uint32_t)kEDMA_MajorInterruptEnable))
647  {
648  tcd->CSR &= ~(uint16_t)DMA_CSR_INTMAJOR_MASK;
649  }
650 
651  /* Disable Half major interrupt */
652  if (0U != (mask & (uint32_t)kEDMA_HalfInterruptEnable))
653  {
654  tcd->CSR &= ~(uint16_t)DMA_CSR_INTHALF_MASK;
655  }
656 }
657 
679 uint32_t EDMA_GetRemainingMajorLoopCount(DMA_Type *base, uint32_t channel)
680 {
681  assert(channel < (uint32_t)FSL_FEATURE_EDMA_MODULE_CHANNEL);
682 
683  uint32_t remainingCount = 0;
684 
685  if (0U != (DMA_CSR_DONE_MASK & base->TCD[channel].CSR))
686  {
687  remainingCount = 0;
688  }
689  else
690  {
691  /* Calculate the unfinished bytes */
692  if (0U != (base->TCD[channel].CITER_ELINKNO & DMA_CITER_ELINKNO_ELINK_MASK))
693  {
694  remainingCount = (((uint32_t)base->TCD[channel].CITER_ELINKYES & DMA_CITER_ELINKYES_CITER_MASK) >>
696  }
697  else
698  {
699  remainingCount = (((uint32_t)base->TCD[channel].CITER_ELINKNO & DMA_CITER_ELINKNO_CITER_MASK) >>
701  }
702  }
703 
704  return remainingCount;
705 }
706 
715 uint32_t EDMA_GetChannelStatusFlags(DMA_Type *base, uint32_t channel)
716 {
717  assert(channel < (uint32_t)FSL_FEATURE_EDMA_MODULE_CHANNEL);
718 
719  uint32_t retval = 0;
720 
721  /* Get DONE bit flag */
722  retval |= (((uint32_t)base->TCD[channel].CSR & DMA_CSR_DONE_MASK) >> DMA_CSR_DONE_SHIFT);
723  /* Get ERROR bit flag */
724  retval |= ((((uint32_t)base->ERR >> channel) & 0x1U) << 1U);
725  /* Get INT bit flag */
726  retval |= ((((uint32_t)base->INT >> channel) & 0x1U) << 2U);
727 
728  return retval;
729 }
730 
739 void EDMA_ClearChannelStatusFlags(DMA_Type *base, uint32_t channel, uint32_t mask)
740 {
741  assert(channel < (uint32_t)FSL_FEATURE_EDMA_MODULE_CHANNEL);
742 
743  /* Clear DONE bit flag */
744  if (0U != (mask & (uint32_t)kEDMA_DoneFlag))
745  {
746  base->CDNE = (uint8_t)channel;
747  }
748  /* Clear ERROR bit flag */
749  if (0U != (mask & (uint32_t)kEDMA_ErrorFlag))
750  {
751  base->CERR = (uint8_t)channel;
752  }
753  /* Clear INT bit flag */
754  if (0U != (mask & (uint32_t)kEDMA_InterruptFlag))
755  {
756  base->CINT = (uint8_t)channel;
757  }
758 }
759 
760 static uint32_t EDMA_GetInstanceOffset(uint32_t instance)
761 {
762  static uint8_t startInstanceNum;
763 
764 #if defined(DMA0)
765  startInstanceNum = (uint8_t)EDMA_GetInstance(DMA0);
766 #elif defined(DMA1)
767  startInstanceNum = (uint8_t)EDMA_GetInstance(DMA1);
768 #elif defined(DMA2)
769  startInstanceNum = (uint8_t)EDMA_GetInstance(DMA2);
770 #elif defined(DMA3)
771  startInstanceNum = (uint8_t)EDMA_GetInstance(DMA3);
772 #endif
773 
774  assert(startInstanceNum <= instance);
775 
776  return instance - startInstanceNum;
777 }
778 
790 void EDMA_CreateHandle(edma_handle_t *handle, DMA_Type *base, uint32_t channel)
791 {
792  assert(handle != NULL);
793  assert(channel < (uint32_t)FSL_FEATURE_EDMA_MODULE_CHANNEL);
794 
795  uint32_t edmaInstance;
796  uint32_t channelIndex;
797  edma_tcd_t *tcdRegs;
798 
799  /* Zero the handle */
800  (void)memset(handle, 0, sizeof(*handle));
801 
802  handle->base = base;
803  handle->channel = (uint8_t)channel;
804  /* Get the DMA instance number */
805  edmaInstance = EDMA_GetInstance(base);
806  channelIndex = (EDMA_GetInstanceOffset(edmaInstance) * (uint32_t)FSL_FEATURE_EDMA_MODULE_CHANNEL) + channel;
807  s_EDMAHandle[channelIndex] = handle;
808 
809  /* Enable NVIC interrupt */
810  (void)EnableIRQ(s_edmaIRQNumber[edmaInstance][channel]);
811 
812  /*
813  Reset TCD registers to zero. Unlike the EDMA_TcdReset(DREQ will be set),
814  CSR will be 0. Because in order to suit EDMA busy check mechanism in
815  EDMA_SubmitTransfer, CSR must be set 0.
816  */
817  tcdRegs = (edma_tcd_t *)(uint32_t)&handle->base->TCD[handle->channel];
818  tcdRegs->SADDR = 0;
819  tcdRegs->SOFF = 0;
820  tcdRegs->ATTR = 0;
821  tcdRegs->NBYTES = 0;
822  tcdRegs->SLAST = 0;
823  tcdRegs->DADDR = 0;
824  tcdRegs->DOFF = 0;
825  tcdRegs->CITER = 0;
826  tcdRegs->DLAST_SGA = 0;
827  tcdRegs->CSR = 0;
828  tcdRegs->BITER = 0;
829 }
830 
843 void EDMA_InstallTCDMemory(edma_handle_t *handle, edma_tcd_t *tcdPool, uint32_t tcdSize)
844 {
845  assert(handle != NULL);
846  assert(((uint32_t)tcdPool & 0x1FU) == 0U);
847 
848  /* Initialize tcd queue attribute. */
849  handle->header = 0;
850  handle->tail = 0;
851  handle->tcdUsed = 0;
852  handle->tcdSize = (int8_t)tcdSize;
853  handle->flags = 0;
854  handle->tcdPool = tcdPool;
855 }
856 
867 void EDMA_SetCallback(edma_handle_t *handle, edma_callback callback, void *userData)
868 {
869  assert(handle != NULL);
870 
871  handle->callback = callback;
872  handle->userData = userData;
873 }
874 
876 {
878 
879  /* map width to register value */
880  switch (width)
881  {
882  /* width 8bit */
883  case 1U:
884  transferSize = kEDMA_TransferSize1Bytes;
885  break;
886  /* width 16bit */
887  case 2U:
888  transferSize = kEDMA_TransferSize2Bytes;
889  break;
890  /* width 32bit */
891  case 4U:
892  transferSize = kEDMA_TransferSize4Bytes;
893  break;
894 #if (defined(FSL_FEATURE_EDMA_SUPPORT_8_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_8_BYTES_TRANSFER)
895  /* width 64bit */
896  case 8U:
897  transferSize = kEDMA_TransferSize8Bytes;
898  break;
899 #endif
900 #if (defined(FSL_FEATURE_EDMA_SUPPORT_16_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_16_BYTES_TRANSFER)
901  /* width 128bit */
902  case 16U:
903  transferSize = kEDMA_TransferSize16Bytes;
904  break;
905 #endif
906  /* width 256bit */
907  case 32U:
908  transferSize = kEDMA_TransferSize32Bytes;
909  break;
910  default:
911  /* All the cases have been listed above, the default clause should not be reached. */
912  assert(false);
913  break;
914  }
915 
916  return transferSize;
917 }
918 
938  void *srcAddr,
939  uint32_t srcWidth,
940  int16_t srcOffset,
941  void *destAddr,
942  uint32_t destWidth,
943  int16_t destOffset,
944  uint32_t bytesEachRequest,
945  uint32_t transferBytes)
946 {
947  assert(config != NULL);
948  assert(srcAddr != NULL);
949  assert(destAddr != NULL);
950  assert((srcWidth != 0U) && (srcWidth <= 32U) && ((srcWidth & (srcWidth - 1U)) == 0U));
951  assert((destWidth != 0U) && (destWidth <= 32U) && ((destWidth & (destWidth - 1U)) == 0U));
952  assert((transferBytes % bytesEachRequest) == 0U);
953  assert((((uint32_t)(uint32_t *)srcAddr) % srcWidth) == 0U);
954  assert((((uint32_t)(uint32_t *)destAddr) % destWidth) == 0U);
955 
956  /* Initializes the configure structure to zero. */
957  (void)memset(config, 0, sizeof(*config));
958 
959  config->destAddr = (uint32_t)(uint32_t *)destAddr;
960  config->srcAddr = (uint32_t)(uint32_t *)srcAddr;
961  config->minorLoopBytes = bytesEachRequest;
962  config->majorLoopCounts = transferBytes / bytesEachRequest;
963  config->srcTransferSize = EDMA_TransferWidthMapping(srcWidth);
964  config->destTransferSize = EDMA_TransferWidthMapping(destWidth);
965  config->destOffset = destOffset;
966  config->srcOffset = srcOffset;
967 }
968 
987  void *srcAddr,
988  uint32_t srcWidth,
989  void *destAddr,
990  uint32_t destWidth,
991  uint32_t bytesEachRequest,
992  uint32_t transferBytes,
994 {
995  assert(config != NULL);
996 
997  int16_t srcOffset = 0, destOffset = 0;
998 
999  switch (type)
1000  {
1001  case kEDMA_MemoryToMemory:
1002  destOffset = (int16_t)destWidth;
1003  srcOffset = (int16_t)srcWidth;
1004  break;
1006  destOffset = 0;
1007  srcOffset = (int16_t)srcWidth;
1008  break;
1010  destOffset = (int16_t)destWidth;
1011  srcOffset = 0;
1012  break;
1014  destOffset = 0;
1015  srcOffset = 0;
1016  break;
1017  default:
1018  /* All the cases have been listed above, the default clause should not be reached. */
1019  assert(false);
1020  break;
1021  }
1022 
1023  EDMA_PrepareTransferConfig(config, srcAddr, srcWidth, srcOffset, destAddr, destWidth, destOffset, bytesEachRequest,
1024  transferBytes);
1025 }
1026 
1041 {
1042  assert(handle != NULL);
1043  assert(config != NULL);
1044 
1045  edma_tcd_t *tcdRegs = (edma_tcd_t *)(uint32_t)&handle->base->TCD[handle->channel];
1046 
1047  if (handle->tcdPool == NULL)
1048  {
1049  /*
1050  * Check if EDMA channel is busy:
1051  * 1. if channel active bit is set, it implies that minor loop is executing, then channel is busy
1052  * 2. if channel active bit is not set and BITER not equal to CITER, it implies that major loop is executing,
1053  * then channel is busy
1054  *
1055  * There is one case can not be covered in below condition:
1056  * When transfer request is submitted, but no request from peripheral, that is to say channel sevice doesn't
1057  * begin, if application would like to submit another transfer , then the TCD will be overwritten, since the
1058  * ACTIVE is 0 and BITER = CITER, for such case, it is a scatter gather(link TCD) case actually, so
1059  * application should enabled TCD pool for dynamic scatter gather mode by calling EDMA_InstallTCDMemory.
1060  */
1061  if (((handle->base->TCD[handle->channel].CSR & DMA_CSR_ACTIVE_MASK) != 0U) ||
1062  (((handle->base->TCD[handle->channel].CITER_ELINKNO & DMA_CITER_ELINKNO_CITER_MASK) !=
1063  (handle->base->TCD[handle->channel].BITER_ELINKNO & DMA_BITER_ELINKNO_BITER_MASK))))
1064  {
1065  return kStatus_EDMA_Busy;
1066  }
1067  else
1068  {
1069  EDMA_SetTransferConfig(handle->base, handle->channel, config, NULL);
1070  /* Enable auto disable request feature */
1071  handle->base->TCD[handle->channel].CSR |= DMA_CSR_DREQ_MASK;
1072  /* Enable major interrupt */
1073  handle->base->TCD[handle->channel].CSR |= DMA_CSR_INTMAJOR_MASK;
1074 
1075  return kStatus_Success;
1076  }
1077  }
1078  else /* Use the TCD queue. */
1079  {
1080  uint32_t primask;
1081  uint16_t csr;
1082  int8_t currentTcd;
1083  int8_t previousTcd;
1084  int8_t nextTcd;
1085  int8_t tmpTcdUsed;
1086  int8_t tmpTcdSize;
1087 
1088  /* Check if tcd pool is full. */
1089  primask = DisableGlobalIRQ();
1090  tmpTcdUsed = handle->tcdUsed;
1091  tmpTcdSize = handle->tcdSize;
1092  if (tmpTcdUsed >= tmpTcdSize)
1093  {
1094  EnableGlobalIRQ(primask);
1095 
1096  return kStatus_EDMA_QueueFull;
1097  }
1098  currentTcd = handle->tail;
1099  handle->tcdUsed++;
1100  /* Calculate index of next TCD */
1101  nextTcd = currentTcd + 1;
1102  if (nextTcd == handle->tcdSize)
1103  {
1104  nextTcd = 0;
1105  }
1106  /* Advance queue tail index */
1107  handle->tail = nextTcd;
1108  EnableGlobalIRQ(primask);
1109  /* Calculate index of previous TCD */
1110  previousTcd = currentTcd != 0 ? currentTcd - 1 : (handle->tcdSize - 1);
1111  /* Configure current TCD block. */
1112  EDMA_TcdReset(&handle->tcdPool[currentTcd]);
1113  EDMA_TcdSetTransferConfig(&handle->tcdPool[currentTcd], config, NULL);
1114  /* Enable major interrupt */
1115  handle->tcdPool[currentTcd].CSR |= DMA_CSR_INTMAJOR_MASK;
1116  /* Link current TCD with next TCD for identification of current TCD */
1117  handle->tcdPool[currentTcd].DLAST_SGA = (uint32_t)&handle->tcdPool[nextTcd];
1118  /* Chain from previous descriptor unless tcd pool size is 1(this descriptor is its own predecessor). */
1119  if (currentTcd != previousTcd)
1120  {
1121  /* Enable scatter/gather feature in the previous TCD block. */
1122  csr = handle->tcdPool[previousTcd].CSR | ((uint16_t)DMA_CSR_ESG_MASK);
1123  csr &= ~((uint16_t)DMA_CSR_DREQ_MASK);
1124  handle->tcdPool[previousTcd].CSR = csr;
1125  /*
1126  Check if the TCD block in the registers is the previous one (points to current TCD block). It
1127  is used to check if the previous TCD linked has been loaded in TCD register. If so, it need to
1128  link the TCD register in case link the current TCD with the dead chain when TCD loading occurs
1129  before link the previous TCD block.
1130  */
1131  if (tcdRegs->DLAST_SGA == (uint32_t)&handle->tcdPool[currentTcd])
1132  {
1133  /* Clear the DREQ bits for the dynamic scatter gather */
1134  tcdRegs->CSR |= DMA_CSR_DREQ_MASK;
1135  /* Enable scatter/gather also in the TCD registers. */
1136  csr = tcdRegs->CSR | DMA_CSR_ESG_MASK;
1137  /* Must write the CSR register one-time, because the transfer maybe finished anytime. */
1138  tcdRegs->CSR = csr;
1139  /*
1140  It is very important to check the ESG bit!
1141  Because this hardware design: if DONE bit is set, the ESG bit can not be set. So it can
1142  be used to check if the dynamic TCD link operation is successful. If ESG bit is not set
1143  and the DLAST_SGA is not the next TCD address(it means the dynamic TCD link succeed and
1144  the current TCD block has been loaded into TCD registers), it means transfer finished
1145  and TCD link operation fail, so must install TCD content into TCD registers and enable
1146  transfer again. And if ESG is set, it means transfer has not finished, so TCD dynamic
1147  link succeed.
1148  */
1149  if (0U != (tcdRegs->CSR & DMA_CSR_ESG_MASK))
1150  {
1151  tcdRegs->CSR &= ~(uint16_t)DMA_CSR_DREQ_MASK;
1152  return kStatus_Success;
1153  }
1154  /*
1155  Check whether the current TCD block is already loaded in the TCD registers. It is another
1156  condition when ESG bit is not set: it means the dynamic TCD link succeed and the current
1157  TCD block has been loaded into TCD registers.
1158  */
1159  if (tcdRegs->DLAST_SGA == (uint32_t)&handle->tcdPool[nextTcd])
1160  {
1161  return kStatus_Success;
1162  }
1163  /*
1164  If go to this, means the previous transfer finished, and the DONE bit is set.
1165  So shall configure TCD registers.
1166  */
1167  }
1168  else if (tcdRegs->DLAST_SGA != 0UL)
1169  {
1170  /* The current TCD block has been linked successfully. */
1171  return kStatus_Success;
1172  }
1173  else
1174  {
1175  /*
1176  DLAST_SGA is 0 and it means the first submit transfer, so shall configure
1177  TCD registers.
1178  */
1179  }
1180  }
1181  /* There is no live chain, TCD block need to be installed in TCD registers. */
1182  EDMA_InstallTCD(handle->base, handle->channel, &handle->tcdPool[currentTcd]);
1183  /* Enable channel request again. */
1184  if (0U != (handle->flags & EDMA_TRANSFER_ENABLED_MASK))
1185  {
1186  handle->base->SERQ = DMA_SERQ_SERQ(handle->channel);
1187  }
1188 
1189  return kStatus_Success;
1190  }
1191 }
1192 
1202 {
1203  assert(handle != NULL);
1204  uint32_t tmpCSR = 0;
1205 
1206  if (handle->tcdPool == NULL)
1207  {
1208  handle->base->SERQ = DMA_SERQ_SERQ(handle->channel);
1209  }
1210  else /* Use the TCD queue. */
1211  {
1212  uint32_t primask;
1213  edma_tcd_t *tcdRegs = (edma_tcd_t *)(uint32_t)&handle->base->TCD[handle->channel];
1214 
1215  handle->flags |= EDMA_TRANSFER_ENABLED_MASK;
1216 
1217  /* Check if there was at least one descriptor submitted since reset (TCD in registers is valid) */
1218  if (tcdRegs->DLAST_SGA != 0U)
1219  {
1220  primask = DisableGlobalIRQ();
1221  /* Check if channel request is actually disable. */
1222  if ((handle->base->ERQ & ((uint32_t)1U << handle->channel)) == 0U)
1223  {
1224  /* Check if transfer is paused. */
1225  tmpCSR = tcdRegs->CSR;
1226  if ((0U == (tmpCSR & DMA_CSR_DONE_MASK)) || (0U != (tmpCSR & DMA_CSR_ESG_MASK)))
1227  {
1228  /*
1229  Re-enable channel request must be as soon as possible, so must put it into
1230  critical section to avoid task switching or interrupt service routine.
1231  */
1232  handle->base->SERQ = DMA_SERQ_SERQ(handle->channel);
1233  }
1234  }
1235  EnableGlobalIRQ(primask);
1236  }
1237  }
1238 }
1239 
1249 {
1250  assert(handle != NULL);
1251 
1252  handle->flags &= (~(uint8_t)EDMA_TRANSFER_ENABLED_MASK);
1253  handle->base->CERQ = DMA_CERQ_CERQ(handle->channel);
1254 }
1255 
1265 {
1266  handle->base->CERQ = DMA_CERQ_CERQ(handle->channel);
1267  /*
1268  Clear CSR to release channel. Because if the given channel started transfer,
1269  CSR will be not zero. Because if it is the last transfer, DREQ will be set.
1270  If not, ESG will be set.
1271  */
1272  handle->base->TCD[handle->channel].CSR = 0;
1273  /* Cancel all next TCD transfer. */
1274  handle->base->TCD[handle->channel].DLAST_SGA = 0;
1275 
1276  /* Handle the tcd */
1277  if (handle->tcdPool != NULL)
1278  {
1279  handle->header = 0;
1280  handle->tail = 0;
1281  handle->tcdUsed = 0;
1282  }
1283 }
1284 
1314 {
1315  assert(handle != NULL);
1316 
1317  bool transfer_done;
1318 
1319  /* Clear EDMA interrupt flag */
1320  handle->base->CINT = handle->channel;
1321  /* Check if transfer is already finished. */
1322  transfer_done = ((handle->base->TCD[handle->channel].CSR & DMA_CSR_DONE_MASK) != 0U);
1323 
1324  if (handle->tcdPool == NULL)
1325  {
1326  if (handle->callback != NULL)
1327  {
1328  (handle->callback)(handle, handle->userData, transfer_done, 0);
1329  }
1330  }
1331  else /* Use the TCD queue. Please refer to the API descriptions in the eDMA header file for detailed information. */
1332  {
1333  uint32_t sga = handle->base->TCD[handle->channel].DLAST_SGA;
1334  uint32_t sga_index;
1335  int32_t tcds_done;
1336  uint8_t new_header;
1337 
1338  /* Get the offset of the next transfer TCD blocks to be loaded into the eDMA engine. */
1339  sga -= (uint32_t)handle->tcdPool;
1340  /* Get the index of the next transfer TCD blocks to be loaded into the eDMA engine. */
1341  sga_index = sga / sizeof(edma_tcd_t);
1342  /* Adjust header positions. */
1343  if (transfer_done)
1344  {
1345  /* New header shall point to the next TCD to be loaded (current one is already finished) */
1346  new_header = (uint8_t)sga_index;
1347  }
1348  else
1349  {
1350  /* New header shall point to this descriptor currently loaded (not finished yet) */
1351  new_header = sga_index != 0U ? (uint8_t)sga_index - 1U : (uint8_t)handle->tcdSize - 1U;
1352  }
1353  /* Calculate the number of finished TCDs */
1354  if (new_header == (uint8_t)handle->header)
1355  {
1356  int8_t tmpTcdUsed = handle->tcdUsed;
1357  int8_t tmpTcdSize = handle->tcdSize;
1358 
1359  if (tmpTcdUsed == tmpTcdSize)
1360  {
1361  tcds_done = handle->tcdUsed;
1362  }
1363  else
1364  {
1365  /* No TCD in the memory are going to be loaded or internal error occurs. */
1366  tcds_done = 0;
1367  }
1368  }
1369  else
1370  {
1371  tcds_done = (int32_t)new_header - (int32_t)handle->header;
1372  if (tcds_done < 0)
1373  {
1374  tcds_done += handle->tcdSize;
1375  }
1376  }
1377  /* Advance header which points to the TCD to be loaded into the eDMA engine from memory. */
1378  handle->header = (int8_t)new_header;
1379  /* Release TCD blocks. tcdUsed is the TCD number which can be used/loaded in the memory pool. */
1380  handle->tcdUsed -= (int8_t)tcds_done;
1381  /* Invoke callback function. */
1382  if (NULL != handle->callback)
1383  {
1384  (handle->callback)(handle, handle->userData, transfer_done, tcds_done);
1385  }
1386 
1387  /* clear the DONE bit here is meaningful for below cases:
1388  *1.A new TCD has been loaded to EDMA already:
1389  * need to clear the DONE bit in the IRQ handler to avoid TCD in EDMA been overwritten
1390  * if peripheral request isn't coming before next transfer request.
1391  *2.A new TCD has not been loaded to EDMA:
1392  * for the case that transfer request occur in the privious edma callback, this is a case that doesn't
1393  * need scatter gather, so keep DONE bit during the next transfer request will re-install the TCD.
1394  */
1395  if (transfer_done)
1396  {
1397  handle->base->CDNE = handle->channel;
1398  }
1399  }
1400 }
1401 
1402 #if defined(FSL_FEATURE_EDMA_MODULE_CHANNEL_IRQ_ENTRY_SHARED_OFFSET) && \
1403  (FSL_FEATURE_EDMA_MODULE_CHANNEL_IRQ_ENTRY_SHARED_OFFSET == 4)
1404 /* 8 channels (Shared): kl28 */
1405 #if defined(FSL_FEATURE_EDMA_MODULE_CHANNEL) && (FSL_FEATURE_EDMA_MODULE_CHANNEL == 8U)
1406 
1407 #if defined(DMA0)
1408 void DMA0_04_DriverIRQHandler(void)
1409 {
1410  if ((EDMA_GetChannelStatusFlags(DMA0, 0U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1411  {
1413  }
1414  if ((EDMA_GetChannelStatusFlags(DMA0, 4U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1415  {
1417  }
1419 }
1420 
1421 void DMA0_15_DriverIRQHandler(void)
1422 {
1423  if ((EDMA_GetChannelStatusFlags(DMA0, 1U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1424  {
1426  }
1427  if ((EDMA_GetChannelStatusFlags(DMA0, 5U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1428  {
1430  }
1432 }
1433 
1434 void DMA0_26_DriverIRQHandler(void)
1435 {
1436  if ((EDMA_GetChannelStatusFlags(DMA0, 2U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1437  {
1439  }
1440  if ((EDMA_GetChannelStatusFlags(DMA0, 6U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1441  {
1443  }
1445 }
1446 
1447 void DMA0_37_DriverIRQHandler(void)
1448 {
1449  if ((EDMA_GetChannelStatusFlags(DMA0, 3U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1450  {
1452  }
1453  if ((EDMA_GetChannelStatusFlags(DMA0, 7U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1454  {
1456  }
1458 }
1459 #endif
1460 
1461 #if defined(DMA1)
1462 
1463 #if defined(DMA0)
1464 void DMA1_04_DriverIRQHandler(void)
1465 {
1466  if ((EDMA_GetChannelStatusFlags(DMA1, 0U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1467  {
1469  }
1470  if ((EDMA_GetChannelStatusFlags(DMA1, 4U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1471  {
1473  }
1475 }
1476 
1477 void DMA1_15_DriverIRQHandler(void)
1478 {
1479  if ((EDMA_GetChannelStatusFlags(DMA1, 1U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1480  {
1482  }
1483  if ((EDMA_GetChannelStatusFlags(DMA1, 5U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1484  {
1486  }
1488 }
1489 
1490 void DMA1_26_DriverIRQHandler(void)
1491 {
1492  if ((EDMA_GetChannelStatusFlags(DMA1, 2U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1493  {
1495  }
1496  if ((EDMA_GetChannelStatusFlags(DMA1, 6U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1497  {
1499  }
1501 }
1502 
1503 void DMA1_37_DriverIRQHandler(void)
1504 {
1505  if ((EDMA_GetChannelStatusFlags(DMA1, 3U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1506  {
1508  }
1509  if ((EDMA_GetChannelStatusFlags(DMA1, 7U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1510  {
1512  }
1514 }
1515 
1516 #else
1517 void DMA1_04_DriverIRQHandler(void)
1518 {
1519  if ((EDMA_GetChannelStatusFlags(DMA1, 0U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1520  {
1522  }
1523  if ((EDMA_GetChannelStatusFlags(DMA1, 4U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1524  {
1526  }
1528 }
1529 
1530 void DMA1_15_DriverIRQHandler(void)
1531 {
1532  if ((EDMA_GetChannelStatusFlags(DMA1, 1U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1533  {
1535  }
1536  if ((EDMA_GetChannelStatusFlags(DMA1, 5U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1537  {
1539  }
1541 }
1542 
1543 void DMA1_26_DriverIRQHandler(void)
1544 {
1545  if ((EDMA_GetChannelStatusFlags(DMA1, 2U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1546  {
1548  }
1549  if ((EDMA_GetChannelStatusFlags(DMA1, 6U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1550  {
1552  }
1554 }
1555 
1556 void DMA1_37_DriverIRQHandler(void)
1557 {
1558  if ((EDMA_GetChannelStatusFlags(DMA1, 3U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1559  {
1561  }
1562  if ((EDMA_GetChannelStatusFlags(DMA1, 7U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1563  {
1565  }
1567 }
1568 #endif
1569 #endif
1570 #endif /* 8 channels (Shared) */
1571 #endif /* FSL_FEATURE_EDMA_MODULE_CHANNEL_IRQ_ENTRY_SHARED_OFFSET */
1572 
1573 #if defined(FSL_FEATURE_EDMA_MODULE_CHANNEL_IRQ_ENTRY_SHARED_OFFSET) && \
1574  (FSL_FEATURE_EDMA_MODULE_CHANNEL_IRQ_ENTRY_SHARED_OFFSET == 8)
1575 /* 16 channels (Shared): K32H844P */
1576 #if defined(FSL_FEATURE_EDMA_MODULE_CHANNEL) && (FSL_FEATURE_EDMA_MODULE_CHANNEL == 16U)
1577 
1578 void DMA0_08_DriverIRQHandler(void)
1579 {
1580  if ((EDMA_GetChannelStatusFlags(DMA0, 0U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1581  {
1583  }
1584  if ((EDMA_GetChannelStatusFlags(DMA0, 8U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1585  {
1587  }
1589 }
1590 
1591 void DMA0_19_DriverIRQHandler(void)
1592 {
1593  if ((EDMA_GetChannelStatusFlags(DMA0, 1U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1594  {
1596  }
1597  if ((EDMA_GetChannelStatusFlags(DMA0, 9U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1598  {
1600  }
1602 }
1603 
1604 void DMA0_210_DriverIRQHandler(void)
1605 {
1606  if ((EDMA_GetChannelStatusFlags(DMA0, 2U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1607  {
1609  }
1610  if ((EDMA_GetChannelStatusFlags(DMA0, 10U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1611  {
1613  }
1615 }
1616 
1617 void DMA0_311_DriverIRQHandler(void)
1618 {
1619  if ((EDMA_GetChannelStatusFlags(DMA0, 3U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1620  {
1622  }
1623  if ((EDMA_GetChannelStatusFlags(DMA0, 11U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1624  {
1626  }
1628 }
1629 
1630 void DMA0_412_DriverIRQHandler(void)
1631 {
1632  if ((EDMA_GetChannelStatusFlags(DMA0, 4U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1633  {
1635  }
1636  if ((EDMA_GetChannelStatusFlags(DMA0, 12U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1637  {
1639  }
1641 }
1642 
1643 void DMA0_513_DriverIRQHandler(void)
1644 {
1645  if ((EDMA_GetChannelStatusFlags(DMA0, 5U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1646  {
1648  }
1649  if ((EDMA_GetChannelStatusFlags(DMA0, 13U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1650  {
1652  }
1654 }
1655 
1656 void DMA0_614_DriverIRQHandler(void)
1657 {
1658  if ((EDMA_GetChannelStatusFlags(DMA0, 6U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1659  {
1661  }
1662  if ((EDMA_GetChannelStatusFlags(DMA0, 14U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1663  {
1665  }
1667 }
1668 
1669 void DMA0_715_DriverIRQHandler(void)
1670 {
1671  if ((EDMA_GetChannelStatusFlags(DMA0, 7U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1672  {
1674  }
1675  if ((EDMA_GetChannelStatusFlags(DMA0, 15U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1676  {
1678  }
1680 }
1681 
1682 #if defined(DMA1)
1683 void DMA1_08_DriverIRQHandler(void)
1684 {
1685  if ((EDMA_GetChannelStatusFlags(DMA1, 0U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1686  {
1688  }
1689  if ((EDMA_GetChannelStatusFlags(DMA1, 8U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1690  {
1692  }
1694 }
1695 
1696 void DMA1_19_DriverIRQHandler(void)
1697 {
1698  if ((EDMA_GetChannelStatusFlags(DMA1, 1U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1699  {
1701  }
1702  if ((EDMA_GetChannelStatusFlags(DMA1, 9U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1703  {
1705  }
1707 }
1708 
1709 void DMA1_210_DriverIRQHandler(void)
1710 {
1711  if ((EDMA_GetChannelStatusFlags(DMA1, 2U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1712  {
1714  }
1715  if ((EDMA_GetChannelStatusFlags(DMA1, 10U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1716  {
1718  }
1720 }
1721 
1722 void DMA1_311_DriverIRQHandler(void)
1723 {
1724  if ((EDMA_GetChannelStatusFlags(DMA1, 3U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1725  {
1727  }
1728  if ((EDMA_GetChannelStatusFlags(DMA1, 11U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1729  {
1731  }
1733 }
1734 
1735 void DMA1_412_DriverIRQHandler(void)
1736 {
1737  if ((EDMA_GetChannelStatusFlags(DMA1, 4U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1738  {
1740  }
1741  if ((EDMA_GetChannelStatusFlags(DMA1, 12U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1742  {
1744  }
1746 }
1747 
1748 void DMA1_513_DriverIRQHandler(void)
1749 {
1750  if ((EDMA_GetChannelStatusFlags(DMA1, 5U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1751  {
1753  }
1754  if ((EDMA_GetChannelStatusFlags(DMA1, 13U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1755  {
1757  }
1759 }
1760 
1761 void DMA1_614_DriverIRQHandler(void)
1762 {
1763  if ((EDMA_GetChannelStatusFlags(DMA1, 6U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1764  {
1766  }
1767  if ((EDMA_GetChannelStatusFlags(DMA1, 14U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1768  {
1770  }
1772 }
1773 
1774 void DMA1_715_DriverIRQHandler(void)
1775 {
1776  if ((EDMA_GetChannelStatusFlags(DMA1, 7U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1777  {
1779  }
1780  if ((EDMA_GetChannelStatusFlags(DMA1, 15U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1781  {
1783  }
1785 }
1786 #endif
1787 #endif /* 16 channels (Shared) */
1788 #endif /* FSL_FEATURE_EDMA_MODULE_CHANNEL_IRQ_ENTRY_SHARED_OFFSET */
1789 
1790 #if defined(FSL_FEATURE_EDMA_MODULE_CHANNEL_IRQ_ENTRY_SHARED_OFFSET) && \
1791  (FSL_FEATURE_EDMA_MODULE_CHANNEL_IRQ_ENTRY_SHARED_OFFSET == 16)
1792 /* 32 channels (Shared): k80 */
1793 #if defined(FSL_FEATURE_EDMA_MODULE_CHANNEL) && FSL_FEATURE_EDMA_MODULE_CHANNEL == 32U
1794 #if defined(DMA0) && !(defined(DMA1))
1795 void DMA0_DMA16_DriverIRQHandler(void)
1796 {
1797  if ((EDMA_GetChannelStatusFlags(DMA0, 0U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1798  {
1800  }
1801  if ((EDMA_GetChannelStatusFlags(DMA0, 16U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1802  {
1804  }
1806 }
1807 
1808 void DMA1_DMA17_DriverIRQHandler(void)
1809 {
1810  if ((EDMA_GetChannelStatusFlags(DMA0, 1U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1811  {
1813  }
1814  if ((EDMA_GetChannelStatusFlags(DMA0, 17U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1815  {
1817  }
1819 }
1820 
1821 void DMA2_DMA18_DriverIRQHandler(void)
1822 {
1823  if ((EDMA_GetChannelStatusFlags(DMA0, 2U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1824  {
1826  }
1827  if ((EDMA_GetChannelStatusFlags(DMA0, 18U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1828  {
1830  }
1832 }
1833 
1834 void DMA3_DMA19_DriverIRQHandler(void)
1835 {
1836  if ((EDMA_GetChannelStatusFlags(DMA0, 3U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1837  {
1839  }
1840  if ((EDMA_GetChannelStatusFlags(DMA0, 19U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1841  {
1843  }
1845 }
1846 
1847 void DMA4_DMA20_DriverIRQHandler(void)
1848 {
1849  if ((EDMA_GetChannelStatusFlags(DMA0, 4U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1850  {
1852  }
1853  if ((EDMA_GetChannelStatusFlags(DMA0, 20U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1854  {
1856  }
1858 }
1859 
1860 void DMA5_DMA21_DriverIRQHandler(void)
1861 {
1862  if ((EDMA_GetChannelStatusFlags(DMA0, 5U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1863  {
1865  }
1866  if ((EDMA_GetChannelStatusFlags(DMA0, 21U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1867  {
1869  }
1871 }
1872 
1873 void DMA6_DMA22_DriverIRQHandler(void)
1874 {
1875  if ((EDMA_GetChannelStatusFlags(DMA0, 6U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1876  {
1878  }
1879  if ((EDMA_GetChannelStatusFlags(DMA0, 22U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1880  {
1882  }
1884 }
1885 
1886 void DMA7_DMA23_DriverIRQHandler(void)
1887 {
1888  if ((EDMA_GetChannelStatusFlags(DMA0, 7U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1889  {
1891  }
1892  if ((EDMA_GetChannelStatusFlags(DMA0, 23U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1893  {
1895  }
1897 }
1898 
1899 void DMA8_DMA24_DriverIRQHandler(void)
1900 {
1901  if ((EDMA_GetChannelStatusFlags(DMA0, 8U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1902  {
1904  }
1905  if ((EDMA_GetChannelStatusFlags(DMA0, 24U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1906  {
1908  }
1910 }
1911 
1912 void DMA9_DMA25_DriverIRQHandler(void)
1913 {
1914  if ((EDMA_GetChannelStatusFlags(DMA0, 9U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1915  {
1917  }
1918  if ((EDMA_GetChannelStatusFlags(DMA0, 25U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1919  {
1921  }
1923 }
1924 
1925 void DMA10_DMA26_DriverIRQHandler(void)
1926 {
1927  if ((EDMA_GetChannelStatusFlags(DMA0, 10U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1928  {
1930  }
1931  if ((EDMA_GetChannelStatusFlags(DMA0, 26U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1932  {
1934  }
1936 }
1937 
1938 void DMA11_DMA27_DriverIRQHandler(void)
1939 {
1940  if ((EDMA_GetChannelStatusFlags(DMA0, 11U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1941  {
1943  }
1944  if ((EDMA_GetChannelStatusFlags(DMA0, 27U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1945  {
1947  }
1949 }
1950 
1951 void DMA12_DMA28_DriverIRQHandler(void)
1952 {
1953  if ((EDMA_GetChannelStatusFlags(DMA0, 12U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1954  {
1956  }
1957  if ((EDMA_GetChannelStatusFlags(DMA0, 28U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1958  {
1960  }
1962 }
1963 
1964 void DMA13_DMA29_DriverIRQHandler(void)
1965 {
1966  if ((EDMA_GetChannelStatusFlags(DMA0, 13U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1967  {
1969  }
1970  if ((EDMA_GetChannelStatusFlags(DMA0, 29U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1971  {
1973  }
1975 }
1976 
1977 void DMA14_DMA30_DriverIRQHandler(void)
1978 {
1979  if ((EDMA_GetChannelStatusFlags(DMA0, 14U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1980  {
1982  }
1983  if ((EDMA_GetChannelStatusFlags(DMA0, 30U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1984  {
1986  }
1988 }
1989 
1990 void DMA15_DMA31_DriverIRQHandler(void)
1991 {
1992  if ((EDMA_GetChannelStatusFlags(DMA0, 15U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1993  {
1995  }
1996  if ((EDMA_GetChannelStatusFlags(DMA0, 31U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
1997  {
1999  }
2001 }
2002 
2003 #else
2004 void DMA0_0_16_DriverIRQHandler(void)
2005 {
2006  if ((EDMA_GetChannelStatusFlags(DMA0, 0U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2007  {
2009  }
2010  if ((EDMA_GetChannelStatusFlags(DMA0, 16U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2011  {
2013  }
2015 }
2016 
2017 void DMA0_1_17_DriverIRQHandler(void)
2018 {
2019  if ((EDMA_GetChannelStatusFlags(DMA0, 1U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2020  {
2022  }
2023  if ((EDMA_GetChannelStatusFlags(DMA0, 17U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2024  {
2026  }
2028 }
2029 
2030 void DMA0_2_18_DriverIRQHandler(void)
2031 {
2032  if ((EDMA_GetChannelStatusFlags(DMA0, 2U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2033  {
2035  }
2036  if ((EDMA_GetChannelStatusFlags(DMA0, 18U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2037  {
2039  }
2041 }
2042 
2043 void DMA0_3_19_DriverIRQHandler(void)
2044 {
2045  if ((EDMA_GetChannelStatusFlags(DMA0, 3U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2046  {
2048  }
2049  if ((EDMA_GetChannelStatusFlags(DMA0, 19U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2050  {
2052  }
2054 }
2055 
2056 void DMA0_4_20_DriverIRQHandler(void)
2057 {
2058  if ((EDMA_GetChannelStatusFlags(DMA0, 4U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2059  {
2061  }
2062  if ((EDMA_GetChannelStatusFlags(DMA0, 20U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2063  {
2065  }
2067 }
2068 
2069 void DMA0_5_21_DriverIRQHandler(void)
2070 {
2071  if ((EDMA_GetChannelStatusFlags(DMA0, 5U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2072  {
2074  }
2075  if ((EDMA_GetChannelStatusFlags(DMA0, 21U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2076  {
2078  }
2080 }
2081 
2082 void DMA0_6_22_DriverIRQHandler(void)
2083 {
2084  if ((EDMA_GetChannelStatusFlags(DMA0, 6U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2085  {
2087  }
2088  if ((EDMA_GetChannelStatusFlags(DMA0, 22U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2089  {
2091  }
2093 }
2094 
2095 void DMA0_7_23_DriverIRQHandler(void)
2096 {
2097  if ((EDMA_GetChannelStatusFlags(DMA0, 7U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2098  {
2100  }
2101  if ((EDMA_GetChannelStatusFlags(DMA0, 23U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2102  {
2104  }
2106 }
2107 
2108 void DMA0_8_24_DriverIRQHandler(void)
2109 {
2110  if ((EDMA_GetChannelStatusFlags(DMA0, 8U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2111  {
2113  }
2114  if ((EDMA_GetChannelStatusFlags(DMA0, 24U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2115  {
2117  }
2119 }
2120 
2121 void DMA0_9_25_DriverIRQHandler(void)
2122 {
2123  if ((EDMA_GetChannelStatusFlags(DMA0, 9U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2124  {
2126  }
2127  if ((EDMA_GetChannelStatusFlags(DMA0, 25U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2128  {
2130  }
2132 }
2133 
2134 void DMA0_10_26_DriverIRQHandler(void)
2135 {
2136  if ((EDMA_GetChannelStatusFlags(DMA0, 10U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2137  {
2139  }
2140  if ((EDMA_GetChannelStatusFlags(DMA0, 26U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2141  {
2143  }
2145 }
2146 
2147 void DMA0_11_27_DriverIRQHandler(void)
2148 {
2149  if ((EDMA_GetChannelStatusFlags(DMA0, 11U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2150  {
2152  }
2153  if ((EDMA_GetChannelStatusFlags(DMA0, 27U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2154  {
2156  }
2158 }
2159 
2160 void DMA0_12_28_DriverIRQHandler(void)
2161 {
2162  if ((EDMA_GetChannelStatusFlags(DMA0, 12U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2163  {
2165  }
2166  if ((EDMA_GetChannelStatusFlags(DMA0, 28U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2167  {
2169  }
2171 }
2172 
2173 void DMA0_13_29_DriverIRQHandler(void)
2174 {
2175  if ((EDMA_GetChannelStatusFlags(DMA0, 13U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2176  {
2178  }
2179  if ((EDMA_GetChannelStatusFlags(DMA0, 29U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2180  {
2182  }
2184 }
2185 
2186 void DMA0_14_30_DriverIRQHandler(void)
2187 {
2188  if ((EDMA_GetChannelStatusFlags(DMA0, 14U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2189  {
2191  }
2192  if ((EDMA_GetChannelStatusFlags(DMA0, 30U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2193  {
2195  }
2197 }
2198 
2199 void DMA0_15_31_DriverIRQHandler(void)
2200 {
2201  if ((EDMA_GetChannelStatusFlags(DMA0, 15U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2202  {
2204  }
2205  if ((EDMA_GetChannelStatusFlags(DMA0, 31U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2206  {
2208  }
2210 }
2211 
2212 void DMA1_0_16_DriverIRQHandler(void)
2213 {
2214  if ((EDMA_GetChannelStatusFlags(DMA1, 0U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2215  {
2217  }
2218  if ((EDMA_GetChannelStatusFlags(DMA1, 16U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2219  {
2221  }
2223 }
2224 
2225 void DMA1_1_17_DriverIRQHandler(void)
2226 {
2227  if ((EDMA_GetChannelStatusFlags(DMA1, 1U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2228  {
2230  }
2231  if ((EDMA_GetChannelStatusFlags(DMA1, 17U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2232  {
2234  }
2236 }
2237 
2238 void DMA1_2_18_DriverIRQHandler(void)
2239 {
2240  if ((EDMA_GetChannelStatusFlags(DMA1, 2U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2241  {
2243  }
2244  if ((EDMA_GetChannelStatusFlags(DMA1, 18U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2245  {
2247  }
2249 }
2250 
2251 void DMA1_3_19_DriverIRQHandler(void)
2252 {
2253  if ((EDMA_GetChannelStatusFlags(DMA1, 3U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2254  {
2256  }
2257  if ((EDMA_GetChannelStatusFlags(DMA1, 19U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2258  {
2260  }
2262 }
2263 
2264 void DMA1_4_20_DriverIRQHandler(void)
2265 {
2266  if ((EDMA_GetChannelStatusFlags(DMA1, 4U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2267  {
2269  }
2270  if ((EDMA_GetChannelStatusFlags(DMA1, 20U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2271  {
2273  }
2275 }
2276 
2277 void DMA1_5_21_DriverIRQHandler(void)
2278 {
2279  if ((EDMA_GetChannelStatusFlags(DMA1, 5U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2280  {
2282  }
2283  if ((EDMA_GetChannelStatusFlags(DMA1, 21U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2284  {
2286  }
2288 }
2289 
2290 void DMA1_6_22_DriverIRQHandler(void)
2291 {
2292  if ((EDMA_GetChannelStatusFlags(DMA1, 6U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2293  {
2295  }
2296  if ((EDMA_GetChannelStatusFlags(DMA1, 22U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2297  {
2299  }
2301 }
2302 
2303 void DMA1_7_23_DriverIRQHandler(void)
2304 {
2305  if ((EDMA_GetChannelStatusFlags(DMA1, 7U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2306  {
2308  }
2309  if ((EDMA_GetChannelStatusFlags(DMA1, 23U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2310  {
2312  }
2314 }
2315 
2316 void DMA1_8_24_DriverIRQHandler(void)
2317 {
2318  if ((EDMA_GetChannelStatusFlags(DMA1, 8U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2319  {
2321  }
2322  if ((EDMA_GetChannelStatusFlags(DMA1, 24U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2323  {
2325  }
2327 }
2328 
2329 void DMA1_9_25_DriverIRQHandler(void)
2330 {
2331  if ((EDMA_GetChannelStatusFlags(DMA1, 9U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2332  {
2334  }
2335  if ((EDMA_GetChannelStatusFlags(DMA1, 25U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2336  {
2338  }
2340 }
2341 
2342 void DMA1_10_26_DriverIRQHandler(void)
2343 {
2344  if ((EDMA_GetChannelStatusFlags(DMA1, 10U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2345  {
2347  }
2348  if ((EDMA_GetChannelStatusFlags(DMA1, 26U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2349  {
2351  }
2353 }
2354 
2355 void DMA1_11_27_DriverIRQHandler(void)
2356 {
2357  if ((EDMA_GetChannelStatusFlags(DMA1, 11U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2358  {
2360  }
2361  if ((EDMA_GetChannelStatusFlags(DMA1, 27U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2362  {
2364  }
2366 }
2367 
2368 void DMA1_12_28_DriverIRQHandler(void)
2369 {
2370  if ((EDMA_GetChannelStatusFlags(DMA1, 12U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2371  {
2373  }
2374  if ((EDMA_GetChannelStatusFlags(DMA1, 28U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2375  {
2377  }
2379 }
2380 
2381 void DMA1_13_29_DriverIRQHandler(void)
2382 {
2383  if ((EDMA_GetChannelStatusFlags(DMA1, 13U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2384  {
2386  }
2387  if ((EDMA_GetChannelStatusFlags(DMA1, 29U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2388  {
2390  }
2392 }
2393 
2394 void DMA1_14_30_DriverIRQHandler(void)
2395 {
2396  if ((EDMA_GetChannelStatusFlags(DMA1, 14U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2397  {
2399  }
2400  if ((EDMA_GetChannelStatusFlags(DMA1, 30U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2401  {
2403  }
2405 }
2406 
2407 void DMA1_15_31_DriverIRQHandler(void)
2408 {
2409  if ((EDMA_GetChannelStatusFlags(DMA1, 15U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2410  {
2412  }
2413  if ((EDMA_GetChannelStatusFlags(DMA1, 31U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2414  {
2416  }
2418 }
2419 
2420 #endif
2421 #endif /* 32 channels (Shared) */
2422 #endif /* FSL_FEATURE_EDMA_MODULE_CHANNEL_IRQ_ENTRY_SHARED_OFFSET */
2423 
2424 #if defined(FSL_FEATURE_EDMA_MODULE_CHANNEL_IRQ_ENTRY_SHARED_OFFSET) && \
2425  (FSL_FEATURE_EDMA_MODULE_CHANNEL_IRQ_ENTRY_SHARED_OFFSET == 4)
2426 /* 32 channels (Shared): MCIMX7U5_M4 */
2427 #if defined(FSL_FEATURE_EDMA_MODULE_CHANNEL) && (FSL_FEATURE_EDMA_MODULE_CHANNEL == 32U)
2428 
2429 void DMA0_0_4_DriverIRQHandler(void)
2430 {
2431  if ((EDMA_GetChannelStatusFlags(DMA0, 0U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2432  {
2434  }
2435  if ((EDMA_GetChannelStatusFlags(DMA0, 4U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2436  {
2438  }
2440 }
2441 
2442 void DMA0_1_5_DriverIRQHandler(void)
2443 {
2444  if ((EDMA_GetChannelStatusFlags(DMA0, 1U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2445  {
2447  }
2448  if ((EDMA_GetChannelStatusFlags(DMA0, 5U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2449  {
2451  }
2453 }
2454 
2455 void DMA0_2_6_DriverIRQHandler(void)
2456 {
2457  if ((EDMA_GetChannelStatusFlags(DMA0, 2U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2458  {
2460  }
2461  if ((EDMA_GetChannelStatusFlags(DMA0, 6U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2462  {
2464  }
2466 }
2467 
2468 void DMA0_3_7_DriverIRQHandler(void)
2469 {
2470  if ((EDMA_GetChannelStatusFlags(DMA0, 3U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2471  {
2473  }
2474  if ((EDMA_GetChannelStatusFlags(DMA0, 7U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2475  {
2477  }
2479 }
2480 
2481 void DMA0_8_12_DriverIRQHandler(void)
2482 {
2483  if ((EDMA_GetChannelStatusFlags(DMA0, 8U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2484  {
2486  }
2487  if ((EDMA_GetChannelStatusFlags(DMA0, 12U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2488  {
2490  }
2492 }
2493 
2494 void DMA0_9_13_DriverIRQHandler(void)
2495 {
2496  if ((EDMA_GetChannelStatusFlags(DMA0, 9U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2497  {
2499  }
2500  if ((EDMA_GetChannelStatusFlags(DMA0, 13U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2501  {
2503  }
2505 }
2506 
2507 void DMA0_10_14_DriverIRQHandler(void)
2508 {
2509  if ((EDMA_GetChannelStatusFlags(DMA0, 10U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2510  {
2512  }
2513  if ((EDMA_GetChannelStatusFlags(DMA0, 14U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2514  {
2516  }
2518 }
2519 
2520 void DMA0_11_15_DriverIRQHandler(void)
2521 {
2522  if ((EDMA_GetChannelStatusFlags(DMA0, 11U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2523  {
2525  }
2526  if ((EDMA_GetChannelStatusFlags(DMA0, 15U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2527  {
2529  }
2531 }
2532 
2533 void DMA0_16_20_DriverIRQHandler(void)
2534 {
2535  if ((EDMA_GetChannelStatusFlags(DMA0, 16U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2536  {
2538  }
2539  if ((EDMA_GetChannelStatusFlags(DMA0, 20U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2540  {
2542  }
2544 }
2545 
2546 void DMA0_17_21_DriverIRQHandler(void)
2547 {
2548  if ((EDMA_GetChannelStatusFlags(DMA0, 17U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2549  {
2551  }
2552  if ((EDMA_GetChannelStatusFlags(DMA0, 21U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2553  {
2555  }
2557 }
2558 
2559 void DMA0_18_22_DriverIRQHandler(void)
2560 {
2561  if ((EDMA_GetChannelStatusFlags(DMA0, 18U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2562  {
2564  }
2565  if ((EDMA_GetChannelStatusFlags(DMA0, 22U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2566  {
2568  }
2570 }
2571 
2572 void DMA0_19_23_DriverIRQHandler(void)
2573 {
2574  if ((EDMA_GetChannelStatusFlags(DMA0, 19U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2575  {
2577  }
2578  if ((EDMA_GetChannelStatusFlags(DMA0, 23U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2579  {
2581  }
2583 }
2584 
2585 void DMA0_24_28_DriverIRQHandler(void)
2586 {
2587  if ((EDMA_GetChannelStatusFlags(DMA0, 24U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2588  {
2590  }
2591  if ((EDMA_GetChannelStatusFlags(DMA0, 28U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2592  {
2594  }
2596 }
2597 
2598 void DMA0_25_29_DriverIRQHandler(void)
2599 {
2600  if ((EDMA_GetChannelStatusFlags(DMA0, 25U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2601  {
2603  }
2604  if ((EDMA_GetChannelStatusFlags(DMA0, 29U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2605  {
2607  }
2609 }
2610 
2611 void DMA0_26_30_DriverIRQHandler(void)
2612 {
2613  if ((EDMA_GetChannelStatusFlags(DMA0, 26U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2614  {
2616  }
2617  if ((EDMA_GetChannelStatusFlags(DMA0, 30U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2618  {
2620  }
2622 }
2623 
2624 void DMA0_27_31_DriverIRQHandler(void)
2625 {
2626  if ((EDMA_GetChannelStatusFlags(DMA0, 27U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2627  {
2629  }
2630  if ((EDMA_GetChannelStatusFlags(DMA0, 31U) & (uint32_t)kEDMA_InterruptFlag) != 0U)
2631  {
2633  }
2635 }
2636 #endif /* 32 channels (Shared): MCIMX7U5 */
2637 #endif /* FSL_FEATURE_EDMA_MODULE_CHANNEL_IRQ_ENTRY_SHARED_OFFSET */
2638 
2639 #if defined(FSL_FEATURE_EDMA_MODULE_CHANNEL_IRQ_ENTRY_SHARED_OFFSET) && \
2640  (FSL_FEATURE_EDMA_MODULE_CHANNEL_IRQ_ENTRY_SHARED_OFFSET == 0)
2641 /* 4 channels (No Shared): kv10 */
2642 #if defined(FSL_FEATURE_EDMA_MODULE_CHANNEL) && (FSL_FEATURE_EDMA_MODULE_CHANNEL > 0)
2643 
2644 void DMA0_DriverIRQHandler(void)
2645 {
2648 }
2649 
2650 void DMA1_DriverIRQHandler(void)
2651 {
2654 }
2655 
2656 void DMA2_DriverIRQHandler(void)
2657 {
2660 }
2661 
2662 void DMA3_DriverIRQHandler(void)
2663 {
2666 }
2667 
2668 /* 8 channels (No Shared) */
2669 #if defined(FSL_FEATURE_EDMA_MODULE_CHANNEL) && (FSL_FEATURE_EDMA_MODULE_CHANNEL > 4U)
2670 
2671 void DMA4_DriverIRQHandler(void)
2672 {
2675 }
2676 
2677 void DMA5_DriverIRQHandler(void)
2678 {
2681 }
2682 
2683 void DMA6_DriverIRQHandler(void)
2684 {
2687 }
2688 
2689 void DMA7_DriverIRQHandler(void)
2690 {
2693 }
2694 #endif /* FSL_FEATURE_EDMA_MODULE_CHANNEL == 8 */
2695 
2696 /* 16 channels (No Shared) */
2697 #if defined(FSL_FEATURE_EDMA_MODULE_CHANNEL) && (FSL_FEATURE_EDMA_MODULE_CHANNEL > 8U)
2698 
2699 void DMA8_DriverIRQHandler(void)
2700 {
2703 }
2704 
2705 void DMA9_DriverIRQHandler(void)
2706 {
2709 }
2710 
2711 void DMA10_DriverIRQHandler(void)
2712 {
2715 }
2716 
2717 void DMA11_DriverIRQHandler(void)
2718 {
2721 }
2722 
2723 void DMA12_DriverIRQHandler(void)
2724 {
2727 }
2728 
2729 void DMA13_DriverIRQHandler(void)
2730 {
2733 }
2734 
2735 void DMA14_DriverIRQHandler(void)
2736 {
2739 }
2740 
2741 void DMA15_DriverIRQHandler(void)
2742 {
2745 }
2746 #endif /* FSL_FEATURE_EDMA_MODULE_CHANNEL == 16 */
2747 
2748 /* 32 channels (No Shared) */
2749 #if defined(FSL_FEATURE_EDMA_MODULE_CHANNEL) && (FSL_FEATURE_EDMA_MODULE_CHANNEL > 16U)
2750 
2751 void DMA16_DriverIRQHandler(void)
2752 {
2755 }
2756 
2757 void DMA17_DriverIRQHandler(void)
2758 {
2761 }
2762 
2763 void DMA18_DriverIRQHandler(void)
2764 {
2767 }
2768 
2769 void DMA19_DriverIRQHandler(void)
2770 {
2773 }
2774 
2775 void DMA20_DriverIRQHandler(void)
2776 {
2779 }
2780 
2781 void DMA21_DriverIRQHandler(void)
2782 {
2785 }
2786 
2787 void DMA22_DriverIRQHandler(void)
2788 {
2791 }
2792 
2793 void DMA23_DriverIRQHandler(void)
2794 {
2797 }
2798 
2799 void DMA24_DriverIRQHandler(void)
2800 {
2803 }
2804 
2805 void DMA25_DriverIRQHandler(void)
2806 {
2809 }
2810 
2811 void DMA26_DriverIRQHandler(void)
2812 {
2815 }
2816 
2817 void DMA27_DriverIRQHandler(void)
2818 {
2821 }
2822 
2823 void DMA28_DriverIRQHandler(void)
2824 {
2827 }
2828 
2829 void DMA29_DriverIRQHandler(void)
2830 {
2833 }
2834 
2835 void DMA30_DriverIRQHandler(void)
2836 {
2839 }
2840 
2841 void DMA31_DriverIRQHandler(void)
2842 {
2845 }
2846 #endif /* FSL_FEATURE_EDMA_MODULE_CHANNEL == 32 */
2847 
2848 #endif /* 4/8/16/32 channels (No Shared) */
2849 #endif /* FSL_FEATURE_EDMA_MODULE_CHANNEL_IRQ_ENTRY_SHARED_OFFSET */
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
DMA_ATTR_DSIZE
#define DMA_ATTR_DSIZE(x)
Definition: MIMXRT1052.h:14710
s_edmaIRQNumber
static const IRQn_Type s_edmaIRQNumber[][FSL_FEATURE_EDMA_MODULE_CHANNEL]
Array to map EDMA instance number to IRQ number.
Definition: fsl_edma.c:52
DMA_DCHPRI_INDEX
#define DMA_DCHPRI_INDEX(channel)
Compute the offset unit from DCHPRI3.
Definition: fsl_edma.h:30
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
DMA_CR_ERCA
#define DMA_CR_ERCA(x)
Definition: MIMXRT1052.h:12054
_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
DMA_BITER_ELINKYES_LINKCH
#define DMA_BITER_ELINKYES_LINKCH(x)
Definition: MIMXRT1052.h:15013
DMA_CITER_ELINKNO_CITER_SHIFT
#define DMA_CITER_ELINKNO_CITER_SHIFT
Definition: MIMXRT1052.h:14857
DMA_Type::ATTR
__IO uint16_t ATTR
Definition: MIMXRT1052.h:12007
_edma_handle::tcdSize
volatile int8_t tcdSize
Definition: fsl_edma.h:254
EDMA_Deinit
void EDMA_Deinit(DMA_Type *base)
Deinitializes the eDMA peripheral.
Definition: fsl_edma.c:148
EDMA_CLOCKS
#define EDMA_CLOCKS
Clock ip name array for DMA.
Definition: fsl_clock.h:187
DMA_NBYTES_MLOFFYES_SMLOE
#define DMA_NBYTES_MLOFFYES_SMLOE(x)
Definition: MIMXRT1052.h:14812
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
DMA_CITER_ELINKYES_CITER_SHIFT
#define DMA_CITER_ELINKYES_CITER_SHIFT
Definition: MIMXRT1052.h:14876
edma_transfer_type_t
enum _edma_transfer_type edma_transfer_type_t
eDMA transfer type
DMA_ATTR_SSIZE
#define DMA_ATTR_SSIZE(x)
Definition: MIMXRT1052.h:14728
DMA_ATTR_DMOD
#define DMA_ATTR_DMOD(x)
Definition: MIMXRT1052.h:14715
kEDMA_InterruptFlag
@ kEDMA_InterruptFlag
Definition: fsl_edma.h:101
DMA2
#define DMA2
Definition: stm32f407xx.h:1124
_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
DMA_Type::ERQ
__IO uint32_t ERQ
Definition: MIMXRT1052.h:11951
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
DMA_BITER_ELINKYES_LINKCH_MASK
#define DMA_BITER_ELINKYES_LINKCH_MASK
Definition: MIMXRT1052.h:15009
DMA_CR_EDBG
#define DMA_CR_EDBG(x)
Definition: MIMXRT1052.h:12047
DMA_Type::EEI
__IO uint32_t EEI
Definition: MIMXRT1052.h:11953
DMA_Type::DOFF
__IO uint16_t DOFF
Definition: MIMXRT1052.h:12015
kEDMA_TransferSize2Bytes
@ kEDMA_TransferSize2Bytes
Definition: fsl_edma.h:36
_edma_tcd::SADDR
__IO uint32_t SADDR
Definition: fsl_edma.h:206
edma_bandwidth_t
enum _edma_bandwidth edma_bandwidth_t
Bandwidth control.
FSL_FEATURE_SOC_EDMA_COUNT
#define FSL_FEATURE_SOC_EDMA_COUNT
Definition: MIMXRT1052_features.h:57
DMA_ATTR_SMOD_MASK
#define DMA_ATTR_SMOD_MASK
Definition: MIMXRT1052.h:14729
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
DMA_Type::DLAST_SGA
__IO uint32_t DLAST_SGA
Definition: MIMXRT1052.h:12020
DMA_CR_HOE_MASK
#define DMA_CR_HOE_MASK
Definition: MIMXRT1052.h:12062
_edma_handle::tcdUsed
volatile int8_t tcdUsed
Definition: fsl_edma.h:252
kStatus_EDMA_QueueFull
@ kStatus_EDMA_QueueFull
Definition: fsl_edma.h:144
DMA_CSR_DONE_SHIFT
#define DMA_CSR_DONE_SHIFT
Definition: MIMXRT1052.h:14960
DMA_CSR_INTHALF_MASK
#define DMA_CSR_INTHALF_MASK
Definition: MIMXRT1052.h:14925
DMA_CSR_DONE_MASK
#define DMA_CSR_DONE_MASK
Definition: MIMXRT1052.h:14959
_edma_tcd::DADDR
__IO uint32_t DADDR
Definition: fsl_edma.h:211
DMA_CHN_IRQS
#define DMA_CHN_IRQS
Definition: MIMXRT1052.h:15042
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_CSR_MAJORELINK_MASK
#define DMA_CSR_MAJORELINK_MASK
Definition: MIMXRT1052.h:14947
DMA_CITER_ELINKYES_ELINK_MASK
#define DMA_CITER_ELINKYES_ELINK_MASK
Definition: MIMXRT1052.h:14885
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
DMA_Type
Definition: MIMXRT1052.h:11947
EDMA_TcdReset
void EDMA_TcdReset(edma_tcd_t *tcd)
Sets all fields to default values for the TCD structure.
Definition: fsl_edma.c:421
DMA_CSR_ESG_MASK
#define DMA_CSR_ESG_MASK
Definition: MIMXRT1052.h:14939
DMA_CITER_ELINKNO_ELINK_MASK
#define DMA_CITER_ELINKNO_ELINK_MASK
Definition: MIMXRT1052.h:14861
DMA0_DMA16_DriverIRQHandler
void DMA0_DMA16_DriverIRQHandler(void DMA1_DMA17_DriverIRQHandler() ALIAS(IntDefaultHandler) void)
Definition: startup_mimxrt1052.c:239
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
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
DMA_Type::CSR
__IO uint16_t CSR
Definition: MIMXRT1052.h:12021
DMA_CSR_DREQ_MASK
#define DMA_CSR_DREQ_MASK
Definition: MIMXRT1052.h:14932
kEDMA_PeripheralToMemory
@ kEDMA_PeripheralToMemory
Definition: fsl_edma.h:136
kEDMA_TransferSize4Bytes
@ kEDMA_TransferSize4Bytes
Definition: fsl_edma.h:37
DMA_NBYTES_MLOFFYES_MLOFF_MASK
#define DMA_NBYTES_MLOFFYES_MLOFF_MASK
Definition: MIMXRT1052.h:14793
DMA_ATTR_DMOD_MASK
#define DMA_ATTR_DMOD_MASK
Definition: MIMXRT1052.h:14711
DMA_ATTR_SMOD
#define DMA_ATTR_SMOD(x)
Definition: MIMXRT1052.h:14742
DMA_Type::SADDR
__IO uint32_t SADDR
Definition: MIMXRT1052.h:12005
DMA_CERQ_CERQ
#define DMA_CERQ_CERQ(x)
Definition: MIMXRT1052.h:12740
DMA_CITER_ELINKYES_LINKCH_MASK
#define DMA_CITER_ELINKYES_LINKCH_MASK
Definition: MIMXRT1052.h:14880
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
DMA_NBYTES_MLOFFYES_SMLOE_MASK
#define DMA_NBYTES_MLOFFYES_SMLOE_MASK
Definition: MIMXRT1052.h:14806
DMA_CR_EMLM
#define DMA_CR_EMLM(x)
Definition: MIMXRT1052.h:12094
_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
DMA_CITER_ELINKYES_CITER_MASK
#define DMA_CITER_ELINKYES_CITER_MASK
Definition: MIMXRT1052.h:14875
kEDMA_PeripheralToPeripheral
@ kEDMA_PeripheralToPeripheral
Definition: fsl_edma.h:138
DMA_CR_ERCA_MASK
#define DMA_CR_ERCA_MASK
Definition: MIMXRT1052.h:12048
SDK_ISR_EXIT_BARRIER
#define SDK_ISR_EXIT_BARRIER
Definition: fsl_common.h:250
DMA_BITER_ELINKNO_BITER_MASK
#define DMA_BITER_ELINKNO_BITER_MASK
Definition: MIMXRT1052.h:14985
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
s_edmaClockName
static const clock_ip_name_t s_edmaClockName[]
Array to map EDMA instance number to clock name.
Definition: fsl_edma.c:48
EDMA_GetInstance
static uint32_t EDMA_GetInstance(DMA_Type *base)
Definition: fsl_edma.c:61
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
DMA_Type::DCHPRI3
__IO uint8_t DCHPRI3
Definition: MIMXRT1052.h:11971
ARRAY_SIZE
#define ARRAY_SIZE(x)
Computes the number of elements in an array.
Definition: fsl_common.h:211
DMA_CR_HOE
#define DMA_CR_HOE(x)
Definition: MIMXRT1052.h:12068
DMA_CR_EDBG_MASK
#define DMA_CR_EDBG_MASK
Definition: MIMXRT1052.h:12040
IRQn_Type
IRQn_Type
STM32F4XX Interrupt Number Definition, according to the selected device in Library_configuration_sect...
Definition: stm32f407xx.h:66
DMA_BITER_ELINKYES_ELINK_MASK
#define DMA_BITER_ELINKYES_ELINK_MASK
Definition: MIMXRT1052.h:15014
kEDMA_TransferSize8Bytes
@ kEDMA_TransferSize8Bytes
Definition: fsl_edma.h:38
EDMA_GetDefaultConfig
void EDMA_GetDefaultConfig(edma_config_t *config)
Gets the eDMA default configuration structure.
Definition: fsl_edma.c:170
DMA_CSR_DREQ
#define DMA_CSR_DREQ(x)
Definition: MIMXRT1052.h:14938
_edma_handle::base
DMA_Type * base
Definition: fsl_edma.h:247
kEDMA_ErrorFlag
@ kEDMA_ErrorFlag
Definition: fsl_edma.h:100
DMA_Type::CR
__IO uint32_t CR
Definition: MIMXRT1052.h:11948
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
DMA_Type::DADDR
__IO uint32_t DADDR
Definition: MIMXRT1052.h:12014
EDMA_AbortTransfer
void EDMA_AbortTransfer(edma_handle_t *handle)
eDMA aborts transfer.
Definition: fsl_edma.c:1264
DMA_Type::SLAST
__IO uint32_t SLAST
Definition: MIMXRT1052.h:12013
CLOCK_EnableClock
static void CLOCK_EnableClock(clock_ip_name_t name)
Enable the clock for specific IP.
Definition: fsl_clock.h:1059
kEDMA_MinorLink
@ kEDMA_MinorLink
Definition: fsl_edma.h:92
DMA_Type::ERR
__IO uint32_t ERR
Definition: MIMXRT1052.h:11965
DMA_NBYTES_MLOFFYES_MLOFF
#define DMA_NBYTES_MLOFFYES_MLOFF(x)
Definition: MIMXRT1052.h:14798
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
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
DMA_Type::INT
__IO uint32_t INT
Definition: MIMXRT1052.h:11963
DMA1
#define DMA1
Definition: stm32f407xx.h:1115
DMA_Type::SOFF
__IO uint16_t SOFF
Definition: MIMXRT1052.h:12006
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::NBYTES_MLOFFYES
__IO uint32_t NBYTES_MLOFFYES
Definition: MIMXRT1052.h:12011
DMA_CSR_ACTIVE_MASK
#define DMA_CSR_ACTIVE_MASK
Definition: MIMXRT1052.h:14954
DMA_Type::SERQ
__O uint8_t SERQ
Definition: MIMXRT1052.h:11957
kEDMA_MemoryToMemory
@ kEDMA_MemoryToMemory
Definition: fsl_edma.h:135
DMA_Type::CERR
__O uint8_t CERR
Definition: MIMXRT1052.h:11960
kEDMA_MajorLink
@ kEDMA_MajorLink
Definition: fsl_edma.h:93
s_edmaBases
static DMA_Type *const s_edmaBases[]
Array to map EDMA instance number to base pointer.
Definition: fsl_edma.c:44
DMA_DCHPRI0_DPA
#define DMA_DCHPRI0_DPA(x)
Definition: MIMXRT1052.h:13886
_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
DMA_CSR_MAJORLINKCH_MASK
#define DMA_CSR_MAJORLINKCH_MASK
Definition: MIMXRT1052.h:14964
DMA_DCHPRI0_ECP
#define DMA_DCHPRI0_ECP(x)
Definition: MIMXRT1052.h:13893
DMA_Type::TCD
struct DMA_Type::@304 TCD[32]
EDMA_TRANSFER_ENABLED_MASK
#define EDMA_TRANSFER_ENABLED_MASK
Definition: fsl_edma.c:20
_edma_handle::userData
void * userData
Definition: fsl_edma.h:246
_edma_tcd::BITER
__IO uint16_t BITER
Definition: fsl_edma.h:216
DMA_Type::CITER_ELINKYES
__IO uint16_t CITER_ELINKYES
Definition: MIMXRT1052.h:12018
DMA_Type::BITER_ELINKNO
__IO uint16_t BITER_ELINKNO
Definition: MIMXRT1052.h:12023
fsl_edma.h
DMA_CR_CLM_MASK
#define DMA_CR_CLM_MASK
Definition: MIMXRT1052.h:12076
DisableGlobalIRQ
static uint32_t DisableGlobalIRQ(void)
Disable the global IRQ.
Definition: fsl_common.h:552
_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
EnableIRQ
static status_t EnableIRQ(IRQn_Type interrupt)
Enable specific interrupt.
Definition: fsl_common.h:484
DMA_CSR_INTMAJOR_MASK
#define DMA_CSR_INTMAJOR_MASK
Definition: MIMXRT1052.h:14918
EDMA_TransferWidthMapping
static edma_transfer_size_t EDMA_TransferWidthMapping(uint32_t width)
Map transfer width.
Definition: fsl_edma.c:875
CLOCK_DisableClock
static void CLOCK_DisableClock(clock_ip_name_t name)
Disable the clock for specific IP.
Definition: fsl_clock.h:1069
_edma_handle::callback
edma_callback callback
Definition: fsl_edma.h:245
kEDMA_ErrorInterruptEnable
@ kEDMA_ErrorInterruptEnable
Definition: fsl_edma.h:127
_edma_config
eDMA global configuration structure.
Definition: fsl_edma.h:150
DMA_DCHPRI0_CHPRI
#define DMA_DCHPRI0_CHPRI(x)
Definition: MIMXRT1052.h:13874
kEDMA_HalfInterruptEnable
@ kEDMA_HalfInterruptEnable
Definition: fsl_edma.h:129
DMA_NBYTES_MLOFFYES_DMLOE
#define DMA_NBYTES_MLOFFYES_DMLOE(x)
Definition: MIMXRT1052.h:14805
_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
DMA_BASE_PTRS
#define DMA_BASE_PTRS
Definition: MIMXRT1052.h:15040
_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
DMA_CR_CLM
#define DMA_CR_CLM(x)
Definition: MIMXRT1052.h:12085
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
FSL_FEATURE_EDMA_MODULE_CHANNEL
#define FSL_FEATURE_EDMA_MODULE_CHANNEL
Definition: MIMXRT1052_features.h:245
clock_ip_name_t
enum _clock_ip_name clock_ip_name_t
CCM CCGR gate control for each module independently.
DMA_Type::CITER_ELINKNO
__IO uint16_t CITER_ELINKNO
Definition: MIMXRT1052.h:12017
DMA_NBYTES_MLOFFYES_DMLOE_MASK
#define DMA_NBYTES_MLOFFYES_DMLOE_MASK
Definition: MIMXRT1052.h:14799
DMA_CITER_ELINKYES_LINKCH
#define DMA_CITER_ELINKYES_LINKCH(x)
Definition: MIMXRT1052.h:14884
_edma_handle::channel
uint8_t channel
Definition: fsl_edma.h:249
EDMA_GetInstanceOffset
static uint32_t EDMA_GetInstanceOffset(uint32_t instance)
Get instance offset.
Definition: fsl_edma.c:760
DMA_Type::NBYTES_MLNO
__IO uint32_t NBYTES_MLNO
Definition: MIMXRT1052.h:12009
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_handle::header
volatile int8_t header
Definition: fsl_edma.h:250
_edma_handle::tail
volatile int8_t tail
Definition: fsl_edma.h:251
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
DMA0
#define DMA0
Definition: MIMXRT1052.h:15036
edma_modulo_t
enum _edma_modulo edma_modulo_t
eDMA modulo configuration
kEDMA_MajorInterruptEnable
@ kEDMA_MajorInterruptEnable
Definition: fsl_edma.h:128
DMA_Type::CINT
__O uint8_t CINT
Definition: MIMXRT1052.h:11961
s_EDMAHandle
static edma_handle_t * s_EDMAHandle[FSL_FEATURE_EDMA_MODULE_CHANNEL *FSL_FEATURE_SOC_EDMA_COUNT]
Pointers to transfer handle for each EDMA channel.
Definition: fsl_edma.c:55
kStatus_Success
@ kStatus_Success
Definition: fsl_common.h:179
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_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
DMA_CITER_ELINKNO_CITER_MASK
#define DMA_CITER_ELINKNO_CITER_MASK
Definition: MIMXRT1052.h:14856
_edma_tcd::SLAST
__IO uint32_t SLAST
Definition: fsl_edma.h:210
DMA_Type::CDNE
__O uint8_t CDNE
Definition: MIMXRT1052.h:11958
EnableGlobalIRQ
static void EnableGlobalIRQ(uint32_t primask)
Enable the global IRQ.
Definition: fsl_common.h:583
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
DMA_CSR_MAJORLINKCH
#define DMA_CSR_MAJORLINKCH(x)
Definition: MIMXRT1052.h:14968


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