Dma_Ip_Hwv2_AccessInline.h 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707
  1. /*==================================================================================================
  2. * Project : RTD AUTOSAR 4.4
  3. * Platform : CORTEXM
  4. * Peripheral : DMA,CACHE,TRGMUX,FLEXIO
  5. * Dependencies : none
  6. *
  7. * Autosar Version : 4.4.0
  8. * Autosar Revision : ASR_REL_4_4_REV_0000
  9. * Autosar Conf.Variant :
  10. * SW Version : 1.0.0
  11. * Build Version : S32K1_RTD_1_0_0_HF01_D2109_ASR_REL_4_4_REV_0000_20210907
  12. *
  13. * (c) Copyright 2020-2021 NXP Semiconductors
  14. * All Rights Reserved.
  15. *
  16. * NXP Confidential. This software is owned or controlled by NXP and may only be
  17. * used strictly in accordance with the applicable license terms. By expressly
  18. * accepting such terms or by downloading, installing, activating and/or otherwise
  19. * using the software, you are agreeing that you have read, and that you agree to
  20. * comply with and are bound by, such license terms. If you do not agree to be
  21. * bound by the applicable license terms, then you may not retain, install,
  22. * activate or otherwise use the software.
  23. ==================================================================================================*/
  24. /**
  25. * @file Dma_Ip_Hwv2_AccessInline.h
  26. *
  27. * @version 1.0.0
  28. *
  29. * @brief AUTOSAR Mcl - Dma Ip driver source file.
  30. * @details
  31. *
  32. * @addtogroup DMA_IP_DRIVER DMA IP Driver
  33. * @{
  34. */
  35. /* Prevention from multiple including the same header */
  36. #ifndef DMA_IP_HWV2_ACCESSINLINE_H_
  37. #define DMA_IP_HWV2_ACCESSINLINE_H_
  38. /*==================================================================================================
  39. * INCLUDE FILES
  40. * 1) system and project includes
  41. * 2) needed interfaces from external units
  42. * 3) internal and external interfaces from this unit
  43. ==================================================================================================*/
  44. #include "Dma_Ip.h"
  45. #include "Dma_Ip_Devassert.h"
  46. #if (DMA_IP_IS_AVAILABLE == STD_ON)
  47. #if (DMA_IP_HWV2_IS_AVAILABLE == STD_ON)
  48. /*==================================================================================================
  49. SOURCE FILE VERSION INFORMATION
  50. ==================================================================================================*/
  51. #define DMA_IP_HWV2_ACCESSINLINE_VENDOR_ID_H 43
  52. #define DMA_IP_HWV2_ACCESSINLINE_AR_RELEASE_MAJOR_VERSION_H 4
  53. #define DMA_IP_HWV2_ACCESSINLINE_AR_RELEASE_MINOR_VERSION_H 4
  54. #define DMA_IP_HWV2_ACCESSINLINE_AR_RELEASE_REVISION_VERSION_H 0
  55. #define DMA_IP_HWV2_ACCESSINLINE_SW_MAJOR_VERSION_H 1
  56. #define DMA_IP_HWV2_ACCESSINLINE_SW_MINOR_VERSION_H 0
  57. #define DMA_IP_HWV2_ACCESSINLINE_SW_PATCH_VERSION_H 0
  58. /*==================================================================================================
  59. FILE VERSION CHECKS
  60. ==================================================================================================*/
  61. /* Check if header file and Dma_Ip.h file are of the same vendor */
  62. #if (DMA_IP_HWV2_ACCESSINLINE_VENDOR_ID_H != DMA_IP_VENDOR_ID_H)
  63. #error "Dma_Ip_Hwv2_AccessInline.h and Dma_Ip.h have different vendor ids"
  64. #endif
  65. /* Check if header file and Dma_Ip.h file are of the same Autosar version */
  66. #if ((DMA_IP_HWV2_ACCESSINLINE_AR_RELEASE_MAJOR_VERSION_H != DMA_IP_AR_RELEASE_MAJOR_VERSION_H) || \
  67. (DMA_IP_HWV2_ACCESSINLINE_AR_RELEASE_MINOR_VERSION_H != DMA_IP_AR_RELEASE_MINOR_VERSION_H) || \
  68. (DMA_IP_HWV2_ACCESSINLINE_AR_RELEASE_REVISION_VERSION_H != DMA_IP_AR_RELEASE_REVISION_VERSION_H) \
  69. )
  70. #error "AutoSar Version Numbers of Dma_Ip_Hwv2_AccessInline.h and Dma_Ip.h are different"
  71. #endif
  72. /* Check if header file and Dma_Ip.h file are of the same Software version */
  73. #if ((DMA_IP_HWV2_ACCESSINLINE_SW_MAJOR_VERSION_H != DMA_IP_SW_MAJOR_VERSION_H) || \
  74. (DMA_IP_HWV2_ACCESSINLINE_SW_MINOR_VERSION_H != DMA_IP_SW_MINOR_VERSION_H) || \
  75. (DMA_IP_HWV2_ACCESSINLINE_SW_PATCH_VERSION_H != DMA_IP_SW_PATCH_VERSION_H) \
  76. )
  77. #error "Software Version Numbers of Dma_Ip_Hwv2_AccessInline.h and Dma_Ip.h are different"
  78. #endif
  79. /* Check if header file and Dma_Ip_Devassert.h file are of the same vendor */
  80. #if (DMA_IP_HWV2_ACCESSINLINE_VENDOR_ID_H != DMA_IP_DEVASSERT_VENDOR_ID_H)
  81. #error "Dma_Ip_Hwv2_AccessInline.h and Dma_Ip_Devassert.h have different vendor ids"
  82. #endif
  83. /* Check if header file and Dma_Ip_Devassert.h file are of the same Autosar version */
  84. #if ((DMA_IP_HWV2_ACCESSINLINE_AR_RELEASE_MAJOR_VERSION_H != DMA_IP_DEVASSERT_AR_RELEASE_MAJOR_VERSION_H) || \
  85. (DMA_IP_HWV2_ACCESSINLINE_AR_RELEASE_MINOR_VERSION_H != DMA_IP_DEVASSERT_AR_RELEASE_MINOR_VERSION_H) || \
  86. (DMA_IP_HWV2_ACCESSINLINE_AR_RELEASE_REVISION_VERSION_H != DMA_IP_DEVASSERT_AR_RELEASE_REVISION_VERSION_H) \
  87. )
  88. #error "AutoSar Version Numbers of Dma_Ip_Hwv2_AccessInline.h and Dma_Ip_Devassert.h are different"
  89. #endif
  90. /* Check if header file and Dma_Ip_Devassert.h file are of the same Software version */
  91. #if ((DMA_IP_HWV2_ACCESSINLINE_SW_MAJOR_VERSION_H != DMA_IP_DEVASSERT_SW_MAJOR_VERSION_H) || \
  92. (DMA_IP_HWV2_ACCESSINLINE_SW_MINOR_VERSION_H != DMA_IP_DEVASSERT_SW_MINOR_VERSION_H) || \
  93. (DMA_IP_HWV2_ACCESSINLINE_SW_PATCH_VERSION_H != DMA_IP_DEVASSERT_SW_PATCH_VERSION_H) \
  94. )
  95. #error "Software Version Numbers of Dma_Ip_Hwv2_AccessInline.h and Dma_Ip_Devassert.h are different"
  96. #endif
  97. #define MCL_START_SEC_CODE
  98. /* @violates @ref Mcl_Dma_h_REF_1 MISRA 2012 Required Directive 4.10, Precautions shall be taken in order to prevent the contents of a header file being included more than once. */
  99. #include "Mcl_MemMap.h"
  100. /*==================================================================================================
  101. * DMA INSTANCE CONFIGURATION FUNCTION - REGISTER ACCESS
  102. ==================================================================================================*/
  103. static inline void hwv2AccInlineDmaInst_SetConfig(Dma_Ip_Hwv2InstRegType * const ptInst, const Dma_Ip_LogicInstanceConfigType * const pxConfig)
  104. {
  105. uint32 reg = ptInst->reg_CR;
  106. reg = ((reg & (~(DMA_CR_EDBG_MASK))) | (DMA_CR_EDBG(pxConfig->EnDebug ? TRUE : FALSE)));
  107. reg = ((reg & (~(DMA_CR_ERCA_MASK))) | (DMA_CR_ERCA(pxConfig->EnRoundRobin ? TRUE : FALSE)));
  108. reg = ((reg & (~(DMA_CR_HOE_MASK))) | (DMA_CR_HOE(pxConfig->EnHaltAfterError ? TRUE : FALSE)));
  109. reg = ((reg & (~(DMA_CR_EMLM_MASK))) | (DMA_CR_EMLM(TRUE)));
  110. reg = ((reg & (~(DMA_CR_CLM_MASK))));
  111. ptInst->reg_CR = reg;
  112. }
  113. #if (DMA_IP_DMACRC_IS_AVAILABLE == STD_ON)
  114. static inline void hwv2AccInlineDmaInst_SetCrcConfig(Dma_Ip_HwCrcGlobalType * const ptInst, const Dma_Ip_LogicInstanceConfigType * const pxConfig)
  115. {
  116. uint32 reg = ptInst->reg_GEC;
  117. reg = ((reg & (~(DMA_CRC_GEC_SWAP_BIT_MASK))) | (DMA_CRC_GEC_SWAP_BIT(pxConfig->EnSwapBit ? TRUE : FALSE)));
  118. reg = ((reg & (~(DMA_CRC_GEC_SWAP_BYTE_MASK))) | (DMA_CRC_GEC_SWAP_BYTE(pxConfig->EnSwapByte ? TRUE : FALSE)));
  119. reg = ((reg & (~(DMA_CRC_GEC_GBL_EN_MASK))) | (DMA_CRC_GEC_GBL_EN(pxConfig->EnGlobal ? TRUE : FALSE)));
  120. ptInst->reg_GEC = reg;
  121. }
  122. #endif /* #if (DMA_IP_DMACRC_IS_AVAILABLE == STD_ON) */
  123. /*==================================================================================================
  124. * DMA INSTANCE CMD FUNCTIONS - REGISTER ACCESS
  125. ==================================================================================================*/
  126. static inline void hwv2AccInlineDmaInst_CmdCancelTransfer(Dma_Ip_Hwv2InstRegType * const ptInst)
  127. {
  128. uint32 reg = ptInst->reg_CR;
  129. /* Set CX bit to 1 */
  130. reg = ((reg & (~(DMA_CR_CX_MASK))) | (DMA_CR_CX(TRUE)));
  131. ptInst->reg_CR = reg;
  132. }
  133. static inline void hwv2AccInlineDmaInst_CmdCancelTransferWithError(Dma_Ip_Hwv2InstRegType * const ptInst)
  134. {
  135. uint32 reg = ptInst->reg_CR;
  136. /* Set ECX bit to 1 */
  137. reg = ((reg & (~(DMA_CR_ECX_MASK))) | (DMA_CR_ECX(TRUE)));
  138. ptInst->reg_CR = reg;
  139. }
  140. static inline void hwv2AccInlineDmaInst_CmdHalt(Dma_Ip_Hwv2InstRegType * const ptInst)
  141. {
  142. uint32 reg = ptInst->reg_CR;
  143. /* Set HALT bit to 1 */
  144. reg = ((reg & (~(DMA_CR_HALT_MASK))) | (DMA_CR_HALT(TRUE)));
  145. ptInst->reg_CR = reg;
  146. }
  147. static inline void hwv2AccInlineDmaInst_CmdResume(Dma_Ip_Hwv2InstRegType * const ptInst)
  148. {
  149. uint32 reg = ptInst->reg_CR;
  150. /* Set HALT bit to 0 */
  151. reg = ((reg & (~(DMA_CR_HALT_MASK))) | (DMA_CR_HALT(FALSE)));
  152. ptInst->reg_CR = reg;
  153. }
  154. /*==================================================================================================
  155. * DMA INSTANCE STATUS FUNCTIONS - REGISTER ACCESS
  156. ==================================================================================================*/
  157. static inline void hwv2AccInlineDmaInst_GetErrorStatus(const Dma_Ip_Hwv2InstRegType * const ptInst, uint32 * const pValue)
  158. {
  159. /* Get value from ES register */
  160. *pValue = (ptInst->reg_ES);
  161. }
  162. static inline void hwv2AccInlineDmaInst_GetActiveIdStatus(const Dma_Ip_Hwv2InstRegType * const ptInst, uint8 * const pValue)
  163. {
  164. /* Hardware version 2 doesn't support get active ID status */
  165. (void)ptInst;
  166. *pValue = (uint8)0xFFU;
  167. }
  168. static inline void hwv2AccInlineDmaInst_GetActiveStatus(const Dma_Ip_Hwv2InstRegType * const ptInst, boolean * const pBool)
  169. {
  170. /* Get value from CR register */
  171. *pBool = ((((ptInst->reg_CR & DMA_CR_ACTIVE_MASK) >> DMA_CR_ACTIVE_SHIFT) != 0U) ? TRUE : FALSE);
  172. }
  173. /*==================================================================================================
  174. * DMA CHANNEL CMD FUNCTIONS - REGISTER ACCESS
  175. ==================================================================================================*/
  176. static inline void hwv2AccInlineDmaCh_CmdSetRequest(Dma_Ip_Hwv2InstRegType * ptCh, const uint32 Channel)
  177. {
  178. /* Set SERQ bit */
  179. uint8 reg = DMA_SERQ_SERQ(Channel);
  180. ptCh->reg_SERQ = ((uint8)reg);
  181. }
  182. static inline void hwv2AccInlineDmaCh_CmdClearRequest(Dma_Ip_Hwv2InstRegType * ptCh, const uint32 Channel)
  183. {
  184. /* Set CERQ bit */
  185. uint8 reg = DMA_CERQ_CERQ(Channel);
  186. ptCh->reg_CERQ = ((uint8)reg);
  187. }
  188. static inline void hwv2AccInlineDmaCh_CmdSwReqStart(Dma_Ip_Hwv2InstRegType * ptCh, const uint32 Channel)
  189. {
  190. /* Set SSRT bit */
  191. uint8 reg = DMA_SSRT_SSRT(Channel);
  192. ptCh->reg_SSRT = ((uint8)reg);
  193. }
  194. static inline void hwv2AccInlineDmaCh_CmdClearDone(Dma_Ip_Hwv2InstRegType * ptCh, const uint32 Channel)
  195. {
  196. /* Set CDNE bit */
  197. uint8 reg = DMA_CDNE_CDNE(Channel);
  198. ptCh->reg_CDNE = ((uint8)reg);
  199. }
  200. static inline void hwv2AccInlineDmaCh_CmdClearError(Dma_Ip_Hwv2InstRegType * ptCh, const uint32 Channel)
  201. {
  202. /* Set CERR bit */
  203. uint8 reg = DMA_CERR_CERR(Channel);
  204. ptCh->reg_CERR = ((uint8)reg);
  205. }
  206. /*==================================================================================================
  207. * DMA CHANNEL STATUS FUNCTIONS - REGISTER ACCESS
  208. ==================================================================================================*/
  209. static inline void hwv2AccInlineDmaCh_GetErrorStatus(uint32 LocHwCh, const Dma_Ip_Hwv2InstRegType * ptCh, uint32 * const pValue)
  210. {
  211. if(ptCh->reg_ERR >> LocHwCh)
  212. {
  213. /* Get ES register value */
  214. *pValue = (uint32)(ptCh->reg_ES);
  215. }
  216. else
  217. {
  218. *pValue = 0U;
  219. }
  220. }
  221. static inline void hwv2AccInlineDmaCh_GetActiveStatus(const Dma_Ip_TcdRegType * ptTcd, boolean * const pBool)
  222. {
  223. /* Get ACTIVE bit value */
  224. *pBool = ((((ptTcd->reg_CSR & DMA_TCD_CSR_ACTIVE_MASK) >> DMA_TCD_CSR_ACTIVE_SHIFT) != 0U) ? TRUE : FALSE);
  225. }
  226. static inline void hwv2AccInlineDmaCh_GetDoneStatus(const Dma_Ip_TcdRegType * ptTcd, boolean * const pBool)
  227. {
  228. /* Get DONE bit value */
  229. *pBool = ((((ptTcd->reg_CSR & DMA_TCD_CSR_DONE_MASK) >> DMA_TCD_CSR_DONE_SHIFT) != 0U) ? TRUE : FALSE);
  230. }
  231. /*==================================================================================================
  232. * DMA CHANNEL GLOBAL FUNCTIONS - REGISTER ACCESS
  233. ==================================================================================================*/
  234. #if (DMA_IP_MASTER_ID_REPLICATION_IS_AVAILABLE == STD_ON)
  235. static inline void hwv2AccInlineDmaCh_SetControl_EnMasterIdReplication(Dma_Ip_Hwv2InstRegType * ptCh, uint32 Value)
  236. {
  237. /* To avoid misra violation */
  238. (void)ptCh;
  239. (void)Value;
  240. }
  241. #endif
  242. #if (DMA_IP_BUFFERED_WRITES_IS_AVAILABLE == STD_ON)
  243. static inline void hwv2AccInlineDmaCh_SetControl_EnBufferedWrites(Dma_Ip_Hwv2InstRegType * ptCh, uint32 Value)
  244. {
  245. /* To avoid misra violation */
  246. (void)ptCh;
  247. (void)Value;
  248. }
  249. #endif
  250. static inline void hwv2AccInlineDmaCh_SetRequest_SourceMux(volatile Dma_Ip_MuxRegType * pMuxChCfg, const uint32 Value)
  251. {
  252. /* Set value for SOURCE bit */
  253. Dma_Ip_MuxRegType reg = *pMuxChCfg;
  254. *pMuxChCfg = ((uint8)(reg & (~(DMAMUX_CHCFG_SOURCE_MASK))) | (DMAMUX_CHCFG_SOURCE(Value)));
  255. }
  256. static inline void hwv2AccInlineDmaCh_SetRequest_EnTriggerMux(volatile Dma_Ip_MuxRegType * pMuxChCfg, uint32 Value)
  257. {
  258. /* Set value for TRIG bit */
  259. Dma_Ip_MuxRegType reg = *pMuxChCfg;
  260. *pMuxChCfg = ((uint8)(reg & (~(DMAMUX_CHCFG_TRIG_MASK))) | (DMAMUX_CHCFG_TRIG(Value)));
  261. }
  262. static inline void hwv2AccInlineDmaCh_SetRequest_EnHwRequestMux(volatile Dma_Ip_MuxRegType * pMuxChCfg, const uint32 Value)
  263. {
  264. /* Set value for ENBL bit */
  265. Dma_Ip_MuxRegType reg = *pMuxChCfg;
  266. *pMuxChCfg = ((uint8)(reg & (~(DMAMUX_CHCFG_ENBL_MASK))) | (DMAMUX_CHCFG_ENBL(Value)));
  267. }
  268. static inline void hwv2AccInlineDmaCh_SetRequest_EnHwRequest(Dma_Ip_Hwv2InstRegType * ptCh, uint32 Channel, uint32 Value)
  269. {
  270. /* Set value for ERQ register */
  271. uint32 reg = ptCh->reg_ERQ;
  272. ptCh->reg_ERQ = ((reg & (~((uint32)((uint32)DMA_ERQ_ERQ0_MASK << Channel)))) | (Value << Channel));
  273. }
  274. static inline void hwv2AccInlineDmaCh_SetInterrupt_EnError(Dma_Ip_Hwv2InstRegType * ptCh, uint32 Channel, uint32 Value)
  275. {
  276. /* Set value for EEI register */
  277. uint32 reg = ptCh->reg_EEI;
  278. ptCh->reg_EEI = ((reg & (~((uint32)((uint32)DMA_EEI_EEI0_MASK << Channel)))) | (Value << Channel));
  279. }
  280. static inline void hwv2AccInlineDmaCh_SetPriority_Group(volatile const uint32 * const pGrpri, uint32 Value)
  281. {
  282. /* To avoid misra violations */
  283. (void)pGrpri;
  284. (void)Value;
  285. }
  286. static inline void hwv2AccInlineDmaCh_SetPriority_Level(Dma_Ip_Hwv2InstRegType * ptCh, uint32 Channel, uint32 Value)
  287. {
  288. /* Set value for CHPRI bit */
  289. uint8 reg = ptCh->reg_DCHPRI[Channel];
  290. ptCh->reg_DCHPRI[Channel] = ((uint8)((reg & (~(DMA_DCHPRI_CHPRI_MASK))) | (DMA_DCHPRI_CHPRI(Value))));
  291. }
  292. #if (DMA_IP_PREEMPTION_IS_AVAILABLE == STD_ON)
  293. static inline void hwv2AccInlineDmaCh_SetPriority_EnPreemption(Dma_Ip_Hwv2InstRegType * ptCh, uint32 Channel, uint32 Value)
  294. {
  295. /* Set value for ECP bit */
  296. uint8 reg = ptCh->reg_DCHPRI[Channel];
  297. ptCh->reg_DCHPRI[Channel] = ((uint8)((reg & (~(DMA_DCHPRI_ECP_MASK))) | (DMA_DCHPRI_ECP(Value))));
  298. }
  299. #endif
  300. #if (DMA_IP_DISABLE_PREEMPT_IS_AVAILABLE == STD_ON)
  301. static inline void hwv2AccInlineDmaCh_SetPriority_DisPreempt(Dma_Ip_Hwv2InstRegType * ptCh, uint32 Channel, uint32 Value)
  302. {
  303. /* Set value for DPA bit */
  304. uint8 reg = ptCh->reg_DCHPRI[Channel];
  305. ptCh->reg_DCHPRI[Channel] = ((uint8)((reg & (~(DMA_DCHPRI_DPA_MASK))) | (DMA_DCHPRI_DPA(Value))));
  306. }
  307. #endif
  308. /*==================================================================================================
  309. * DMA CHANNEL TRANSFER FUNCTIONS - REGISTER ACCESS
  310. ==================================================================================================*/
  311. static inline void hwv2AccInlineDmaCh_SetSource_Address(Dma_Ip_TcdRegType * ptTcd, const uint32 Value)
  312. {
  313. /* Set value for SADDR bit */
  314. uint32 reg = ptTcd->reg_SADDR;
  315. ptTcd->reg_SADDR = ((reg & (~(DMA_TCD_SADDR_SADDR_MASK))) | (DMA_TCD_SADDR_SADDR(Value)));
  316. }
  317. static inline void hwv2AccInlineDmaCh_SetSource_SignedOffset(Dma_Ip_TcdRegType * ptTcd, const uint32 Value)
  318. {
  319. /* Set value for SOFF bit */
  320. uint32 reg = ptTcd->reg_SOFF;
  321. ptTcd->reg_SOFF = ((uint16)(reg & (~(DMA_TCD_SOFF_SOFF_MASK))) | (DMA_TCD_SOFF_SOFF(Value)));
  322. }
  323. static inline void hwv2AccInlineDmaCh_SetSource_SignedLastAddrAdj(Dma_Ip_TcdRegType * ptTcd, const uint32 Value)
  324. {
  325. /* Set value for SLAST bit */
  326. uint32 reg = ptTcd->reg_SLAST;
  327. ptTcd->reg_SLAST = ((reg & (~(DMA_TCD_SLAST_SLAST_MASK))) | (DMA_TCD_SLAST_SLAST(Value)));
  328. }
  329. static inline void hwv2AccInlineDmaCh_SetSource_TransferSize(Dma_Ip_TcdRegType * ptTcd, const uint32 Value)
  330. {
  331. /* Set value for SSIZE bit */
  332. uint32 reg = ptTcd->reg_ATTR;
  333. ptTcd->reg_ATTR = ((uint16)(reg & (~(DMA_TCD_ATTR_SSIZE_MASK))) | (DMA_TCD_ATTR_SSIZE(Value)));
  334. }
  335. static inline void hwv2AccInlineDmaCh_SetSource_Modulo(Dma_Ip_TcdRegType * ptTcd, const uint32 Value)
  336. {
  337. /* Set value for SMOD bit */
  338. uint32 reg = ptTcd->reg_ATTR;
  339. ptTcd->reg_ATTR = ((uint16)(reg & (~(DMA_TCD_ATTR_SMOD_MASK))) | (DMA_TCD_ATTR_SMOD(Value)));
  340. }
  341. static inline void hwv2AccInlineDmaCh_SetDestination_Address(Dma_Ip_TcdRegType * ptTcd, const uint32 Value)
  342. {
  343. /* Set value for DADDR bit */
  344. uint32 reg = ptTcd->reg_DADDR;
  345. ptTcd->reg_DADDR = ((reg & (~(DMA_TCD_DADDR_DADDR_MASK))) | (DMA_TCD_DADDR_DADDR(Value)));
  346. }
  347. static inline void hwv2AccInlineDmaCh_SetDestination_SignedOffset(Dma_Ip_TcdRegType * ptTcd, const uint32 Value)
  348. {
  349. /* Set value for DOFF bit */
  350. uint16 reg = ptTcd->reg_DOFF;
  351. ptTcd->reg_DOFF = ((uint16)(reg & (~(DMA_TCD_DOFF_DOFF_MASK))) | (DMA_TCD_DOFF_DOFF(Value)));
  352. }
  353. static inline void hwv2AccInlineDmaCh_SetDestination_LastAddrAdj(Dma_Ip_TcdRegType * ptTcd, const uint32 Value)
  354. {
  355. /* Set value for DLASTSGA bit */
  356. uint32 reg = ptTcd->reg_DLAST_SGA;
  357. ptTcd->reg_DLAST_SGA = ((reg & (~(DMA_TCD_DLASTSGA_DLASTSGA_MASK))) | (DMA_TCD_DLASTSGA_DLASTSGA(Value)));
  358. }
  359. static inline void hwv2AccInlineDmaCh_SetDestination_TransferSize(Dma_Ip_TcdRegType * ptTcd, const uint32 Value)
  360. {
  361. /* Set value for DSIZE bit */
  362. uint16 reg = ptTcd->reg_ATTR;
  363. ptTcd->reg_ATTR = ((uint16)(reg & (~(DMA_TCD_ATTR_DSIZE_MASK))) | (DMA_TCD_ATTR_DSIZE(Value)));
  364. }
  365. static inline void hwv2AccInlineDmaCh_SetDestination_Modulo(Dma_Ip_TcdRegType * ptTcd, const uint32 Value)
  366. {
  367. /* Set value for DMOD bit */
  368. uint16 reg = ptTcd->reg_ATTR;
  369. ptTcd->reg_ATTR = ((uint16)(reg & (~(DMA_TCD_ATTR_DMOD_MASK))) | (DMA_TCD_ATTR_DMOD(Value)));
  370. }
  371. static inline void hwv2AccInlineDmaCh_SetMinorLoop_enSrcOffset(Dma_Ip_TcdRegType * ptTcd, const uint32 Value)
  372. {
  373. /* Set value for SMLOE bit */
  374. uint32 reg = ptTcd->reg_NBYTES.reg_MLOFFYES;
  375. ptTcd->reg_NBYTES.reg_MLOFFYES = ((reg & (~(DMA_TCD_NBYTES_MLOFFYES_SMLOE_MASK))) | (DMA_TCD_NBYTES_MLOFFYES_SMLOE(Value)));
  376. }
  377. static inline void hwv2AccInlineDmaCh_SetMinorLoop_enDstOffset(Dma_Ip_TcdRegType * ptTcd, const uint32 Value)
  378. {
  379. /* Set value for DMLOE bit */
  380. uint32 reg = ptTcd->reg_NBYTES.reg_MLOFFYES;
  381. ptTcd->reg_NBYTES.reg_MLOFFYES = ((reg & (~(DMA_TCD_NBYTES_MLOFFYES_DMLOE_MASK))) | (DMA_TCD_NBYTES_MLOFFYES_DMLOE(Value)));
  382. }
  383. static inline void hwv2AccInlineDmaCh_SetMinorLoop_SignedOffset(Dma_Ip_TcdRegType * ptTcd, const uint32 Value)
  384. {
  385. /* Set value for MLOFF bit */
  386. uint32 reg = ptTcd->reg_NBYTES.reg_MLOFFYES;
  387. ptTcd->reg_NBYTES.reg_MLOFFYES = ((reg & (~(DMA_TCD_NBYTES_MLOFFYES_MLOFF_MASK))) | (DMA_TCD_NBYTES_MLOFFYES_MLOFF(Value)));
  388. }
  389. static inline void hwv2AccInlineDmaCh_SetMinorLoop_EnLink(Dma_Ip_TcdRegType * ptTcd, const uint32 Value)
  390. {
  391. /* Set value for ELINK bit */
  392. uint16 reg = ptTcd->reg_BITER.reg_ELINKYES;
  393. ptTcd->reg_BITER.reg_ELINKYES = ((uint16)(reg & (~(DMA_TCD_BITER_ELINKYES_ELINK_MASK))) | (DMA_TCD_BITER_ELINKYES_ELINK(Value)));
  394. reg = ptTcd->reg_CITER.reg_ELINKYES;
  395. ptTcd->reg_CITER.reg_ELINKYES = ((uint16)(reg & (~(DMA_TCD_CITER_ELINKYES_ELINK_MASK))) | (DMA_TCD_CITER_ELINKYES_ELINK(Value)));
  396. }
  397. static inline void hwv2AccInlineDmaCh_SetMinorLoop_LinkCh(Dma_Ip_TcdRegType * ptTcd, const uint32 Value)
  398. {
  399. /* Set value for LINKCH bit */
  400. uint16 reg = ptTcd->reg_BITER.reg_ELINKYES;
  401. ptTcd->reg_BITER.reg_ELINKYES = ((uint16)(reg & (~(DMA_TCD_BITER_ELINKYES_LINKCH_MASK))) | (DMA_TCD_BITER_ELINKYES_LINKCH(Value)));
  402. reg = ptTcd->reg_CITER.reg_ELINKYES;
  403. ptTcd->reg_CITER.reg_ELINKYES = ((uint16)(reg & (~(DMA_TCD_CITER_ELINKYES_LINKCH_MASK))) | (DMA_TCD_CITER_ELINKYES_LINKCH(Value)));
  404. }
  405. static inline void hwv2AccInlineDmaCh_SetMinorLoop_Size(Dma_Ip_TcdRegType * ptTcd, const uint32 Value)
  406. {
  407. /* Set value for NBYTES bit */
  408. uint32 reg = ptTcd->reg_NBYTES.reg_MLOFFNO;
  409. if(0U != (reg & (DMA_TCD_NBYTES_MLOFFYES_SMLOE_MASK | DMA_TCD_NBYTES_MLOFFYES_DMLOE_MASK)))
  410. {
  411. ptTcd->reg_NBYTES.reg_MLOFFNO = ((reg & (~(DMA_TCD_NBYTES_MLOFFYES_NBYTES_MASK))) | (DMA_TCD_NBYTES_MLOFFYES_NBYTES(Value)));
  412. }
  413. else
  414. {
  415. ptTcd->reg_NBYTES.reg_MLOFFNO = ((reg & (~(DMA_TCD_NBYTES_MLOFFNO_NBYTES_MASK))) | (DMA_TCD_NBYTES_MLOFFNO_NBYTES(Value)));
  416. }
  417. }
  418. static inline void hwv2AccInlineDmaCh_SetMajorLoop_EnLink(Dma_Ip_TcdRegType * ptTcd, const uint32 Value)
  419. {
  420. /* Set value for MAJORELINK bit */
  421. uint16 reg = ptTcd->reg_CSR;
  422. ptTcd->reg_CSR = ((uint16)(reg & (~(DMA_TCD_CSR_MAJORELINK_MASK))) | (DMA_TCD_CSR_MAJORELINK(Value)));
  423. }
  424. static inline void hwv2AccInlineDmaCh_SetMajorLoop_LinkCh(Dma_Ip_TcdRegType * ptTcd, const uint32 Value)
  425. {
  426. /* Set value for MAJORLINKCH bit */
  427. uint16 reg = ptTcd->reg_CSR;
  428. ptTcd->reg_CSR = ((uint16)(reg & (~(DMA_TCD_CSR_MAJORLINKCH_MASK))) | (DMA_TCD_CSR_MAJORLINKCH(Value)));
  429. }
  430. static inline void hwv2AccInlineDmaCh_SetMajorLoop_Count(Dma_Ip_TcdRegType * ptTcd, const uint32 Value)
  431. {
  432. /* Set value for BITER and CITER bit */
  433. uint16 reg = (ptTcd->reg_BITER.reg_ELINKYES & (DMA_TCD_BITER_ELINKYES_ELINK_MASK)) |
  434. (ptTcd->reg_CITER.reg_ELINKYES & (DMA_TCD_CITER_ELINKYES_ELINK_MASK));
  435. if(0U != reg)
  436. {
  437. reg = ptTcd->reg_BITER.reg_ELINKYES;
  438. ptTcd->reg_BITER.reg_ELINKYES = ((uint16)(reg & (~(DMA_TCD_BITER_ELINKYES_BITER_MASK))) | (DMA_TCD_BITER_ELINKYES_BITER(Value)));
  439. reg = ptTcd->reg_CITER.reg_ELINKYES;
  440. ptTcd->reg_CITER.reg_ELINKYES = ((uint16)(reg & (~(DMA_TCD_CITER_ELINKYES_CITER_MASK))) | (DMA_TCD_CITER_ELINKYES_CITER(Value)));
  441. }
  442. else
  443. {
  444. reg = ptTcd->reg_BITER.reg_ELINKNO;
  445. ptTcd->reg_BITER.reg_ELINKNO = ((uint16)(reg & (~(DMA_TCD_BITER_ELINKNO_BITER_MASK))) | (DMA_TCD_BITER_ELINKNO_BITER(Value)));
  446. reg = ptTcd->reg_CITER.reg_ELINKNO;
  447. ptTcd->reg_CITER.reg_ELINKNO = ((uint16)(reg & (~(DMA_TCD_CITER_ELINKNO_CITER_MASK))) | (DMA_TCD_CITER_ELINKNO_CITER(Value)));
  448. }
  449. }
  450. static inline void hwv2AccInlineDmaCh_SetControl_ScatterGatherAddress(Dma_Ip_TcdRegType * ptTcd, const uint32 Value)
  451. {
  452. /* Set value for DLASTSGA bit */
  453. uint32 reg = ptTcd->reg_DLAST_SGA;
  454. ptTcd->reg_DLAST_SGA = ((reg & (~(DMA_TCD_DLASTSGA_DLASTSGA_MASK))) | (DMA_TCD_DLASTSGA_DLASTSGA(Value)));
  455. }
  456. #if (DMA_IP_STORE_DST_ADDR_IS_AVAILABLE == STD_ON)
  457. static inline void hwv2AccInlineDmaCh_SetControl_StoreDestinationAddress(Dma_Ip_TcdRegType * ptTcd, const uint32 Value)
  458. {
  459. /* To avoid misra violations */
  460. (void)ptTcd;
  461. (void)Value;
  462. }
  463. #endif
  464. static inline void hwv2AccInlineDmaCh_SetControl_EnStart(Dma_Ip_TcdRegType * ptTcd, const boolean Value)
  465. {
  466. /* Set value for START bit */
  467. uint16 reg = ptTcd->reg_CSR;
  468. ptTcd->reg_CSR = ((uint16)(reg & (~(DMA_TCD_CSR_START_MASK))) | (DMA_TCD_CSR_START(Value ? 1U : 0U)));
  469. }
  470. static inline void hwv2AccInlineDmaCh_SetControl_EnMajor(Dma_Ip_TcdRegType * ptTcd, const uint32 Value)
  471. {
  472. /* Set value for INTMAJOR bit */
  473. uint16 reg = ptTcd->reg_CSR;
  474. ptTcd->reg_CSR = ((uint16)(reg & (~(DMA_TCD_CSR_INTMAJOR_MASK))) | (DMA_TCD_CSR_INTMAJOR(Value)));
  475. }
  476. static inline void hwv2AccInlineDmaCh_SetControl_EnHalfMajor(Dma_Ip_TcdRegType * ptTcd, const uint32 Value)
  477. {
  478. /* Set value for INTHALF bit */
  479. uint16 reg = ptTcd->reg_CSR;
  480. ptTcd->reg_CSR = ((uint16)(reg & (~(DMA_TCD_CSR_INTHALF_MASK))) | (DMA_TCD_CSR_INTHALF(Value)));
  481. }
  482. static inline void hwv2AccInlineDmaCh_SetControl_DisAutoHwRequest(Dma_Ip_TcdRegType * ptTcd, const uint32 Value)
  483. {
  484. /* Set value for DREQ bit */
  485. uint16 reg = ptTcd->reg_CSR;
  486. ptTcd->reg_CSR = ((uint16)(reg & (~(DMA_TCD_CSR_DREQ_MASK))) | (DMA_TCD_CSR_DREQ(Value)));
  487. }
  488. #if (DMA_IP_END_OF_PACKET_SIGNAL_IS_AVAILABLE == STD_ON)
  489. static inline void hwv2AccInlineDmaCh_SetControl_EnEndOfPacketSignal(Dma_Ip_TcdRegType * ptTcd, const uint32 Value)
  490. {
  491. /* To avoid misra violations */
  492. (void)ptTcd;
  493. (void)Value;
  494. }
  495. #endif
  496. static inline void hwv2AccInlineDmaCh_SetControl_BandwidthControl(Dma_Ip_TcdRegType * ptTcd, const uint32 Value)
  497. {
  498. /* Set value for BWC bit */
  499. uint16 reg = ptTcd->reg_CSR;
  500. ptTcd->reg_CSR = ((uint16)(reg & (~(DMA_TCD_CSR_BWC_MASK))) | (DMA_TCD_CSR_BWC(Value)));
  501. }
  502. #if (DMA_IP_DMACRC_IS_AVAILABLE == STD_ON)
  503. /*==================================================================================================
  504. * DMA CHANNEL CRC FUNCTIONS - REGISTER ACCESS
  505. ==================================================================================================*/
  506. static inline void hwv2AccInlineDmaCh_SetCrc_InstanceChannelSelect(Dma_Ip_HwCrcCtrlType * const ptCrc, uint32 Value)
  507. {
  508. (void)ptCrc;
  509. (void)Value;
  510. }
  511. static inline void hwv2AccInlineDmaCh_SetCrc_ModeSelect(Dma_Ip_HwCrcCtrlType * const ptCrc, uint32 Value)
  512. {
  513. (void)ptCrc;
  514. (void)Value;
  515. }
  516. static inline void hwv2AccInlineDmaCh_SetCrc_PolynomialSelect(Dma_Ip_HwCrcCtrlType * const ptCrc, uint32 Value)
  517. {
  518. (void)ptCrc;
  519. (void)Value;
  520. }
  521. static inline void hwv2AccInlineDmaCh_SetCrc_EnableInitialValue(Dma_Ip_HwCrcCtrlType * const ptCrc, uint32 Value)
  522. {
  523. (void)ptCrc;
  524. (void)Value;
  525. }
  526. static inline void hwv2AccInlineDmaCh_SetCrc_InitialValue(Dma_Ip_HwCrcCtrlType * const ptCrc, uint32 Value)
  527. {
  528. (void)ptCrc;
  529. (void)Value;
  530. }
  531. static inline void hwv2AccInlineDmaCh_SetCrc_EnableLogic(Dma_Ip_HwCrcCtrlType * const ptCrc, uint32 Value)
  532. {
  533. (void)ptCrc;
  534. (void)Value;
  535. }
  536. #endif /* #if (DMA_IP_DMACRC_IS_AVAILABLE == STD_ON) */
  537. /*==================================================================================================
  538. * DMA CHANNEL GET PARAMETER - REGISTER ACCESS
  539. ==================================================================================================*/
  540. static inline void hwv2AccInlineDmaCh_GetSourceAddress(const Dma_Ip_TcdRegType * ptTcd, uint32 * const retValue)
  541. {
  542. /* Get SADDR register value */
  543. *retValue = (uint32)ptTcd->reg_SADDR;
  544. }
  545. static inline void hwv2AccInlineDmaCh_GetDestinationAddress(const Dma_Ip_TcdRegType * ptTcd, uint32 * const retValue)
  546. {
  547. /* Get DADDR register value */
  548. *retValue = (uint32)ptTcd->reg_DADDR;
  549. }
  550. static inline void hwv2AccInlineDmaCh_GetBeginIterCount(const Dma_Ip_TcdRegType * ptTcd, uint32 * const retValue)
  551. {
  552. /* Get BITER bit value */
  553. uint16 reg = ptTcd->reg_BITER.reg_ELINKYES & (DMA_TCD_BITER_ELINKYES_ELINK_MASK);
  554. if(0U != reg)
  555. {
  556. *retValue = (uint32)((ptTcd->reg_BITER.reg_ELINKYES & (uint32)DMA_TCD_BITER_ELINKYES_BITER_MASK) >> DMA_TCD_BITER_ELINKYES_BITER_SHIFT);
  557. }
  558. else
  559. {
  560. *retValue = (uint32)((ptTcd->reg_BITER.reg_ELINKYES & (uint32)DMA_TCD_BITER_ELINKNO_BITER_MASK) >> DMA_TCD_BITER_ELINKNO_BITER_SHIFT);
  561. }
  562. }
  563. static inline void hwv2AccInlineDmaCh_GetCurrentIterCount(const Dma_Ip_TcdRegType * ptTcd, uint32 * const retValue)
  564. {
  565. /* Get CITER bit value */
  566. uint16 reg = (ptTcd->reg_CITER.reg_ELINKYES & (DMA_TCD_CITER_ELINKYES_ELINK_MASK));
  567. if(0U != reg)
  568. {
  569. *retValue = (uint32)((ptTcd->reg_CITER.reg_ELINKYES & (uint32)DMA_TCD_CITER_ELINKYES_CITER_MASK) >> DMA_TCD_CITER_ELINKYES_CITER_SHIFT);
  570. }
  571. else
  572. {
  573. *retValue = (uint32)((ptTcd->reg_CITER.reg_ELINKNO & (uint32)DMA_TCD_CITER_ELINKNO_CITER_MASK) >> DMA_TCD_CITER_ELINKNO_CITER_SHIFT);
  574. }
  575. }
  576. #if (DMA_IP_STORE_DST_ADDR_IS_AVAILABLE == STD_ON)
  577. static inline void hwv2AccInlineDmaCh_GetStoreDstAddress(Dma_Ip_TcdRegType * ptTcd, uint32 * const retValue)
  578. {
  579. /* Hardware version 2 doesn't have this feature */
  580. (void)ptTcd;
  581. *retValue = (uint32)0U;
  582. }
  583. #endif
  584. #if (DMA_IP_MASTER_ID_REPLICATION_IS_AVAILABLE == STD_ON)
  585. static inline void hwv2AccInlineDmaCh_GetMasterId(Dma_Ip_ChRegType * ptCh, uint32 * const retValue)
  586. {
  587. /* Hardware version 2 doesn't have this feature */
  588. (void)ptCh;
  589. *retValue = (uint32)0U;
  590. }
  591. #endif
  592. static inline void hwv2AccInlineDmaCh_GetIntMajor(const Dma_Ip_TcdRegType * ptTcd, uint32 * const retValue)
  593. {
  594. /* Get INTMAJOR bit value */
  595. *retValue = (uint32)((ptTcd->reg_CSR & (uint32)DMA_TCD_CSR_INTMAJOR_MASK) >> DMA_TCD_CSR_INTMAJOR_SHIFT);
  596. }
  597. static inline void hwv2AccInlineDmaCh_GetIntHalfMajor(const Dma_Ip_TcdRegType * ptTcd, uint32 * const retValue)
  598. {
  599. /* Get INTHALF bit value */
  600. *retValue = (uint32)((ptTcd->reg_CSR & (uint32)DMA_TCD_CSR_INTHALF_MASK) >> DMA_TCD_CSR_INTHALF_SHIFT);
  601. }
  602. #if (DMA_IP_DMACRC_IS_AVAILABLE == STD_ON)
  603. static inline void hwv2AccInlineDmaCh_GetFinalCrc(Dma_Ip_HwCrcCtrlType * const pDmaCrcCtrl, uint32 * const retValue)
  604. {
  605. /* Hardware version 2 doesn't have this feature */
  606. (void)pDmaCrcCtrl;
  607. *retValue = (uint32)0U;
  608. }
  609. #endif /* #if (DMA_IP_DMACRC_IS_AVAILABLE == STD_ON) */
  610. /*==================================================================================================
  611. * DMA CHANNEL AUXILIARY FUNCTIONS - REGISTER ACCESS
  612. ==================================================================================================*/
  613. static inline void hwv2AccInlineDmaCh_SetAuxiliary_EnScatterGatherProcessing(Dma_Ip_TcdRegType * ptTcd, boolean Value)
  614. {
  615. /* Set ESG bit value */
  616. uint16 reg = ptTcd->reg_CSR;
  617. ptTcd->reg_CSR = ((uint16)(reg & (~(DMA_TCD_CSR_ESG_MASK))) | (DMA_TCD_CSR_ESG(Value ? 1U : 0U)));
  618. }
  619. #if (DMA_IP_STORE_DST_ADDR_IS_AVAILABLE == STD_ON)
  620. static inline void hwv2AccInlineDmaCh_SetAuxiliary_EnDestinationStoreAddress(Dma_Ip_TcdRegType * ptTcd, boolean Value)
  621. {
  622. /* To avoid misra violations */
  623. (void)ptTcd;
  624. (void)Value;
  625. }
  626. #endif
  627. /*==================================================================================================
  628. * TCD CONTROL AND STATUS (TCD_CSR) - REGISTER ACCESS
  629. ==================================================================================================*/
  630. static inline void hwv2AccInlineDmaCh_SetControlAndStatus(Dma_Ip_TcdRegType * ptTcd, const Dma_Ip_ScatterGatherConfigType * const pxLocScatterGather)
  631. {
  632. /* Set value for TCD_CSR register*/
  633. uint16 reg = ptTcd->reg_CSR;
  634. reg = ((uint16)(reg & (~(DMA_TCD_CSR_START_MASK))) | (DMA_TCD_CSR_START(pxLocScatterGather->TransferConfig->Control.EnStart ? 1U : 0U)));
  635. reg = ((uint16)(reg & (~(DMA_TCD_CSR_BWC_MASK))) | (DMA_TCD_CSR_BWC(pxLocScatterGather->TransferConfig->Control.BandwidthControl)));
  636. reg = ((uint16)(reg & (~(DMA_TCD_CSR_INTMAJOR_MASK))) | (DMA_TCD_CSR_INTMAJOR(pxLocScatterGather->TransferConfig->Control.EnMajorInt ? 1U : 0U)));
  637. reg = ((uint16)(reg & (~(DMA_TCD_CSR_INTHALF_MASK))) | (DMA_TCD_CSR_INTHALF(pxLocScatterGather->TransferConfig->Control.EnHalfMajorInt ? 1U : 0U)));
  638. reg = ((uint16)(reg & (~(DMA_TCD_CSR_DREQ_MASK))) | (DMA_TCD_CSR_DREQ(pxLocScatterGather->TransferConfig->Control.DisAutoHwRequest ? 1U : 0U)));
  639. ptTcd->reg_CSR= reg;
  640. }
  641. /*==================================================================================================
  642. * TCD TRANSFER ATTRIBUTES (TCD_ATTR) - REGISTER ACCESS
  643. ==================================================================================================*/
  644. static inline void hwv2AccInlineDmaCh_SetTransferAttributes(Dma_Ip_TcdRegType * ptTcd, const Dma_Ip_ScatterGatherConfigType * const pxLocScatterGather)
  645. {
  646. /* Set value for TCD_ATTR register*/
  647. uint16 reg = ptTcd->reg_ATTR;
  648. reg = ((uint16)(reg & (~(DMA_TCD_ATTR_SSIZE_MASK))) | (DMA_TCD_ATTR_SSIZE(pxLocScatterGather->TransferConfig->Source.TransferSize)));
  649. reg = ((uint16)(reg & (~(DMA_TCD_ATTR_SMOD_MASK))) | (DMA_TCD_ATTR_SMOD(pxLocScatterGather->TransferConfig->Source.Modulo)));
  650. reg = ((uint16)(reg & (~(DMA_TCD_ATTR_DSIZE_MASK))) | (DMA_TCD_ATTR_DSIZE(pxLocScatterGather->TransferConfig->Destination.TransferSize)));
  651. reg = ((uint16)(reg & (~(DMA_TCD_ATTR_DMOD_MASK))) | (DMA_TCD_ATTR_DMOD(pxLocScatterGather->TransferConfig->Destination.Modulo)));
  652. ptTcd->reg_ATTR= reg;
  653. }
  654. /*==================================================================================================
  655. * TCD SIGNED MINOR LOOP OFFSET (TCD_NBYTES_MLOFFYES) - REGISTER ACCESS
  656. ==================================================================================================*/
  657. static inline void hwv2AccInlineDmaCh_SetSignedMinorLoopOffset(Dma_Ip_TcdRegType * ptTcd, const Dma_Ip_ScatterGatherConfigType * const pxLocScatterGather)
  658. {
  659. /* Set value for TCD_NBYTES_MLOFFYES register*/
  660. uint32 reg = ptTcd->reg_NBYTES.reg_MLOFFYES;
  661. reg = ((reg & (~(DMA_TCD_NBYTES_MLOFFYES_SMLOE_MASK))) | (DMA_TCD_NBYTES_MLOFFYES_SMLOE(pxLocScatterGather->TransferConfig->MinorLoop.EnSrcOffset ? 1U : 0U)));
  662. reg = ((reg & (~(DMA_TCD_NBYTES_MLOFFYES_DMLOE_MASK))) | (DMA_TCD_NBYTES_MLOFFYES_DMLOE(pxLocScatterGather->TransferConfig->MinorLoop.EnDstOffset ? 1U : 0U)));
  663. reg = ((reg & (~(DMA_TCD_NBYTES_MLOFFYES_MLOFF_MASK))) | (DMA_TCD_NBYTES_MLOFFYES_MLOFF((uint32)pxLocScatterGather->TransferConfig->MinorLoop.Offset)));
  664. ptTcd->reg_NBYTES.reg_MLOFFYES= reg;
  665. }
  666. #define MCL_STOP_SEC_CODE
  667. /* @violates @ref Mcl_Dma_h_REF_1 MISRA 2012 Required Directive 4.10, Precautions shall be taken in order to prevent the contents of a header file being included more than once. */
  668. #include "Mcl_MemMap.h"
  669. #endif /* #if (DMA_IP_HWV2_IS_AVAILABLE == STD_ON) */
  670. #endif /* #if (DMA_IP_IS_AVAILABLE == STD_ON) */
  671. /** @} */
  672. #endif /* #ifndef DMA_IP_HWV2_ACCESSINLINE_H_ */
  673. /*==================================================================================================
  674. * END OF FILE
  675. ==================================================================================================*/