fsl_edma.c 72 KB

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