fsl_edma.c 73 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290
  1. /*
  2. * The Clear BSD License
  3. * Copyright (c) 2015, Freescale Semiconductor, Inc.
  4. * Copyright 2016-2017 NXP
  5. * All rights reserved.
  6. *
  7. * Redistribution and use in source and binary forms, with or without modification,
  8. * are permitted (subject to the limitations in the disclaimer below) provided
  9. * that the following conditions are met:
  10. *
  11. * o Redistributions of source code must retain the above copyright notice, this list
  12. * of conditions and the following disclaimer.
  13. *
  14. * o Redistributions in binary form must reproduce the above copyright notice, this
  15. * list of conditions and the following disclaimer in the documentation and/or
  16. * other materials provided with the distribution.
  17. *
  18. * o Neither the name of the copyright holder nor the names of its
  19. * contributors may be used to endorse or promote products derived from this
  20. * software without specific prior written permission.
  21. *
  22. * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE.
  23. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  24. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  25. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  26. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
  27. * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  28. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  29. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  30. * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  31. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  32. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  33. */
  34. #include "fsl_edma.h"
  35. /*******************************************************************************
  36. * Definitions
  37. ******************************************************************************/
  38. #define EDMA_TRANSFER_ENABLED_MASK 0x80U
  39. /*******************************************************************************
  40. * Prototypes
  41. ******************************************************************************/
  42. /*!
  43. * @brief Get instance number for EDMA.
  44. *
  45. * @param base EDMA peripheral base address.
  46. */
  47. static uint32_t EDMA_GetInstance(DMA_Type *base);
  48. /*******************************************************************************
  49. * Variables
  50. ******************************************************************************/
  51. /*! @brief Array to map EDMA instance number to base pointer. */
  52. static DMA_Type *const s_edmaBases[] = DMA_BASE_PTRS;
  53. #if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL)
  54. /*! @brief Array to map EDMA instance number to clock name. */
  55. static const clock_ip_name_t s_edmaClockName[] = EDMA_CLOCKS;
  56. #endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */
  57. /*! @brief Array to map EDMA instance number to IRQ number. */
  58. static const IRQn_Type s_edmaIRQNumber[][FSL_FEATURE_EDMA_MODULE_CHANNEL] = DMA_CHN_IRQS;
  59. /*! @brief Pointers to transfer handle for each EDMA channel. */
  60. static edma_handle_t *s_EDMAHandle[FSL_FEATURE_EDMA_MODULE_CHANNEL * FSL_FEATURE_SOC_EDMA_COUNT];
  61. /*******************************************************************************
  62. * Code
  63. ******************************************************************************/
  64. static uint32_t EDMA_GetInstance(DMA_Type *base)
  65. {
  66. uint32_t instance;
  67. /* Find the instance index from base address mappings. */
  68. for (instance = 0; instance < ARRAY_SIZE(s_edmaBases); instance++)
  69. {
  70. if (s_edmaBases[instance] == base)
  71. {
  72. break;
  73. }
  74. }
  75. assert(instance < ARRAY_SIZE(s_edmaBases));
  76. return instance;
  77. }
  78. void EDMA_InstallTCD(DMA_Type *base, uint32_t channel, edma_tcd_t *tcd)
  79. {
  80. assert(channel < FSL_FEATURE_EDMA_MODULE_CHANNEL);
  81. assert(tcd != NULL);
  82. assert(((uint32_t)tcd & 0x1FU) == 0);
  83. /* Push tcd into hardware TCD register */
  84. base->TCD[channel].SADDR = tcd->SADDR;
  85. base->TCD[channel].SOFF = tcd->SOFF;
  86. base->TCD[channel].ATTR = tcd->ATTR;
  87. base->TCD[channel].NBYTES_MLNO = tcd->NBYTES;
  88. base->TCD[channel].SLAST = tcd->SLAST;
  89. base->TCD[channel].DADDR = tcd->DADDR;
  90. base->TCD[channel].DOFF = tcd->DOFF;
  91. base->TCD[channel].CITER_ELINKNO = tcd->CITER;
  92. base->TCD[channel].DLAST_SGA = tcd->DLAST_SGA;
  93. /* Clear DONE bit first, otherwise ESG cannot be set */
  94. base->TCD[channel].CSR = 0;
  95. base->TCD[channel].CSR = tcd->CSR;
  96. base->TCD[channel].BITER_ELINKNO = tcd->BITER;
  97. }
  98. void EDMA_Init(DMA_Type *base, const edma_config_t *config)
  99. {
  100. assert(config != NULL);
  101. uint32_t tmpreg;
  102. #if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL)
  103. /* Ungate EDMA periphral clock */
  104. CLOCK_EnableClock(s_edmaClockName[EDMA_GetInstance(base)]);
  105. #endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */
  106. /* Configure EDMA peripheral according to the configuration structure. */
  107. tmpreg = base->CR;
  108. tmpreg &= ~(DMA_CR_ERCA_MASK | DMA_CR_HOE_MASK | DMA_CR_CLM_MASK | DMA_CR_EDBG_MASK);
  109. tmpreg |= (DMA_CR_ERCA(config->enableRoundRobinArbitration) | DMA_CR_HOE(config->enableHaltOnError) |
  110. DMA_CR_CLM(config->enableContinuousLinkMode) | DMA_CR_EDBG(config->enableDebugMode) | DMA_CR_EMLM(true));
  111. base->CR = tmpreg;
  112. }
  113. void EDMA_Deinit(DMA_Type *base)
  114. {
  115. #if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL)
  116. /* Gate EDMA periphral clock */
  117. CLOCK_DisableClock(s_edmaClockName[EDMA_GetInstance(base)]);
  118. #endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */
  119. }
  120. void EDMA_GetDefaultConfig(edma_config_t *config)
  121. {
  122. assert(config != NULL);
  123. config->enableRoundRobinArbitration = false;
  124. config->enableHaltOnError = true;
  125. config->enableContinuousLinkMode = false;
  126. config->enableDebugMode = false;
  127. }
  128. void EDMA_ResetChannel(DMA_Type *base, uint32_t channel)
  129. {
  130. assert(channel < FSL_FEATURE_EDMA_MODULE_CHANNEL);
  131. EDMA_TcdReset((edma_tcd_t *)&base->TCD[channel]);
  132. }
  133. void EDMA_SetTransferConfig(DMA_Type *base, uint32_t channel, const edma_transfer_config_t *config, edma_tcd_t *nextTcd)
  134. {
  135. assert(channel < FSL_FEATURE_EDMA_MODULE_CHANNEL);
  136. assert(config != NULL);
  137. assert(((uint32_t)nextTcd & 0x1FU) == 0);
  138. EDMA_TcdSetTransferConfig((edma_tcd_t *)&base->TCD[channel], config, nextTcd);
  139. }
  140. void EDMA_SetMinorOffsetConfig(DMA_Type *base, uint32_t channel, const edma_minor_offset_config_t *config)
  141. {
  142. assert(channel < FSL_FEATURE_EDMA_MODULE_CHANNEL);
  143. assert(config != NULL);
  144. uint32_t tmpreg;
  145. tmpreg = base->TCD[channel].NBYTES_MLOFFYES;
  146. tmpreg &= ~(DMA_NBYTES_MLOFFYES_SMLOE_MASK | DMA_NBYTES_MLOFFYES_DMLOE_MASK | DMA_NBYTES_MLOFFYES_MLOFF_MASK);
  147. tmpreg |=
  148. (DMA_NBYTES_MLOFFYES_SMLOE(config->enableSrcMinorOffset) |
  149. DMA_NBYTES_MLOFFYES_DMLOE(config->enableDestMinorOffset) | DMA_NBYTES_MLOFFYES_MLOFF(config->minorOffset));
  150. base->TCD[channel].NBYTES_MLOFFYES = tmpreg;
  151. }
  152. void EDMA_SetChannelLink(DMA_Type *base, uint32_t channel, edma_channel_link_type_t type, uint32_t linkedChannel)
  153. {
  154. assert(channel < FSL_FEATURE_EDMA_MODULE_CHANNEL);
  155. assert(linkedChannel < FSL_FEATURE_EDMA_MODULE_CHANNEL);
  156. EDMA_TcdSetChannelLink((edma_tcd_t *)&base->TCD[channel], type, linkedChannel);
  157. }
  158. void EDMA_SetBandWidth(DMA_Type *base, uint32_t channel, edma_bandwidth_t bandWidth)
  159. {
  160. assert(channel < FSL_FEATURE_EDMA_MODULE_CHANNEL);
  161. base->TCD[channel].CSR = (base->TCD[channel].CSR & (~DMA_CSR_BWC_MASK)) | DMA_CSR_BWC(bandWidth);
  162. }
  163. void EDMA_SetModulo(DMA_Type *base, uint32_t channel, edma_modulo_t srcModulo, edma_modulo_t destModulo)
  164. {
  165. assert(channel < FSL_FEATURE_EDMA_MODULE_CHANNEL);
  166. uint32_t tmpreg;
  167. tmpreg = base->TCD[channel].ATTR & (~(DMA_ATTR_SMOD_MASK | DMA_ATTR_DMOD_MASK));
  168. base->TCD[channel].ATTR = tmpreg | DMA_ATTR_DMOD(destModulo) | DMA_ATTR_SMOD(srcModulo);
  169. }
  170. void EDMA_EnableChannelInterrupts(DMA_Type *base, uint32_t channel, uint32_t mask)
  171. {
  172. assert(channel < FSL_FEATURE_EDMA_MODULE_CHANNEL);
  173. /* Enable error interrupt */
  174. if (mask & kEDMA_ErrorInterruptEnable)
  175. {
  176. base->EEI |= (0x1U << channel);
  177. }
  178. /* Enable Major interrupt */
  179. if (mask & kEDMA_MajorInterruptEnable)
  180. {
  181. base->TCD[channel].CSR |= DMA_CSR_INTMAJOR_MASK;
  182. }
  183. /* Enable Half major interrupt */
  184. if (mask & kEDMA_HalfInterruptEnable)
  185. {
  186. base->TCD[channel].CSR |= DMA_CSR_INTHALF_MASK;
  187. }
  188. }
  189. void EDMA_DisableChannelInterrupts(DMA_Type *base, uint32_t channel, uint32_t mask)
  190. {
  191. assert(channel < FSL_FEATURE_EDMA_MODULE_CHANNEL);
  192. /* Disable error interrupt */
  193. if (mask & kEDMA_ErrorInterruptEnable)
  194. {
  195. base->EEI &= ~(0x1U << channel);
  196. }
  197. /* Disable Major interrupt */
  198. if (mask & kEDMA_MajorInterruptEnable)
  199. {
  200. base->TCD[channel].CSR &= ~DMA_CSR_INTMAJOR_MASK;
  201. }
  202. /* Disable Half major interrupt */
  203. if (mask & kEDMA_HalfInterruptEnable)
  204. {
  205. base->TCD[channel].CSR &= ~DMA_CSR_INTHALF_MASK;
  206. }
  207. }
  208. void EDMA_TcdReset(edma_tcd_t *tcd)
  209. {
  210. assert(tcd != NULL);
  211. assert(((uint32_t)tcd & 0x1FU) == 0);
  212. /* Reset channel TCD */
  213. tcd->SADDR = 0U;
  214. tcd->SOFF = 0U;
  215. tcd->ATTR = 0U;
  216. tcd->NBYTES = 0U;
  217. tcd->SLAST = 0U;
  218. tcd->DADDR = 0U;
  219. tcd->DOFF = 0U;
  220. tcd->CITER = 0U;
  221. tcd->DLAST_SGA = 0U;
  222. /* Enable auto disable request feature */
  223. tcd->CSR = DMA_CSR_DREQ(true);
  224. tcd->BITER = 0U;
  225. }
  226. void EDMA_TcdSetTransferConfig(edma_tcd_t *tcd, const edma_transfer_config_t *config, edma_tcd_t *nextTcd)
  227. {
  228. assert(tcd != NULL);
  229. assert(((uint32_t)tcd & 0x1FU) == 0);
  230. assert(config != NULL);
  231. assert(((uint32_t)nextTcd & 0x1FU) == 0);
  232. /* source address */
  233. tcd->SADDR = config->srcAddr;
  234. /* destination address */
  235. tcd->DADDR = config->destAddr;
  236. /* Source data and destination data transfer size */
  237. tcd->ATTR = DMA_ATTR_SSIZE(config->srcTransferSize) | DMA_ATTR_DSIZE(config->destTransferSize);
  238. /* Source address signed offset */
  239. tcd->SOFF = config->srcOffset;
  240. /* Destination address signed offset */
  241. tcd->DOFF = config->destOffset;
  242. /* Minor byte transfer count */
  243. tcd->NBYTES = config->minorLoopBytes;
  244. /* Current major iteration count */
  245. tcd->CITER = config->majorLoopCounts;
  246. /* Starting major iteration count */
  247. tcd->BITER = config->majorLoopCounts;
  248. /* Enable scatter/gather processing */
  249. if (nextTcd != NULL)
  250. {
  251. tcd->DLAST_SGA = (uint32_t)nextTcd;
  252. /*
  253. Before call EDMA_TcdSetTransferConfig or EDMA_SetTransferConfig,
  254. user must call EDMA_TcdReset or EDMA_ResetChannel which will set
  255. DREQ, so must use "|" or "&" rather than "=".
  256. Clear the DREQ bit because scatter gather has been enabled, so the
  257. previous transfer is not the last transfer, and channel request should
  258. be enabled at the next transfer(the next TCD).
  259. */
  260. tcd->CSR = (tcd->CSR | DMA_CSR_ESG_MASK) & ~DMA_CSR_DREQ_MASK;
  261. }
  262. }
  263. void EDMA_TcdSetMinorOffsetConfig(edma_tcd_t *tcd, const edma_minor_offset_config_t *config)
  264. {
  265. assert(tcd != NULL);
  266. assert(((uint32_t)tcd & 0x1FU) == 0);
  267. uint32_t tmpreg;
  268. tmpreg = tcd->NBYTES &
  269. ~(DMA_NBYTES_MLOFFYES_SMLOE_MASK | DMA_NBYTES_MLOFFYES_DMLOE_MASK | DMA_NBYTES_MLOFFYES_MLOFF_MASK);
  270. tmpreg |=
  271. (DMA_NBYTES_MLOFFYES_SMLOE(config->enableSrcMinorOffset) |
  272. DMA_NBYTES_MLOFFYES_DMLOE(config->enableDestMinorOffset) | DMA_NBYTES_MLOFFYES_MLOFF(config->minorOffset));
  273. tcd->NBYTES = tmpreg;
  274. }
  275. void EDMA_TcdSetChannelLink(edma_tcd_t *tcd, edma_channel_link_type_t type, uint32_t linkedChannel)
  276. {
  277. assert(tcd != NULL);
  278. assert(((uint32_t)tcd & 0x1FU) == 0);
  279. assert(linkedChannel < FSL_FEATURE_EDMA_MODULE_CHANNEL);
  280. if (type == kEDMA_MinorLink) /* Minor link config */
  281. {
  282. uint32_t tmpreg;
  283. /* Enable minor link */
  284. tcd->CITER |= DMA_CITER_ELINKYES_ELINK_MASK;
  285. tcd->BITER |= DMA_BITER_ELINKYES_ELINK_MASK;
  286. /* Set likned channel */
  287. tmpreg = tcd->CITER & (~DMA_CITER_ELINKYES_LINKCH_MASK);
  288. tmpreg |= DMA_CITER_ELINKYES_LINKCH(linkedChannel);
  289. tcd->CITER = tmpreg;
  290. tmpreg = tcd->BITER & (~DMA_BITER_ELINKYES_LINKCH_MASK);
  291. tmpreg |= DMA_BITER_ELINKYES_LINKCH(linkedChannel);
  292. tcd->BITER = tmpreg;
  293. }
  294. else if (type == kEDMA_MajorLink) /* Major link config */
  295. {
  296. uint32_t tmpreg;
  297. /* Enable major link */
  298. tcd->CSR |= DMA_CSR_MAJORELINK_MASK;
  299. /* Set major linked channel */
  300. tmpreg = tcd->CSR & (~DMA_CSR_MAJORLINKCH_MASK);
  301. tcd->CSR = tmpreg | DMA_CSR_MAJORLINKCH(linkedChannel);
  302. }
  303. else /* Link none */
  304. {
  305. tcd->CITER &= ~DMA_CITER_ELINKYES_ELINK_MASK;
  306. tcd->BITER &= ~DMA_BITER_ELINKYES_ELINK_MASK;
  307. tcd->CSR &= ~DMA_CSR_MAJORELINK_MASK;
  308. }
  309. }
  310. void EDMA_TcdSetModulo(edma_tcd_t *tcd, edma_modulo_t srcModulo, edma_modulo_t destModulo)
  311. {
  312. assert(tcd != NULL);
  313. assert(((uint32_t)tcd & 0x1FU) == 0);
  314. uint32_t tmpreg;
  315. tmpreg = tcd->ATTR & (~(DMA_ATTR_SMOD_MASK | DMA_ATTR_DMOD_MASK));
  316. tcd->ATTR = tmpreg | DMA_ATTR_DMOD(destModulo) | DMA_ATTR_SMOD(srcModulo);
  317. }
  318. void EDMA_TcdEnableInterrupts(edma_tcd_t *tcd, uint32_t mask)
  319. {
  320. assert(tcd != NULL);
  321. /* Enable Major interrupt */
  322. if (mask & kEDMA_MajorInterruptEnable)
  323. {
  324. tcd->CSR |= DMA_CSR_INTMAJOR_MASK;
  325. }
  326. /* Enable Half major interrupt */
  327. if (mask & kEDMA_HalfInterruptEnable)
  328. {
  329. tcd->CSR |= DMA_CSR_INTHALF_MASK;
  330. }
  331. }
  332. void EDMA_TcdDisableInterrupts(edma_tcd_t *tcd, uint32_t mask)
  333. {
  334. assert(tcd != NULL);
  335. /* Disable Major interrupt */
  336. if (mask & kEDMA_MajorInterruptEnable)
  337. {
  338. tcd->CSR &= ~DMA_CSR_INTMAJOR_MASK;
  339. }
  340. /* Disable Half major interrupt */
  341. if (mask & kEDMA_HalfInterruptEnable)
  342. {
  343. tcd->CSR &= ~DMA_CSR_INTHALF_MASK;
  344. }
  345. }
  346. uint32_t EDMA_GetRemainingMajorLoopCount(DMA_Type *base, uint32_t channel)
  347. {
  348. assert(channel < FSL_FEATURE_EDMA_MODULE_CHANNEL);
  349. uint32_t remainingCount = 0;
  350. if (DMA_CSR_DONE_MASK & base->TCD[channel].CSR)
  351. {
  352. remainingCount = 0;
  353. }
  354. else
  355. {
  356. /* Calculate the unfinished bytes */
  357. if (base->TCD[channel].CITER_ELINKNO & DMA_CITER_ELINKNO_ELINK_MASK)
  358. {
  359. remainingCount =
  360. (base->TCD[channel].CITER_ELINKYES & DMA_CITER_ELINKYES_CITER_MASK) >> DMA_CITER_ELINKYES_CITER_SHIFT;
  361. }
  362. else
  363. {
  364. remainingCount =
  365. (base->TCD[channel].CITER_ELINKNO & DMA_CITER_ELINKNO_CITER_MASK) >> DMA_CITER_ELINKNO_CITER_SHIFT;
  366. }
  367. }
  368. return remainingCount;
  369. }
  370. uint32_t EDMA_GetChannelStatusFlags(DMA_Type *base, uint32_t channel)
  371. {
  372. assert(channel < FSL_FEATURE_EDMA_MODULE_CHANNEL);
  373. uint32_t retval = 0;
  374. /* Get DONE bit flag */
  375. retval |= ((base->TCD[channel].CSR & DMA_CSR_DONE_MASK) >> DMA_CSR_DONE_SHIFT);
  376. /* Get ERROR bit flag */
  377. retval |= (((base->ERR >> channel) & 0x1U) << 1U);
  378. /* Get INT bit flag */
  379. retval |= (((base->INT >> channel) & 0x1U) << 2U);
  380. return retval;
  381. }
  382. void EDMA_ClearChannelStatusFlags(DMA_Type *base, uint32_t channel, uint32_t mask)
  383. {
  384. assert(channel < FSL_FEATURE_EDMA_MODULE_CHANNEL);
  385. /* Clear DONE bit flag */
  386. if (mask & kEDMA_DoneFlag)
  387. {
  388. base->CDNE = channel;
  389. }
  390. /* Clear ERROR bit flag */
  391. if (mask & kEDMA_ErrorFlag)
  392. {
  393. base->CERR = channel;
  394. }
  395. /* Clear INT bit flag */
  396. if (mask & kEDMA_InterruptFlag)
  397. {
  398. base->CINT = channel;
  399. }
  400. }
  401. static uint8_t Get_StartInstance(void)
  402. {
  403. static uint8_t StartInstanceNum;
  404. #if defined(DMA0)
  405. StartInstanceNum = EDMA_GetInstance(DMA0);
  406. #elif defined(DMA1)
  407. StartInstanceNum = EDMA_GetInstance(DMA1);
  408. #elif defined(DMA2)
  409. StartInstanceNum = EDMA_GetInstance(DMA2);
  410. #elif defined(DMA3)
  411. StartInstanceNum = EDMA_GetInstance(DMA3);
  412. #endif
  413. return StartInstanceNum;
  414. }
  415. void EDMA_CreateHandle(edma_handle_t *handle, DMA_Type *base, uint32_t channel)
  416. {
  417. assert(handle != NULL);
  418. assert(channel < FSL_FEATURE_EDMA_MODULE_CHANNEL);
  419. uint32_t edmaInstance;
  420. uint32_t channelIndex;
  421. uint8_t StartInstance;
  422. edma_tcd_t *tcdRegs;
  423. /* Zero the handle */
  424. memset(handle, 0, sizeof(*handle));
  425. handle->base = base;
  426. handle->channel = channel;
  427. /* Get the DMA instance number */
  428. edmaInstance = EDMA_GetInstance(base);
  429. StartInstance = Get_StartInstance();
  430. channelIndex = ((edmaInstance - StartInstance) * FSL_FEATURE_EDMA_MODULE_CHANNEL) + channel;
  431. s_EDMAHandle[channelIndex] = handle;
  432. /* Enable NVIC interrupt */
  433. EnableIRQ(s_edmaIRQNumber[edmaInstance][channel]);
  434. /*
  435. Reset TCD registers to zero. Unlike the EDMA_TcdReset(DREQ will be set),
  436. CSR will be 0. Because in order to suit EDMA busy check mechanism in
  437. EDMA_SubmitTransfer, CSR must be set 0.
  438. */
  439. tcdRegs = (edma_tcd_t *)&handle->base->TCD[handle->channel];
  440. tcdRegs->SADDR = 0;
  441. tcdRegs->SOFF = 0;
  442. tcdRegs->ATTR = 0;
  443. tcdRegs->NBYTES = 0;
  444. tcdRegs->SLAST = 0;
  445. tcdRegs->DADDR = 0;
  446. tcdRegs->DOFF = 0;
  447. tcdRegs->CITER = 0;
  448. tcdRegs->DLAST_SGA = 0;
  449. tcdRegs->CSR = 0;
  450. tcdRegs->BITER = 0;
  451. }
  452. void EDMA_InstallTCDMemory(edma_handle_t *handle, edma_tcd_t *tcdPool, uint32_t tcdSize)
  453. {
  454. assert(handle != NULL);
  455. assert(((uint32_t)tcdPool & 0x1FU) == 0);
  456. /* Initialize tcd queue attibute. */
  457. handle->header = 0;
  458. handle->tail = 0;
  459. handle->tcdUsed = 0;
  460. handle->tcdSize = tcdSize;
  461. handle->flags = 0;
  462. handle->tcdPool = tcdPool;
  463. }
  464. void EDMA_SetCallback(edma_handle_t *handle, edma_callback callback, void *userData)
  465. {
  466. assert(handle != NULL);
  467. handle->callback = callback;
  468. handle->userData = userData;
  469. }
  470. void EDMA_PrepareTransfer(edma_transfer_config_t *config,
  471. void *srcAddr,
  472. uint32_t srcWidth,
  473. void *destAddr,
  474. uint32_t destWidth,
  475. uint32_t bytesEachRequest,
  476. uint32_t transferBytes,
  477. edma_transfer_type_t type)
  478. {
  479. assert(config != NULL);
  480. assert(srcAddr != NULL);
  481. assert(destAddr != NULL);
  482. assert((srcWidth == 1U) || (srcWidth == 2U) || (srcWidth == 4U) || (srcWidth == 16U) || (srcWidth == 32U));
  483. assert((destWidth == 1U) || (destWidth == 2U) || (destWidth == 4U) || (destWidth == 16U) || (destWidth == 32U));
  484. assert(transferBytes % bytesEachRequest == 0);
  485. config->destAddr = (uint32_t)destAddr;
  486. config->srcAddr = (uint32_t)srcAddr;
  487. config->minorLoopBytes = bytesEachRequest;
  488. config->majorLoopCounts = transferBytes / bytesEachRequest;
  489. switch (srcWidth)
  490. {
  491. case 1U:
  492. config->srcTransferSize = kEDMA_TransferSize1Bytes;
  493. break;
  494. case 2U:
  495. config->srcTransferSize = kEDMA_TransferSize2Bytes;
  496. break;
  497. case 4U:
  498. config->srcTransferSize = kEDMA_TransferSize4Bytes;
  499. break;
  500. case 16U:
  501. config->srcTransferSize = kEDMA_TransferSize16Bytes;
  502. break;
  503. case 32U:
  504. config->srcTransferSize = kEDMA_TransferSize32Bytes;
  505. break;
  506. default:
  507. break;
  508. }
  509. switch (destWidth)
  510. {
  511. case 1U:
  512. config->destTransferSize = kEDMA_TransferSize1Bytes;
  513. break;
  514. case 2U:
  515. config->destTransferSize = kEDMA_TransferSize2Bytes;
  516. break;
  517. case 4U:
  518. config->destTransferSize = kEDMA_TransferSize4Bytes;
  519. break;
  520. case 16U:
  521. config->destTransferSize = kEDMA_TransferSize16Bytes;
  522. break;
  523. case 32U:
  524. config->destTransferSize = kEDMA_TransferSize32Bytes;
  525. break;
  526. default:
  527. break;
  528. }
  529. switch (type)
  530. {
  531. case kEDMA_MemoryToMemory:
  532. config->destOffset = destWidth;
  533. config->srcOffset = srcWidth;
  534. break;
  535. case kEDMA_MemoryToPeripheral:
  536. config->destOffset = 0U;
  537. config->srcOffset = srcWidth;
  538. break;
  539. case kEDMA_PeripheralToMemory:
  540. config->destOffset = destWidth;
  541. config->srcOffset = 0U;
  542. break;
  543. default:
  544. break;
  545. }
  546. }
  547. status_t EDMA_SubmitTransfer(edma_handle_t *handle, const edma_transfer_config_t *config)
  548. {
  549. assert(handle != NULL);
  550. assert(config != NULL);
  551. edma_tcd_t *tcdRegs = (edma_tcd_t *)&handle->base->TCD[handle->channel];
  552. if (handle->tcdPool == NULL)
  553. {
  554. /*
  555. Check if EDMA is busy: if the given channel started transfer, CSR will be not zero. Because
  556. if it is the last transfer, DREQ will be set. If not, ESG will be set. So in order to suit
  557. this check mechanism, EDMA_CreatHandle will clear CSR register.
  558. */
  559. if ((tcdRegs->CSR != 0) && ((tcdRegs->CSR & DMA_CSR_DONE_MASK) == 0))
  560. {
  561. return kStatus_EDMA_Busy;
  562. }
  563. else
  564. {
  565. EDMA_SetTransferConfig(handle->base, handle->channel, config, NULL);
  566. /* Enable auto disable request feature */
  567. handle->base->TCD[handle->channel].CSR |= DMA_CSR_DREQ_MASK;
  568. /* Enable major interrupt */
  569. handle->base->TCD[handle->channel].CSR |= DMA_CSR_INTMAJOR_MASK;
  570. return kStatus_Success;
  571. }
  572. }
  573. else /* Use the TCD queue. */
  574. {
  575. uint32_t primask;
  576. uint32_t csr;
  577. int8_t currentTcd;
  578. int8_t previousTcd;
  579. int8_t nextTcd;
  580. /* Check if tcd pool is full. */
  581. primask = DisableGlobalIRQ();
  582. if (handle->tcdUsed >= handle->tcdSize)
  583. {
  584. EnableGlobalIRQ(primask);
  585. return kStatus_EDMA_QueueFull;
  586. }
  587. currentTcd = handle->tail;
  588. handle->tcdUsed++;
  589. /* Calculate index of next TCD */
  590. nextTcd = currentTcd + 1U;
  591. if (nextTcd == handle->tcdSize)
  592. {
  593. nextTcd = 0U;
  594. }
  595. /* Advance queue tail index */
  596. handle->tail = nextTcd;
  597. EnableGlobalIRQ(primask);
  598. /* Calculate index of previous TCD */
  599. previousTcd = currentTcd ? currentTcd - 1U : handle->tcdSize - 1U;
  600. /* Configure current TCD block. */
  601. EDMA_TcdReset(&handle->tcdPool[currentTcd]);
  602. EDMA_TcdSetTransferConfig(&handle->tcdPool[currentTcd], config, NULL);
  603. /* Enable major interrupt */
  604. handle->tcdPool[currentTcd].CSR |= DMA_CSR_INTMAJOR_MASK;
  605. /* Link current TCD with next TCD for identification of current TCD */
  606. handle->tcdPool[currentTcd].DLAST_SGA = (uint32_t)&handle->tcdPool[nextTcd];
  607. /* Chain from previous descriptor unless tcd pool size is 1(this descriptor is its own predecessor). */
  608. if (currentTcd != previousTcd)
  609. {
  610. /* Enable scatter/gather feature in the previous TCD block. */
  611. csr = (handle->tcdPool[previousTcd].CSR | DMA_CSR_ESG_MASK) & ~DMA_CSR_DREQ_MASK;
  612. handle->tcdPool[previousTcd].CSR = csr;
  613. /*
  614. Check if the TCD blcok in the registers is the previous one (points to current TCD block). It
  615. is used to check if the previous TCD linked has been loaded in TCD register. If so, it need to
  616. link the TCD register in case link the current TCD with the dead chain when TCD loading occurs
  617. before link the previous TCD block.
  618. */
  619. if (tcdRegs->DLAST_SGA == (uint32_t)&handle->tcdPool[currentTcd])
  620. {
  621. /* Enable scatter/gather also in the TCD registers. */
  622. csr = (tcdRegs->CSR | DMA_CSR_ESG_MASK) & ~DMA_CSR_DREQ_MASK;
  623. /* Must write the CSR register one-time, because the transfer maybe finished anytime. */
  624. tcdRegs->CSR = csr;
  625. /*
  626. It is very important to check the ESG bit!
  627. Because this hardware design: if DONE bit is set, the ESG bit can not be set. So it can
  628. be used to check if the dynamic TCD link operation is successful. If ESG bit is not set
  629. and the DLAST_SGA is not the next TCD address(it means the dynamic TCD link succeed and
  630. the current TCD block has been loaded into TCD registers), it means transfer finished
  631. and TCD link operation fail, so must install TCD content into TCD registers and enable
  632. transfer again. And if ESG is set, it means transfer has notfinished, so TCD dynamic
  633. link succeed.
  634. */
  635. if (tcdRegs->CSR & DMA_CSR_ESG_MASK)
  636. {
  637. return kStatus_Success;
  638. }
  639. /*
  640. Check whether the current TCD block is already loaded in the TCD registers. It is another
  641. condition when ESG bit is not set: it means the dynamic TCD link succeed and the current
  642. TCD block has been loaded into TCD registers.
  643. */
  644. if (tcdRegs->DLAST_SGA == (uint32_t)&handle->tcdPool[nextTcd])
  645. {
  646. return kStatus_Success;
  647. }
  648. /*
  649. If go to this, means the previous transfer finished, and the DONE bit is set.
  650. So shall configure TCD registers.
  651. */
  652. }
  653. else if (tcdRegs->DLAST_SGA != 0)
  654. {
  655. /* The current TCD block has been linked successfully. */
  656. return kStatus_Success;
  657. }
  658. else
  659. {
  660. /*
  661. DLAST_SGA is 0 and it means the first submit transfer, so shall configure
  662. TCD registers.
  663. */
  664. }
  665. }
  666. /* There is no live chain, TCD block need to be installed in TCD registers. */
  667. EDMA_InstallTCD(handle->base, handle->channel, &handle->tcdPool[currentTcd]);
  668. /* Enable channel request again. */
  669. if (handle->flags & EDMA_TRANSFER_ENABLED_MASK)
  670. {
  671. handle->base->SERQ = DMA_SERQ_SERQ(handle->channel);
  672. }
  673. return kStatus_Success;
  674. }
  675. }
  676. void EDMA_StartTransfer(edma_handle_t *handle)
  677. {
  678. assert(handle != NULL);
  679. if (handle->tcdPool == NULL)
  680. {
  681. handle->base->SERQ = DMA_SERQ_SERQ(handle->channel);
  682. }
  683. else /* Use the TCD queue. */
  684. {
  685. uint32_t primask;
  686. edma_tcd_t *tcdRegs = (edma_tcd_t *)&handle->base->TCD[handle->channel];
  687. handle->flags |= EDMA_TRANSFER_ENABLED_MASK;
  688. /* Check if there was at least one descriptor submitted since reset (TCD in registers is valid) */
  689. if (tcdRegs->DLAST_SGA != 0U)
  690. {
  691. primask = DisableGlobalIRQ();
  692. /* Check if channel request is actually disable. */
  693. if ((handle->base->ERQ & (1U << handle->channel)) == 0U)
  694. {
  695. /* Check if transfer is paused. */
  696. if ((!(tcdRegs->CSR & DMA_CSR_DONE_MASK)) || (tcdRegs->CSR & DMA_CSR_ESG_MASK))
  697. {
  698. /*
  699. Re-enable channel request must be as soon as possible, so must put it into
  700. critical section to avoid task switching or interrupt service routine.
  701. */
  702. handle->base->SERQ = DMA_SERQ_SERQ(handle->channel);
  703. }
  704. }
  705. EnableGlobalIRQ(primask);
  706. }
  707. }
  708. }
  709. void EDMA_StopTransfer(edma_handle_t *handle)
  710. {
  711. assert(handle != NULL);
  712. handle->flags &= (~EDMA_TRANSFER_ENABLED_MASK);
  713. handle->base->CERQ = DMA_CERQ_CERQ(handle->channel);
  714. }
  715. void EDMA_AbortTransfer(edma_handle_t *handle)
  716. {
  717. handle->base->CERQ = DMA_CERQ_CERQ(handle->channel);
  718. /*
  719. Clear CSR to release channel. Because if the given channel started transfer,
  720. CSR will be not zero. Because if it is the last transfer, DREQ will be set.
  721. If not, ESG will be set.
  722. */
  723. handle->base->TCD[handle->channel].CSR = 0;
  724. /* Cancel all next TCD transfer. */
  725. handle->base->TCD[handle->channel].DLAST_SGA = 0;
  726. /* Handle the tcd */
  727. if (handle->tcdPool != NULL)
  728. {
  729. handle->header = 0;
  730. handle->tail = 0;
  731. handle->tcdUsed = 0;
  732. }
  733. }
  734. void EDMA_HandleIRQ(edma_handle_t *handle)
  735. {
  736. assert(handle != NULL);
  737. /* Clear EDMA interrupt flag */
  738. handle->base->CINT = handle->channel;
  739. if ((handle->tcdPool == NULL) && (handle->callback != NULL))
  740. {
  741. (handle->callback)(handle, handle->userData, true, 0);
  742. }
  743. else /* Use the TCD queue. Please refer to the API descriptions in the eDMA header file for detailed information. */
  744. {
  745. uint32_t sga = handle->base->TCD[handle->channel].DLAST_SGA;
  746. uint32_t sga_index;
  747. int32_t tcds_done;
  748. uint8_t new_header;
  749. bool transfer_done;
  750. /* Check if transfer is already finished. */
  751. transfer_done = ((handle->base->TCD[handle->channel].CSR & DMA_CSR_DONE_MASK) != 0);
  752. /* Get the offset of the next transfer TCD blcoks to be loaded into the eDMA engine. */
  753. sga -= (uint32_t)handle->tcdPool;
  754. /* Get the index of the next transfer TCD blcoks to be loaded into the eDMA engine. */
  755. sga_index = sga / sizeof(edma_tcd_t);
  756. /* Adjust header positions. */
  757. if (transfer_done)
  758. {
  759. /* New header shall point to the next TCD to be loaded (current one is already finished) */
  760. new_header = sga_index;
  761. }
  762. else
  763. {
  764. /* New header shall point to this descriptor currently loaded (not finished yet) */
  765. new_header = sga_index ? sga_index - 1U : handle->tcdSize - 1U;
  766. }
  767. /* Calculate the number of finished TCDs */
  768. if (new_header == handle->header)
  769. {
  770. if (handle->tcdUsed == handle->tcdSize)
  771. {
  772. tcds_done = handle->tcdUsed;
  773. }
  774. else
  775. {
  776. /* No TCD in the memory are going to be loaded or internal error occurs. */
  777. tcds_done = 0;
  778. }
  779. }
  780. else
  781. {
  782. tcds_done = new_header - handle->header;
  783. if (tcds_done < 0)
  784. {
  785. tcds_done += handle->tcdSize;
  786. }
  787. }
  788. /* Advance header which points to the TCD to be loaded into the eDMA engine from memory. */
  789. handle->header = new_header;
  790. /* Release TCD blocks. tcdUsed is the TCD number which can be used/loaded in the memory pool. */
  791. handle->tcdUsed -= tcds_done;
  792. /* Invoke callback function. */
  793. if (handle->callback)
  794. {
  795. (handle->callback)(handle, handle->userData, transfer_done, tcds_done);
  796. }
  797. }
  798. }
  799. /* 8 channels (Shared): kl28 */
  800. #if defined(FSL_FEATURE_EDMA_MODULE_CHANNEL) && FSL_FEATURE_EDMA_MODULE_CHANNEL == 8U
  801. #if defined(DMA0)
  802. void DMA0_04_DriverIRQHandler(void)
  803. {
  804. if ((EDMA_GetChannelStatusFlags(DMA0, 0U) & kEDMA_InterruptFlag) != 0U)
  805. {
  806. EDMA_HandleIRQ(s_EDMAHandle[0]);
  807. }
  808. if ((EDMA_GetChannelStatusFlags(DMA0, 4U) & kEDMA_InterruptFlag) != 0U)
  809. {
  810. EDMA_HandleIRQ(s_EDMAHandle[4]);
  811. }
  812. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  813. exception return operation might vector to incorrect interrupt */
  814. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  815. __DSB();
  816. #endif
  817. }
  818. void DMA0_15_DriverIRQHandler(void)
  819. {
  820. if ((EDMA_GetChannelStatusFlags(DMA0, 1U) & kEDMA_InterruptFlag) != 0U)
  821. {
  822. EDMA_HandleIRQ(s_EDMAHandle[1]);
  823. }
  824. if ((EDMA_GetChannelStatusFlags(DMA0, 5U) & kEDMA_InterruptFlag) != 0U)
  825. {
  826. EDMA_HandleIRQ(s_EDMAHandle[5]);
  827. }
  828. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  829. exception return operation might vector to incorrect interrupt */
  830. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  831. __DSB();
  832. #endif
  833. }
  834. void DMA0_26_DriverIRQHandler(void)
  835. {
  836. if ((EDMA_GetChannelStatusFlags(DMA0, 2U) & kEDMA_InterruptFlag) != 0U)
  837. {
  838. EDMA_HandleIRQ(s_EDMAHandle[2]);
  839. }
  840. if ((EDMA_GetChannelStatusFlags(DMA0, 6U) & kEDMA_InterruptFlag) != 0U)
  841. {
  842. EDMA_HandleIRQ(s_EDMAHandle[6]);
  843. }
  844. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  845. exception return operation might vector to incorrect interrupt */
  846. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  847. __DSB();
  848. #endif
  849. }
  850. void DMA0_37_DriverIRQHandler(void)
  851. {
  852. if ((EDMA_GetChannelStatusFlags(DMA0, 3U) & kEDMA_InterruptFlag) != 0U)
  853. {
  854. EDMA_HandleIRQ(s_EDMAHandle[3]);
  855. }
  856. if ((EDMA_GetChannelStatusFlags(DMA0, 7U) & kEDMA_InterruptFlag) != 0U)
  857. {
  858. EDMA_HandleIRQ(s_EDMAHandle[7]);
  859. }
  860. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  861. exception return operation might vector to incorrect interrupt */
  862. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  863. __DSB();
  864. #endif
  865. }
  866. #endif
  867. #if defined(DMA1)
  868. #if defined(DMA0)
  869. void DMA1_04_DriverIRQHandler(void)
  870. {
  871. if ((EDMA_GetChannelStatusFlags(DMA1, 0U) & kEDMA_InterruptFlag) != 0U)
  872. {
  873. EDMA_HandleIRQ(s_EDMAHandle[8]);
  874. }
  875. if ((EDMA_GetChannelStatusFlags(DMA1, 4U) & kEDMA_InterruptFlag) != 0U)
  876. {
  877. EDMA_HandleIRQ(s_EDMAHandle[12]);
  878. }
  879. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  880. exception return operation might vector to incorrect interrupt */
  881. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  882. __DSB();
  883. #endif
  884. }
  885. void DMA1_15_DriverIRQHandler(void)
  886. {
  887. if ((EDMA_GetChannelStatusFlags(DMA1, 1U) & kEDMA_InterruptFlag) != 0U)
  888. {
  889. EDMA_HandleIRQ(s_EDMAHandle[9]);
  890. }
  891. if ((EDMA_GetChannelStatusFlags(DMA1, 5U) & kEDMA_InterruptFlag) != 0U)
  892. {
  893. EDMA_HandleIRQ(s_EDMAHandle[13]);
  894. }
  895. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  896. exception return operation might vector to incorrect interrupt */
  897. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  898. __DSB();
  899. #endif
  900. }
  901. void DMA1_26_DriverIRQHandler(void)
  902. {
  903. if ((EDMA_GetChannelStatusFlags(DMA1, 2U) & kEDMA_InterruptFlag) != 0U)
  904. {
  905. EDMA_HandleIRQ(s_EDMAHandle[10]);
  906. }
  907. if ((EDMA_GetChannelStatusFlags(DMA1, 6U) & kEDMA_InterruptFlag) != 0U)
  908. {
  909. EDMA_HandleIRQ(s_EDMAHandle[14]);
  910. }
  911. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  912. exception return operation might vector to incorrect interrupt */
  913. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  914. __DSB();
  915. #endif
  916. }
  917. void DMA1_37_DriverIRQHandler(void)
  918. {
  919. if ((EDMA_GetChannelStatusFlags(DMA1, 3U) & kEDMA_InterruptFlag) != 0U)
  920. {
  921. EDMA_HandleIRQ(s_EDMAHandle[11]);
  922. }
  923. if ((EDMA_GetChannelStatusFlags(DMA1, 7U) & kEDMA_InterruptFlag) != 0U)
  924. {
  925. EDMA_HandleIRQ(s_EDMAHandle[15]);
  926. }
  927. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  928. exception return operation might vector to incorrect interrupt */
  929. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  930. __DSB();
  931. #endif
  932. }
  933. #else
  934. void DMA1_04_DriverIRQHandler(void)
  935. {
  936. if ((EDMA_GetChannelStatusFlags(DMA1, 0U) & kEDMA_InterruptFlag) != 0U)
  937. {
  938. EDMA_HandleIRQ(s_EDMAHandle[0]);
  939. }
  940. if ((EDMA_GetChannelStatusFlags(DMA1, 4U) & kEDMA_InterruptFlag) != 0U)
  941. {
  942. EDMA_HandleIRQ(s_EDMAHandle[4]);
  943. }
  944. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  945. exception return operation might vector to incorrect interrupt */
  946. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  947. __DSB();
  948. #endif
  949. }
  950. void DMA1_15_DriverIRQHandler(void)
  951. {
  952. if ((EDMA_GetChannelStatusFlags(DMA1, 1U) & kEDMA_InterruptFlag) != 0U)
  953. {
  954. EDMA_HandleIRQ(s_EDMAHandle[1]);
  955. }
  956. if ((EDMA_GetChannelStatusFlags(DMA1, 5U) & kEDMA_InterruptFlag) != 0U)
  957. {
  958. EDMA_HandleIRQ(s_EDMAHandle[5]);
  959. }
  960. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  961. exception return operation might vector to incorrect interrupt */
  962. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  963. __DSB();
  964. #endif
  965. }
  966. void DMA1_26_DriverIRQHandler(void)
  967. {
  968. if ((EDMA_GetChannelStatusFlags(DMA1, 2U) & kEDMA_InterruptFlag) != 0U)
  969. {
  970. EDMA_HandleIRQ(s_EDMAHandle[2]);
  971. }
  972. if ((EDMA_GetChannelStatusFlags(DMA1, 6U) & kEDMA_InterruptFlag) != 0U)
  973. {
  974. EDMA_HandleIRQ(s_EDMAHandle[6]);
  975. }
  976. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  977. exception return operation might vector to incorrect interrupt */
  978. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  979. __DSB();
  980. #endif
  981. }
  982. void DMA1_37_DriverIRQHandler(void)
  983. {
  984. if ((EDMA_GetChannelStatusFlags(DMA1, 3U) & kEDMA_InterruptFlag) != 0U)
  985. {
  986. EDMA_HandleIRQ(s_EDMAHandle[3]);
  987. }
  988. if ((EDMA_GetChannelStatusFlags(DMA1, 7U) & kEDMA_InterruptFlag) != 0U)
  989. {
  990. EDMA_HandleIRQ(s_EDMAHandle[7]);
  991. }
  992. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  993. exception return operation might vector to incorrect interrupt */
  994. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  995. __DSB();
  996. #endif
  997. }
  998. #endif
  999. #endif
  1000. #endif /* 8 channels (Shared) */
  1001. /* 16 channels (Shared): K32H844P */
  1002. #if defined(FSL_FEATURE_EDMA_MODULE_CHANNEL) && FSL_FEATURE_EDMA_MODULE_CHANNEL == 16U
  1003. void DMA0_08_DriverIRQHandler(void)
  1004. {
  1005. if ((EDMA_GetChannelStatusFlags(DMA0, 0U) & kEDMA_InterruptFlag) != 0U)
  1006. {
  1007. EDMA_HandleIRQ(s_EDMAHandle[0]);
  1008. }
  1009. if ((EDMA_GetChannelStatusFlags(DMA0, 8U) & kEDMA_InterruptFlag) != 0U)
  1010. {
  1011. EDMA_HandleIRQ(s_EDMAHandle[8]);
  1012. }
  1013. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1014. exception return operation might vector to incorrect interrupt */
  1015. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1016. __DSB();
  1017. #endif
  1018. }
  1019. void DMA0_19_DriverIRQHandler(void)
  1020. {
  1021. if ((EDMA_GetChannelStatusFlags(DMA0, 1U) & kEDMA_InterruptFlag) != 0U)
  1022. {
  1023. EDMA_HandleIRQ(s_EDMAHandle[1]);
  1024. }
  1025. if ((EDMA_GetChannelStatusFlags(DMA0, 9U) & kEDMA_InterruptFlag) != 0U)
  1026. {
  1027. EDMA_HandleIRQ(s_EDMAHandle[9]);
  1028. }
  1029. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1030. exception return operation might vector to incorrect interrupt */
  1031. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1032. __DSB();
  1033. #endif
  1034. }
  1035. void DMA0_210_DriverIRQHandler(void)
  1036. {
  1037. if ((EDMA_GetChannelStatusFlags(DMA0, 2U) & kEDMA_InterruptFlag) != 0U)
  1038. {
  1039. EDMA_HandleIRQ(s_EDMAHandle[2]);
  1040. }
  1041. if ((EDMA_GetChannelStatusFlags(DMA0, 10U) & kEDMA_InterruptFlag) != 0U)
  1042. {
  1043. EDMA_HandleIRQ(s_EDMAHandle[10]);
  1044. }
  1045. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1046. exception return operation might vector to incorrect interrupt */
  1047. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1048. __DSB();
  1049. #endif
  1050. }
  1051. void DMA0_311_DriverIRQHandler(void)
  1052. {
  1053. if ((EDMA_GetChannelStatusFlags(DMA0, 3U) & kEDMA_InterruptFlag) != 0U)
  1054. {
  1055. EDMA_HandleIRQ(s_EDMAHandle[3]);
  1056. }
  1057. if ((EDMA_GetChannelStatusFlags(DMA0, 11U) & kEDMA_InterruptFlag) != 0U)
  1058. {
  1059. EDMA_HandleIRQ(s_EDMAHandle[11]);
  1060. }
  1061. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1062. exception return operation might vector to incorrect interrupt */
  1063. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1064. __DSB();
  1065. #endif
  1066. }
  1067. void DMA0_412_DriverIRQHandler(void)
  1068. {
  1069. if ((EDMA_GetChannelStatusFlags(DMA0, 4U) & kEDMA_InterruptFlag) != 0U)
  1070. {
  1071. EDMA_HandleIRQ(s_EDMAHandle[4]);
  1072. }
  1073. if ((EDMA_GetChannelStatusFlags(DMA0, 12U) & kEDMA_InterruptFlag) != 0U)
  1074. {
  1075. EDMA_HandleIRQ(s_EDMAHandle[12]);
  1076. }
  1077. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1078. exception return operation might vector to incorrect interrupt */
  1079. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1080. __DSB();
  1081. #endif
  1082. }
  1083. void DMA0_513_DriverIRQHandler(void)
  1084. {
  1085. if ((EDMA_GetChannelStatusFlags(DMA0, 5U) & kEDMA_InterruptFlag) != 0U)
  1086. {
  1087. EDMA_HandleIRQ(s_EDMAHandle[5]);
  1088. }
  1089. if ((EDMA_GetChannelStatusFlags(DMA0, 13U) & kEDMA_InterruptFlag) != 0U)
  1090. {
  1091. EDMA_HandleIRQ(s_EDMAHandle[13]);
  1092. }
  1093. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1094. exception return operation might vector to incorrect interrupt */
  1095. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1096. __DSB();
  1097. #endif
  1098. }
  1099. void DMA0_614_DriverIRQHandler(void)
  1100. {
  1101. if ((EDMA_GetChannelStatusFlags(DMA0, 6U) & kEDMA_InterruptFlag) != 0U)
  1102. {
  1103. EDMA_HandleIRQ(s_EDMAHandle[6]);
  1104. }
  1105. if ((EDMA_GetChannelStatusFlags(DMA0, 14U) & kEDMA_InterruptFlag) != 0U)
  1106. {
  1107. EDMA_HandleIRQ(s_EDMAHandle[14]);
  1108. }
  1109. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1110. exception return operation might vector to incorrect interrupt */
  1111. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1112. __DSB();
  1113. #endif
  1114. }
  1115. void DMA0_715_DriverIRQHandler(void)
  1116. {
  1117. if ((EDMA_GetChannelStatusFlags(DMA0, 7U) & kEDMA_InterruptFlag) != 0U)
  1118. {
  1119. EDMA_HandleIRQ(s_EDMAHandle[7]);
  1120. }
  1121. if ((EDMA_GetChannelStatusFlags(DMA0, 15U) & kEDMA_InterruptFlag) != 0U)
  1122. {
  1123. EDMA_HandleIRQ(s_EDMAHandle[15]);
  1124. }
  1125. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1126. exception return operation might vector to incorrect interrupt */
  1127. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1128. __DSB();
  1129. #endif
  1130. }
  1131. #if defined(DMA1)
  1132. void DMA1_08_DriverIRQHandler(void)
  1133. {
  1134. if ((EDMA_GetChannelStatusFlags(DMA1, 0U) & kEDMA_InterruptFlag) != 0U)
  1135. {
  1136. EDMA_HandleIRQ(s_EDMAHandle[16]);
  1137. }
  1138. if ((EDMA_GetChannelStatusFlags(DMA1, 8U) & kEDMA_InterruptFlag) != 0U)
  1139. {
  1140. EDMA_HandleIRQ(s_EDMAHandle[24]);
  1141. }
  1142. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1143. exception return operation might vector to incorrect interrupt */
  1144. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1145. __DSB();
  1146. #endif
  1147. }
  1148. void DMA1_19_DriverIRQHandler(void)
  1149. {
  1150. if ((EDMA_GetChannelStatusFlags(DMA1, 1U) & kEDMA_InterruptFlag) != 0U)
  1151. {
  1152. EDMA_HandleIRQ(s_EDMAHandle[17]);
  1153. }
  1154. if ((EDMA_GetChannelStatusFlags(DMA1, 9U) & kEDMA_InterruptFlag) != 0U)
  1155. {
  1156. EDMA_HandleIRQ(s_EDMAHandle[25]);
  1157. }
  1158. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1159. exception return operation might vector to incorrect interrupt */
  1160. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1161. __DSB();
  1162. #endif
  1163. }
  1164. void DMA1_210_DriverIRQHandler(void)
  1165. {
  1166. if ((EDMA_GetChannelStatusFlags(DMA1, 2U) & kEDMA_InterruptFlag) != 0U)
  1167. {
  1168. EDMA_HandleIRQ(s_EDMAHandle[18]);
  1169. }
  1170. if ((EDMA_GetChannelStatusFlags(DMA1, 10U) & kEDMA_InterruptFlag) != 0U)
  1171. {
  1172. EDMA_HandleIRQ(s_EDMAHandle[26]);
  1173. }
  1174. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1175. exception return operation might vector to incorrect interrupt */
  1176. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1177. __DSB();
  1178. #endif
  1179. }
  1180. void DMA1_311_DriverIRQHandler(void)
  1181. {
  1182. if ((EDMA_GetChannelStatusFlags(DMA1, 3U) & kEDMA_InterruptFlag) != 0U)
  1183. {
  1184. EDMA_HandleIRQ(s_EDMAHandle[19]);
  1185. }
  1186. if ((EDMA_GetChannelStatusFlags(DMA1, 11U) & kEDMA_InterruptFlag) != 0U)
  1187. {
  1188. EDMA_HandleIRQ(s_EDMAHandle[27]);
  1189. }
  1190. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1191. exception return operation might vector to incorrect interrupt */
  1192. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1193. __DSB();
  1194. #endif
  1195. }
  1196. void DMA1_412_DriverIRQHandler(void)
  1197. {
  1198. if ((EDMA_GetChannelStatusFlags(DMA1, 4U) & kEDMA_InterruptFlag) != 0U)
  1199. {
  1200. EDMA_HandleIRQ(s_EDMAHandle[20]);
  1201. }
  1202. if ((EDMA_GetChannelStatusFlags(DMA1, 12U) & kEDMA_InterruptFlag) != 0U)
  1203. {
  1204. EDMA_HandleIRQ(s_EDMAHandle[28]);
  1205. }
  1206. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1207. exception return operation might vector to incorrect interrupt */
  1208. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1209. __DSB();
  1210. #endif
  1211. }
  1212. void DMA1_513_DriverIRQHandler(void)
  1213. {
  1214. if ((EDMA_GetChannelStatusFlags(DMA1, 5U) & kEDMA_InterruptFlag) != 0U)
  1215. {
  1216. EDMA_HandleIRQ(s_EDMAHandle[21]);
  1217. }
  1218. if ((EDMA_GetChannelStatusFlags(DMA1, 13U) & kEDMA_InterruptFlag) != 0U)
  1219. {
  1220. EDMA_HandleIRQ(s_EDMAHandle[29]);
  1221. }
  1222. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1223. exception return operation might vector to incorrect interrupt */
  1224. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1225. __DSB();
  1226. #endif
  1227. }
  1228. void DMA1_614_DriverIRQHandler(void)
  1229. {
  1230. if ((EDMA_GetChannelStatusFlags(DMA1, 6U) & kEDMA_InterruptFlag) != 0U)
  1231. {
  1232. EDMA_HandleIRQ(s_EDMAHandle[22]);
  1233. }
  1234. if ((EDMA_GetChannelStatusFlags(DMA1, 14U) & kEDMA_InterruptFlag) != 0U)
  1235. {
  1236. EDMA_HandleIRQ(s_EDMAHandle[30]);
  1237. }
  1238. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1239. exception return operation might vector to incorrect interrupt */
  1240. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1241. __DSB();
  1242. #endif
  1243. }
  1244. void DMA1_715_DriverIRQHandler(void)
  1245. {
  1246. if ((EDMA_GetChannelStatusFlags(DMA1, 7U) & kEDMA_InterruptFlag) != 0U)
  1247. {
  1248. EDMA_HandleIRQ(s_EDMAHandle[23]);
  1249. }
  1250. if ((EDMA_GetChannelStatusFlags(DMA1, 15U) & kEDMA_InterruptFlag) != 0U)
  1251. {
  1252. EDMA_HandleIRQ(s_EDMAHandle[31]);
  1253. }
  1254. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1255. exception return operation might vector to incorrect interrupt */
  1256. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1257. __DSB();
  1258. #endif
  1259. }
  1260. #endif
  1261. #endif /* 16 channels (Shared) */
  1262. /* 32 channels (Shared): k80 */
  1263. #if defined(FSL_FEATURE_EDMA_MODULE_CHANNEL) && FSL_FEATURE_EDMA_MODULE_CHANNEL == 32U
  1264. void DMA0_DMA16_DriverIRQHandler(void)
  1265. {
  1266. if ((EDMA_GetChannelStatusFlags(DMA0, 0U) & kEDMA_InterruptFlag) != 0U)
  1267. {
  1268. EDMA_HandleIRQ(s_EDMAHandle[0]);
  1269. }
  1270. if ((EDMA_GetChannelStatusFlags(DMA0, 16U) & kEDMA_InterruptFlag) != 0U)
  1271. {
  1272. EDMA_HandleIRQ(s_EDMAHandle[16]);
  1273. }
  1274. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1275. exception return operation might vector to incorrect interrupt */
  1276. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1277. __DSB();
  1278. #endif
  1279. }
  1280. void DMA1_DMA17_DriverIRQHandler(void)
  1281. {
  1282. if ((EDMA_GetChannelStatusFlags(DMA0, 1U) & kEDMA_InterruptFlag) != 0U)
  1283. {
  1284. EDMA_HandleIRQ(s_EDMAHandle[1]);
  1285. }
  1286. if ((EDMA_GetChannelStatusFlags(DMA0, 17U) & kEDMA_InterruptFlag) != 0U)
  1287. {
  1288. EDMA_HandleIRQ(s_EDMAHandle[17]);
  1289. }
  1290. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1291. exception return operation might vector to incorrect interrupt */
  1292. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1293. __DSB();
  1294. #endif
  1295. }
  1296. void DMA2_DMA18_DriverIRQHandler(void)
  1297. {
  1298. if ((EDMA_GetChannelStatusFlags(DMA0, 2U) & kEDMA_InterruptFlag) != 0U)
  1299. {
  1300. EDMA_HandleIRQ(s_EDMAHandle[2]);
  1301. }
  1302. if ((EDMA_GetChannelStatusFlags(DMA0, 18U) & kEDMA_InterruptFlag) != 0U)
  1303. {
  1304. EDMA_HandleIRQ(s_EDMAHandle[18]);
  1305. }
  1306. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1307. exception return operation might vector to incorrect interrupt */
  1308. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1309. __DSB();
  1310. #endif
  1311. }
  1312. void DMA3_DMA19_DriverIRQHandler(void)
  1313. {
  1314. if ((EDMA_GetChannelStatusFlags(DMA0, 3U) & kEDMA_InterruptFlag) != 0U)
  1315. {
  1316. EDMA_HandleIRQ(s_EDMAHandle[3]);
  1317. }
  1318. if ((EDMA_GetChannelStatusFlags(DMA0, 19U) & kEDMA_InterruptFlag) != 0U)
  1319. {
  1320. EDMA_HandleIRQ(s_EDMAHandle[19]);
  1321. }
  1322. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1323. exception return operation might vector to incorrect interrupt */
  1324. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1325. __DSB();
  1326. #endif
  1327. }
  1328. void DMA4_DMA20_DriverIRQHandler(void)
  1329. {
  1330. if ((EDMA_GetChannelStatusFlags(DMA0, 4U) & kEDMA_InterruptFlag) != 0U)
  1331. {
  1332. EDMA_HandleIRQ(s_EDMAHandle[4]);
  1333. }
  1334. if ((EDMA_GetChannelStatusFlags(DMA0, 20U) & kEDMA_InterruptFlag) != 0U)
  1335. {
  1336. EDMA_HandleIRQ(s_EDMAHandle[20]);
  1337. }
  1338. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1339. exception return operation might vector to incorrect interrupt */
  1340. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1341. __DSB();
  1342. #endif
  1343. }
  1344. void DMA5_DMA21_DriverIRQHandler(void)
  1345. {
  1346. if ((EDMA_GetChannelStatusFlags(DMA0, 5U) & kEDMA_InterruptFlag) != 0U)
  1347. {
  1348. EDMA_HandleIRQ(s_EDMAHandle[5]);
  1349. }
  1350. if ((EDMA_GetChannelStatusFlags(DMA0, 21U) & kEDMA_InterruptFlag) != 0U)
  1351. {
  1352. EDMA_HandleIRQ(s_EDMAHandle[21]);
  1353. }
  1354. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1355. exception return operation might vector to incorrect interrupt */
  1356. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1357. __DSB();
  1358. #endif
  1359. }
  1360. void DMA6_DMA22_DriverIRQHandler(void)
  1361. {
  1362. if ((EDMA_GetChannelStatusFlags(DMA0, 6U) & kEDMA_InterruptFlag) != 0U)
  1363. {
  1364. EDMA_HandleIRQ(s_EDMAHandle[6]);
  1365. }
  1366. if ((EDMA_GetChannelStatusFlags(DMA0, 22U) & kEDMA_InterruptFlag) != 0U)
  1367. {
  1368. EDMA_HandleIRQ(s_EDMAHandle[22]);
  1369. }
  1370. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1371. exception return operation might vector to incorrect interrupt */
  1372. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1373. __DSB();
  1374. #endif
  1375. }
  1376. void DMA7_DMA23_DriverIRQHandler(void)
  1377. {
  1378. if ((EDMA_GetChannelStatusFlags(DMA0, 7U) & kEDMA_InterruptFlag) != 0U)
  1379. {
  1380. EDMA_HandleIRQ(s_EDMAHandle[7]);
  1381. }
  1382. if ((EDMA_GetChannelStatusFlags(DMA0, 23U) & kEDMA_InterruptFlag) != 0U)
  1383. {
  1384. EDMA_HandleIRQ(s_EDMAHandle[23]);
  1385. }
  1386. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1387. exception return operation might vector to incorrect interrupt */
  1388. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1389. __DSB();
  1390. #endif
  1391. }
  1392. void DMA8_DMA24_DriverIRQHandler(void)
  1393. {
  1394. if ((EDMA_GetChannelStatusFlags(DMA0, 8U) & kEDMA_InterruptFlag) != 0U)
  1395. {
  1396. EDMA_HandleIRQ(s_EDMAHandle[8]);
  1397. }
  1398. if ((EDMA_GetChannelStatusFlags(DMA0, 24U) & kEDMA_InterruptFlag) != 0U)
  1399. {
  1400. EDMA_HandleIRQ(s_EDMAHandle[24]);
  1401. }
  1402. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1403. exception return operation might vector to incorrect interrupt */
  1404. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1405. __DSB();
  1406. #endif
  1407. }
  1408. void DMA9_DMA25_DriverIRQHandler(void)
  1409. {
  1410. if ((EDMA_GetChannelStatusFlags(DMA0, 9U) & kEDMA_InterruptFlag) != 0U)
  1411. {
  1412. EDMA_HandleIRQ(s_EDMAHandle[9]);
  1413. }
  1414. if ((EDMA_GetChannelStatusFlags(DMA0, 25U) & kEDMA_InterruptFlag) != 0U)
  1415. {
  1416. EDMA_HandleIRQ(s_EDMAHandle[25]);
  1417. }
  1418. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1419. exception return operation might vector to incorrect interrupt */
  1420. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1421. __DSB();
  1422. #endif
  1423. }
  1424. void DMA10_DMA26_DriverIRQHandler(void)
  1425. {
  1426. if ((EDMA_GetChannelStatusFlags(DMA0, 10U) & kEDMA_InterruptFlag) != 0U)
  1427. {
  1428. EDMA_HandleIRQ(s_EDMAHandle[10]);
  1429. }
  1430. if ((EDMA_GetChannelStatusFlags(DMA0, 26U) & kEDMA_InterruptFlag) != 0U)
  1431. {
  1432. EDMA_HandleIRQ(s_EDMAHandle[26]);
  1433. }
  1434. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1435. exception return operation might vector to incorrect interrupt */
  1436. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1437. __DSB();
  1438. #endif
  1439. }
  1440. void DMA11_DMA27_DriverIRQHandler(void)
  1441. {
  1442. if ((EDMA_GetChannelStatusFlags(DMA0, 11U) & kEDMA_InterruptFlag) != 0U)
  1443. {
  1444. EDMA_HandleIRQ(s_EDMAHandle[11]);
  1445. }
  1446. if ((EDMA_GetChannelStatusFlags(DMA0, 27U) & kEDMA_InterruptFlag) != 0U)
  1447. {
  1448. EDMA_HandleIRQ(s_EDMAHandle[27]);
  1449. }
  1450. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1451. exception return operation might vector to incorrect interrupt */
  1452. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1453. __DSB();
  1454. #endif
  1455. }
  1456. void DMA12_DMA28_DriverIRQHandler(void)
  1457. {
  1458. if ((EDMA_GetChannelStatusFlags(DMA0, 12U) & kEDMA_InterruptFlag) != 0U)
  1459. {
  1460. EDMA_HandleIRQ(s_EDMAHandle[12]);
  1461. }
  1462. if ((EDMA_GetChannelStatusFlags(DMA0, 28U) & kEDMA_InterruptFlag) != 0U)
  1463. {
  1464. EDMA_HandleIRQ(s_EDMAHandle[28]);
  1465. }
  1466. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1467. exception return operation might vector to incorrect interrupt */
  1468. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1469. __DSB();
  1470. #endif
  1471. }
  1472. void DMA13_DMA29_DriverIRQHandler(void)
  1473. {
  1474. if ((EDMA_GetChannelStatusFlags(DMA0, 13U) & kEDMA_InterruptFlag) != 0U)
  1475. {
  1476. EDMA_HandleIRQ(s_EDMAHandle[13]);
  1477. }
  1478. if ((EDMA_GetChannelStatusFlags(DMA0, 29U) & kEDMA_InterruptFlag) != 0U)
  1479. {
  1480. EDMA_HandleIRQ(s_EDMAHandle[29]);
  1481. }
  1482. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1483. exception return operation might vector to incorrect interrupt */
  1484. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1485. __DSB();
  1486. #endif
  1487. }
  1488. void DMA14_DMA30_DriverIRQHandler(void)
  1489. {
  1490. if ((EDMA_GetChannelStatusFlags(DMA0, 14U) & kEDMA_InterruptFlag) != 0U)
  1491. {
  1492. EDMA_HandleIRQ(s_EDMAHandle[14]);
  1493. }
  1494. if ((EDMA_GetChannelStatusFlags(DMA0, 30U) & kEDMA_InterruptFlag) != 0U)
  1495. {
  1496. EDMA_HandleIRQ(s_EDMAHandle[30]);
  1497. }
  1498. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1499. exception return operation might vector to incorrect interrupt */
  1500. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1501. __DSB();
  1502. #endif
  1503. }
  1504. void DMA15_DMA31_DriverIRQHandler(void)
  1505. {
  1506. if ((EDMA_GetChannelStatusFlags(DMA0, 15U) & kEDMA_InterruptFlag) != 0U)
  1507. {
  1508. EDMA_HandleIRQ(s_EDMAHandle[15]);
  1509. }
  1510. if ((EDMA_GetChannelStatusFlags(DMA0, 31U) & kEDMA_InterruptFlag) != 0U)
  1511. {
  1512. EDMA_HandleIRQ(s_EDMAHandle[31]);
  1513. }
  1514. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1515. exception return operation might vector to incorrect interrupt */
  1516. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1517. __DSB();
  1518. #endif
  1519. }
  1520. #endif /* 32 channels (Shared) */
  1521. /* 32 channels (Shared): MCIMX7U5_M4 */
  1522. #if defined(FSL_FEATURE_EDMA_MODULE_CHANNEL) && FSL_FEATURE_EDMA_MODULE_CHANNEL == 32U
  1523. void DMA0_0_4_DriverIRQHandler(void)
  1524. {
  1525. if ((EDMA_GetChannelStatusFlags(DMA0, 0U) & kEDMA_InterruptFlag) != 0U)
  1526. {
  1527. EDMA_HandleIRQ(s_EDMAHandle[0]);
  1528. }
  1529. if ((EDMA_GetChannelStatusFlags(DMA0, 4U) & kEDMA_InterruptFlag) != 0U)
  1530. {
  1531. EDMA_HandleIRQ(s_EDMAHandle[4]);
  1532. }
  1533. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1534. exception return operation might vector to incorrect interrupt */
  1535. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1536. __DSB();
  1537. #endif
  1538. }
  1539. void DMA0_1_5_DriverIRQHandler(void)
  1540. {
  1541. if ((EDMA_GetChannelStatusFlags(DMA0, 1U) & kEDMA_InterruptFlag) != 0U)
  1542. {
  1543. EDMA_HandleIRQ(s_EDMAHandle[1]);
  1544. }
  1545. if ((EDMA_GetChannelStatusFlags(DMA0, 5U) & kEDMA_InterruptFlag) != 0U)
  1546. {
  1547. EDMA_HandleIRQ(s_EDMAHandle[5]);
  1548. }
  1549. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1550. exception return operation might vector to incorrect interrupt */
  1551. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1552. __DSB();
  1553. #endif
  1554. }
  1555. void DMA0_2_6_DriverIRQHandler(void)
  1556. {
  1557. if ((EDMA_GetChannelStatusFlags(DMA0, 2U) & kEDMA_InterruptFlag) != 0U)
  1558. {
  1559. EDMA_HandleIRQ(s_EDMAHandle[2]);
  1560. }
  1561. if ((EDMA_GetChannelStatusFlags(DMA0, 6U) & kEDMA_InterruptFlag) != 0U)
  1562. {
  1563. EDMA_HandleIRQ(s_EDMAHandle[6]);
  1564. }
  1565. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1566. exception return operation might vector to incorrect interrupt */
  1567. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1568. __DSB();
  1569. #endif
  1570. }
  1571. void DMA0_3_7_DriverIRQHandler(void)
  1572. {
  1573. if ((EDMA_GetChannelStatusFlags(DMA0, 3U) & kEDMA_InterruptFlag) != 0U)
  1574. {
  1575. EDMA_HandleIRQ(s_EDMAHandle[3]);
  1576. }
  1577. if ((EDMA_GetChannelStatusFlags(DMA0, 7U) & kEDMA_InterruptFlag) != 0U)
  1578. {
  1579. EDMA_HandleIRQ(s_EDMAHandle[7]);
  1580. }
  1581. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1582. exception return operation might vector to incorrect interrupt */
  1583. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1584. __DSB();
  1585. #endif
  1586. }
  1587. void DMA0_8_12_DriverIRQHandler(void)
  1588. {
  1589. if ((EDMA_GetChannelStatusFlags(DMA0, 8U) & kEDMA_InterruptFlag) != 0U)
  1590. {
  1591. EDMA_HandleIRQ(s_EDMAHandle[8]);
  1592. }
  1593. if ((EDMA_GetChannelStatusFlags(DMA0, 12U) & kEDMA_InterruptFlag) != 0U)
  1594. {
  1595. EDMA_HandleIRQ(s_EDMAHandle[12]);
  1596. }
  1597. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1598. exception return operation might vector to incorrect interrupt */
  1599. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1600. __DSB();
  1601. #endif
  1602. }
  1603. void DMA0_9_13_DriverIRQHandler(void)
  1604. {
  1605. if ((EDMA_GetChannelStatusFlags(DMA0, 9U) & kEDMA_InterruptFlag) != 0U)
  1606. {
  1607. EDMA_HandleIRQ(s_EDMAHandle[9]);
  1608. }
  1609. if ((EDMA_GetChannelStatusFlags(DMA0, 13U) & kEDMA_InterruptFlag) != 0U)
  1610. {
  1611. EDMA_HandleIRQ(s_EDMAHandle[13]);
  1612. }
  1613. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1614. exception return operation might vector to incorrect interrupt */
  1615. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1616. __DSB();
  1617. #endif
  1618. }
  1619. void DMA0_10_14_DriverIRQHandler(void)
  1620. {
  1621. if ((EDMA_GetChannelStatusFlags(DMA0, 10U) & kEDMA_InterruptFlag) != 0U)
  1622. {
  1623. EDMA_HandleIRQ(s_EDMAHandle[10]);
  1624. }
  1625. if ((EDMA_GetChannelStatusFlags(DMA0, 14U) & kEDMA_InterruptFlag) != 0U)
  1626. {
  1627. EDMA_HandleIRQ(s_EDMAHandle[14]);
  1628. }
  1629. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1630. exception return operation might vector to incorrect interrupt */
  1631. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1632. __DSB();
  1633. #endif
  1634. }
  1635. void DMA0_11_15_DriverIRQHandler(void)
  1636. {
  1637. if ((EDMA_GetChannelStatusFlags(DMA0, 11U) & kEDMA_InterruptFlag) != 0U)
  1638. {
  1639. EDMA_HandleIRQ(s_EDMAHandle[11]);
  1640. }
  1641. if ((EDMA_GetChannelStatusFlags(DMA0, 15U) & kEDMA_InterruptFlag) != 0U)
  1642. {
  1643. EDMA_HandleIRQ(s_EDMAHandle[15]);
  1644. }
  1645. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1646. exception return operation might vector to incorrect interrupt */
  1647. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1648. __DSB();
  1649. #endif
  1650. }
  1651. void DMA0_16_20_DriverIRQHandler(void)
  1652. {
  1653. if ((EDMA_GetChannelStatusFlags(DMA0, 16U) & kEDMA_InterruptFlag) != 0U)
  1654. {
  1655. EDMA_HandleIRQ(s_EDMAHandle[16]);
  1656. }
  1657. if ((EDMA_GetChannelStatusFlags(DMA0, 20U) & kEDMA_InterruptFlag) != 0U)
  1658. {
  1659. EDMA_HandleIRQ(s_EDMAHandle[20]);
  1660. }
  1661. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1662. exception return operation might vector to incorrect interrupt */
  1663. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1664. __DSB();
  1665. #endif
  1666. }
  1667. void DMA0_17_21_DriverIRQHandler(void)
  1668. {
  1669. if ((EDMA_GetChannelStatusFlags(DMA0, 17U) & kEDMA_InterruptFlag) != 0U)
  1670. {
  1671. EDMA_HandleIRQ(s_EDMAHandle[17]);
  1672. }
  1673. if ((EDMA_GetChannelStatusFlags(DMA0, 21U) & kEDMA_InterruptFlag) != 0U)
  1674. {
  1675. EDMA_HandleIRQ(s_EDMAHandle[21]);
  1676. }
  1677. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1678. exception return operation might vector to incorrect interrupt */
  1679. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1680. __DSB();
  1681. #endif
  1682. }
  1683. void DMA0_18_22_DriverIRQHandler(void)
  1684. {
  1685. if ((EDMA_GetChannelStatusFlags(DMA0, 18U) & kEDMA_InterruptFlag) != 0U)
  1686. {
  1687. EDMA_HandleIRQ(s_EDMAHandle[18]);
  1688. }
  1689. if ((EDMA_GetChannelStatusFlags(DMA0, 22U) & kEDMA_InterruptFlag) != 0U)
  1690. {
  1691. EDMA_HandleIRQ(s_EDMAHandle[22]);
  1692. }
  1693. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1694. exception return operation might vector to incorrect interrupt */
  1695. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1696. __DSB();
  1697. #endif
  1698. }
  1699. void DMA0_19_23_DriverIRQHandler(void)
  1700. {
  1701. if ((EDMA_GetChannelStatusFlags(DMA0, 19U) & kEDMA_InterruptFlag) != 0U)
  1702. {
  1703. EDMA_HandleIRQ(s_EDMAHandle[19]);
  1704. }
  1705. if ((EDMA_GetChannelStatusFlags(DMA0, 23U) & kEDMA_InterruptFlag) != 0U)
  1706. {
  1707. EDMA_HandleIRQ(s_EDMAHandle[23]);
  1708. }
  1709. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1710. exception return operation might vector to incorrect interrupt */
  1711. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1712. __DSB();
  1713. #endif
  1714. }
  1715. void DMA0_24_28_DriverIRQHandler(void)
  1716. {
  1717. if ((EDMA_GetChannelStatusFlags(DMA0, 24U) & kEDMA_InterruptFlag) != 0U)
  1718. {
  1719. EDMA_HandleIRQ(s_EDMAHandle[24]);
  1720. }
  1721. if ((EDMA_GetChannelStatusFlags(DMA0, 28U) & kEDMA_InterruptFlag) != 0U)
  1722. {
  1723. EDMA_HandleIRQ(s_EDMAHandle[28]);
  1724. }
  1725. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1726. exception return operation might vector to incorrect interrupt */
  1727. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1728. __DSB();
  1729. #endif
  1730. }
  1731. void DMA0_25_29_DriverIRQHandler(void)
  1732. {
  1733. if ((EDMA_GetChannelStatusFlags(DMA0, 25U) & kEDMA_InterruptFlag) != 0U)
  1734. {
  1735. EDMA_HandleIRQ(s_EDMAHandle[25]);
  1736. }
  1737. if ((EDMA_GetChannelStatusFlags(DMA0, 29U) & kEDMA_InterruptFlag) != 0U)
  1738. {
  1739. EDMA_HandleIRQ(s_EDMAHandle[29]);
  1740. }
  1741. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1742. exception return operation might vector to incorrect interrupt */
  1743. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1744. __DSB();
  1745. #endif
  1746. }
  1747. void DMA0_26_30_DriverIRQHandler(void)
  1748. {
  1749. if ((EDMA_GetChannelStatusFlags(DMA0, 26U) & kEDMA_InterruptFlag) != 0U)
  1750. {
  1751. EDMA_HandleIRQ(s_EDMAHandle[26]);
  1752. }
  1753. if ((EDMA_GetChannelStatusFlags(DMA0, 30U) & kEDMA_InterruptFlag) != 0U)
  1754. {
  1755. EDMA_HandleIRQ(s_EDMAHandle[30]);
  1756. }
  1757. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1758. exception return operation might vector to incorrect interrupt */
  1759. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1760. __DSB();
  1761. #endif
  1762. }
  1763. void DMA0_27_31_DriverIRQHandler(void)
  1764. {
  1765. if ((EDMA_GetChannelStatusFlags(DMA0, 27U) & kEDMA_InterruptFlag) != 0U)
  1766. {
  1767. EDMA_HandleIRQ(s_EDMAHandle[27]);
  1768. }
  1769. if ((EDMA_GetChannelStatusFlags(DMA0, 31U) & kEDMA_InterruptFlag) != 0U)
  1770. {
  1771. EDMA_HandleIRQ(s_EDMAHandle[31]);
  1772. }
  1773. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1774. exception return operation might vector to incorrect interrupt */
  1775. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1776. __DSB();
  1777. #endif
  1778. }
  1779. #endif /* 32 channels (Shared): MCIMX7U5 */
  1780. /* 4 channels (No Shared): kv10 */
  1781. #if defined(FSL_FEATURE_EDMA_MODULE_CHANNEL) && FSL_FEATURE_EDMA_MODULE_CHANNEL > 0
  1782. void DMA0_DriverIRQHandler(void)
  1783. {
  1784. EDMA_HandleIRQ(s_EDMAHandle[0]);
  1785. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1786. exception return operation might vector to incorrect interrupt */
  1787. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1788. __DSB();
  1789. #endif
  1790. }
  1791. void DMA1_DriverIRQHandler(void)
  1792. {
  1793. EDMA_HandleIRQ(s_EDMAHandle[1]);
  1794. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1795. exception return operation might vector to incorrect interrupt */
  1796. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1797. __DSB();
  1798. #endif
  1799. }
  1800. void DMA2_DriverIRQHandler(void)
  1801. {
  1802. EDMA_HandleIRQ(s_EDMAHandle[2]);
  1803. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1804. exception return operation might vector to incorrect interrupt */
  1805. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1806. __DSB();
  1807. #endif
  1808. }
  1809. void DMA3_DriverIRQHandler(void)
  1810. {
  1811. EDMA_HandleIRQ(s_EDMAHandle[3]);
  1812. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1813. exception return operation might vector to incorrect interrupt */
  1814. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1815. __DSB();
  1816. #endif
  1817. }
  1818. /* 8 channels (No Shared) */
  1819. #if defined(FSL_FEATURE_EDMA_MODULE_CHANNEL) && FSL_FEATURE_EDMA_MODULE_CHANNEL > 4U
  1820. void DMA4_DriverIRQHandler(void)
  1821. {
  1822. EDMA_HandleIRQ(s_EDMAHandle[4]);
  1823. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1824. exception return operation might vector to incorrect interrupt */
  1825. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1826. __DSB();
  1827. #endif
  1828. }
  1829. void DMA5_DriverIRQHandler(void)
  1830. {
  1831. EDMA_HandleIRQ(s_EDMAHandle[5]);
  1832. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1833. exception return operation might vector to incorrect interrupt */
  1834. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1835. __DSB();
  1836. #endif
  1837. }
  1838. void DMA6_DriverIRQHandler(void)
  1839. {
  1840. EDMA_HandleIRQ(s_EDMAHandle[6]);
  1841. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1842. exception return operation might vector to incorrect interrupt */
  1843. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1844. __DSB();
  1845. #endif
  1846. }
  1847. void DMA7_DriverIRQHandler(void)
  1848. {
  1849. EDMA_HandleIRQ(s_EDMAHandle[7]);
  1850. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1851. exception return operation might vector to incorrect interrupt */
  1852. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1853. __DSB();
  1854. #endif
  1855. }
  1856. #endif /* FSL_FEATURE_EDMA_MODULE_CHANNEL == 8 */
  1857. /* 16 channels (No Shared) */
  1858. #if defined(FSL_FEATURE_EDMA_MODULE_CHANNEL) && FSL_FEATURE_EDMA_MODULE_CHANNEL > 8U
  1859. void DMA8_DriverIRQHandler(void)
  1860. {
  1861. EDMA_HandleIRQ(s_EDMAHandle[8]);
  1862. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1863. exception return operation might vector to incorrect interrupt */
  1864. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1865. __DSB();
  1866. #endif
  1867. }
  1868. void DMA9_DriverIRQHandler(void)
  1869. {
  1870. EDMA_HandleIRQ(s_EDMAHandle[9]);
  1871. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1872. exception return operation might vector to incorrect interrupt */
  1873. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1874. __DSB();
  1875. #endif
  1876. }
  1877. void DMA10_DriverIRQHandler(void)
  1878. {
  1879. EDMA_HandleIRQ(s_EDMAHandle[10]);
  1880. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1881. exception return operation might vector to incorrect interrupt */
  1882. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1883. __DSB();
  1884. #endif
  1885. }
  1886. void DMA11_DriverIRQHandler(void)
  1887. {
  1888. EDMA_HandleIRQ(s_EDMAHandle[11]);
  1889. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1890. exception return operation might vector to incorrect interrupt */
  1891. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1892. __DSB();
  1893. #endif
  1894. }
  1895. void DMA12_DriverIRQHandler(void)
  1896. {
  1897. EDMA_HandleIRQ(s_EDMAHandle[12]);
  1898. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1899. exception return operation might vector to incorrect interrupt */
  1900. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1901. __DSB();
  1902. #endif
  1903. }
  1904. void DMA13_DriverIRQHandler(void)
  1905. {
  1906. EDMA_HandleIRQ(s_EDMAHandle[13]);
  1907. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1908. exception return operation might vector to incorrect interrupt */
  1909. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1910. __DSB();
  1911. #endif
  1912. }
  1913. void DMA14_DriverIRQHandler(void)
  1914. {
  1915. EDMA_HandleIRQ(s_EDMAHandle[14]);
  1916. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1917. exception return operation might vector to incorrect interrupt */
  1918. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1919. __DSB();
  1920. #endif
  1921. }
  1922. void DMA15_DriverIRQHandler(void)
  1923. {
  1924. EDMA_HandleIRQ(s_EDMAHandle[15]);
  1925. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1926. exception return operation might vector to incorrect interrupt */
  1927. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1928. __DSB();
  1929. #endif
  1930. }
  1931. #endif /* FSL_FEATURE_EDMA_MODULE_CHANNEL == 16 */
  1932. /* 32 channels (No Shared) */
  1933. #if defined(FSL_FEATURE_EDMA_MODULE_CHANNEL) && FSL_FEATURE_EDMA_MODULE_CHANNEL > 16U
  1934. void DMA16_DriverIRQHandler(void)
  1935. {
  1936. EDMA_HandleIRQ(s_EDMAHandle[16]);
  1937. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1938. exception return operation might vector to incorrect interrupt */
  1939. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1940. __DSB();
  1941. #endif
  1942. }
  1943. void DMA17_DriverIRQHandler(void)
  1944. {
  1945. EDMA_HandleIRQ(s_EDMAHandle[17]);
  1946. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1947. exception return operation might vector to incorrect interrupt */
  1948. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1949. __DSB();
  1950. #endif
  1951. }
  1952. void DMA18_DriverIRQHandler(void)
  1953. {
  1954. EDMA_HandleIRQ(s_EDMAHandle[18]);
  1955. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1956. exception return operation might vector to incorrect interrupt */
  1957. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1958. __DSB();
  1959. #endif
  1960. }
  1961. void DMA19_DriverIRQHandler(void)
  1962. {
  1963. EDMA_HandleIRQ(s_EDMAHandle[19]);
  1964. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1965. exception return operation might vector to incorrect interrupt */
  1966. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1967. __DSB();
  1968. #endif
  1969. }
  1970. void DMA20_DriverIRQHandler(void)
  1971. {
  1972. EDMA_HandleIRQ(s_EDMAHandle[20]);
  1973. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1974. exception return operation might vector to incorrect interrupt */
  1975. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1976. __DSB();
  1977. #endif
  1978. }
  1979. void DMA21_DriverIRQHandler(void)
  1980. {
  1981. EDMA_HandleIRQ(s_EDMAHandle[21]);
  1982. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1983. exception return operation might vector to incorrect interrupt */
  1984. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1985. __DSB();
  1986. #endif
  1987. }
  1988. void DMA22_DriverIRQHandler(void)
  1989. {
  1990. EDMA_HandleIRQ(s_EDMAHandle[22]);
  1991. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  1992. exception return operation might vector to incorrect interrupt */
  1993. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  1994. __DSB();
  1995. #endif
  1996. }
  1997. void DMA23_DriverIRQHandler(void)
  1998. {
  1999. EDMA_HandleIRQ(s_EDMAHandle[23]);
  2000. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  2001. exception return operation might vector to incorrect interrupt */
  2002. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  2003. __DSB();
  2004. #endif
  2005. }
  2006. void DMA24_DriverIRQHandler(void)
  2007. {
  2008. EDMA_HandleIRQ(s_EDMAHandle[24]);
  2009. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  2010. exception return operation might vector to incorrect interrupt */
  2011. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  2012. __DSB();
  2013. #endif
  2014. }
  2015. void DMA25_DriverIRQHandler(void)
  2016. {
  2017. EDMA_HandleIRQ(s_EDMAHandle[25]);
  2018. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  2019. exception return operation might vector to incorrect interrupt */
  2020. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  2021. __DSB();
  2022. #endif
  2023. }
  2024. void DMA26_DriverIRQHandler(void)
  2025. {
  2026. EDMA_HandleIRQ(s_EDMAHandle[26]);
  2027. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  2028. exception return operation might vector to incorrect interrupt */
  2029. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  2030. __DSB();
  2031. #endif
  2032. }
  2033. void DMA27_DriverIRQHandler(void)
  2034. {
  2035. EDMA_HandleIRQ(s_EDMAHandle[27]);
  2036. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  2037. exception return operation might vector to incorrect interrupt */
  2038. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  2039. __DSB();
  2040. #endif
  2041. }
  2042. void DMA28_DriverIRQHandler(void)
  2043. {
  2044. EDMA_HandleIRQ(s_EDMAHandle[28]);
  2045. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  2046. exception return operation might vector to incorrect interrupt */
  2047. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  2048. __DSB();
  2049. #endif
  2050. }
  2051. void DMA29_DriverIRQHandler(void)
  2052. {
  2053. EDMA_HandleIRQ(s_EDMAHandle[29]);
  2054. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  2055. exception return operation might vector to incorrect interrupt */
  2056. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  2057. __DSB();
  2058. #endif
  2059. }
  2060. void DMA30_DriverIRQHandler(void)
  2061. {
  2062. EDMA_HandleIRQ(s_EDMAHandle[30]);
  2063. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  2064. exception return operation might vector to incorrect interrupt */
  2065. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  2066. __DSB();
  2067. #endif
  2068. }
  2069. void DMA31_DriverIRQHandler(void)
  2070. {
  2071. EDMA_HandleIRQ(s_EDMAHandle[31]);
  2072. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  2073. exception return operation might vector to incorrect interrupt */
  2074. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  2075. __DSB();
  2076. #endif
  2077. }
  2078. #endif /* FSL_FEATURE_EDMA_MODULE_CHANNEL == 32 */
  2079. #endif /* 4/8/16/32 channels (No Shared) */