fsl_edma.c 73 KB

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