nu_pdma.h 83 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249
  1. /**************************************************************************//**
  2. * @file pdma.h
  3. * @brief PDMA driver header file
  4. *
  5. * SPDX-License-Identifier: Apache-2.0
  6. * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved.
  7. *****************************************************************************/
  8. #ifndef __NU_PDMA_H__
  9. #define __NU_PDMA_H__
  10. #ifdef __cplusplus
  11. extern "C"
  12. {
  13. #endif
  14. /**
  15. @addtogroup REGISTER Control Register
  16. @{
  17. */
  18. /**
  19. @addtogroup PDMA Peripheral Direct Memory Access Controller(PDMA)
  20. Memory Mapped Structure for PDMA Controller
  21. @{ */
  22. typedef struct
  23. {
  24. /**
  25. * @var DSCT_T::CTL
  26. * Offset: 0x00 Descriptor Table Control Register of PDMA Channel n.
  27. * ---------------------------------------------------------------------------------------------------
  28. * |Bits |Field |Descriptions
  29. * | :----: | :----: | :---- |
  30. * |[1:0] |OPMODE |PDMA Operation Mode Selection
  31. * | | |00 = Idle state: Channel is stopped or this table is complete, when PDMA finish channel table task, OPMODE will be cleared to idle state automatically.
  32. * | | |01 = Basic mode: The descriptor table only has one task
  33. * | | |When this task is finished, the PDMA_INTSTS[n] will be asserted.
  34. * | | |10 = Scatter-Gather mode: When operating in this mode, user must give the next descriptor table address in PDMA_DSCT_NEXT register; PDMA controller will ignore this task, then load the next task to execute.
  35. * | | |11 = Reserved.
  36. * | | |Note: Before filling transfer task in the Descriptor Table, user must check if the descriptor table is complete.
  37. * |[2] |TXTYPE |Transfer Type
  38. * | | |0 = Burst transfer type.
  39. * | | |1 = Single transfer type.
  40. * |[6:4] |BURSIZE |Burst Size
  41. * | | |This field is used for peripheral to determine the burst size or used for determine the re-arbitration size.
  42. * | | |000 = 128 Transfers.
  43. * | | |001 = 64 Transfers.
  44. * | | |010 = 32 Transfers.
  45. * | | |011 = 16 Transfers.
  46. * | | |100 = 8 Transfers.
  47. * | | |101 = 4 Transfers.
  48. * | | |110 = 2 Transfers.
  49. * | | |111 = 1 Transfers.
  50. * | | |Note: This field is only useful in burst transfer type.
  51. * |[7] |TBINTDIS |Table Interrupt Disable Bit
  52. * | | |This field can be used to decide whether to enable table interrupt or not
  53. * | | |If the TBINTDIS bit is enabled when PDMA controller finishes transfer task, it will not generates transfer done interrupt.
  54. * | | |0 = Table interrupt Enabled.
  55. * | | |1 = Table interrupt Disabled.
  56. * |[9:8] |SAINC |Source Address Increment
  57. * | | |This field is used to set the source address increment size.
  58. * | | |11 = No increment (fixed address).
  59. * | | |Others = Increment and size is depended on TXWIDTH selection.
  60. * |[11:10] |DAINC |Destination Address Increment
  61. * | | |This field is used to set the destination address increment size.
  62. * | | |11 = No increment (fixed address).
  63. * | | |Others = Increment and size is depended on TXWIDTH selection.
  64. * |[13:12] |TXWIDTH |Transfer Width Selection
  65. * | | |This field is used for transfer width.
  66. * | | |00 = One byte (8 bit) is transferred for every operation.
  67. * | | |01= One half-word (16 bit) is transferred for every operation.
  68. * | | |10 = One word (32-bit) is transferred for every operation.
  69. * | | |11 = Reserved.
  70. * | | |Note: The PDMA transfer source address (PDMA_DSCT_SA) and PDMA transfer destination address (PDMA_DSCT_DA) should be alignment under the TXWIDTH selection
  71. * |[14] |TXACK |Transfer Acknowledge Selection
  72. * | | |0 = transfer ack when transfer done.
  73. * | | |1 = transfer ack when PDMA get transfer data.
  74. * |[15] |STRIDEEN |Stride Mode Enable Bit
  75. * | | |0 = Stride transfer mode Disabled.
  76. * | | |1 = Stride transfer mode Enabled.
  77. * |[31:16] |TXCNT |Transfer Count
  78. * | | |The TXCNT represents the required number of PDMA transfer, the real transfer count is (TXCNT + 1); The maximum transfer count is 65536 , every transfer may be byte, half-word or word that is dependent on TXWIDTH field.
  79. * | | |Note: When PDMA finish each transfer data, this field will be decrease immediately.
  80. * @var DSCT_T::SA
  81. * Offset: 0x04 Source Address Register of PDMA Channel n
  82. * ---------------------------------------------------------------------------------------------------
  83. * |Bits |Field |Descriptions
  84. * | :----: | :----: | :---- |
  85. * |[31:0] |SA |PDMA Transfer Source Address Register
  86. * | | |This field indicates a 32-bit source address of PDMA controller.
  87. * @var DSCT_T::DA
  88. * Offset: 0x08 Destination Address Register of PDMA Channel n
  89. * ---------------------------------------------------------------------------------------------------
  90. * |Bits |Field |Descriptions
  91. * | :----: | :----: | :---- |
  92. * |[31:0] |DA |PDMA Transfer Destination Address Register
  93. * | | |This field indicates a 32-bit destination address of PDMA controller.
  94. * @var DSCT_T::NEXT
  95. * Offset: 0x0C Next Scatter-Gather Descriptor Table Offset Address of PDMA Channel n
  96. * ---------------------------------------------------------------------------------------------------
  97. * |Bits |Field |Descriptions
  98. * | :----: | :----: | :---- |
  99. * |[15:0] |EXENEXT |PDMA Execution Next Descriptor Table Offset
  100. * | | |This field indicates the offset of next descriptor table address of current execution descriptor table in system memory.
  101. * | | |Note: write operation is useless in this field.
  102. * |[31:16] |NEXT |PDMA Next Descriptor Table Offset.
  103. * | | |This field indicates the offset of the next descriptor table address in system memory.
  104. * | | |Write Operation:
  105. * | | |If the system memory based address is 0x2000_0000 (PDMA_SCATBA), and the next descriptor table is start from 0x2000_0100, then this field must fill in 0x0100.
  106. * | | |Read Operation:
  107. * | | |When operating in scatter-gather mode, the last two bits NEXT[1:0] will become reserved, and indicate the first next address of system memory.
  108. * | | |Note1: The descriptor table address must be word boundary.
  109. * | | |Note2: Before filled transfer task in the descriptor table, user must check if the descriptor table is complete.
  110. */
  111. __IO uint32_t CTL; /*!< [0x0000] Descriptor Table Control Register of PDMA Channel n. */
  112. __IO uint32_t SA; /*!< [0x0004] Source Address Register of PDMA Channel n */
  113. __IO uint32_t DA; /*!< [0x0008] Destination Address Register of PDMA Channel n */
  114. __IO uint32_t NEXT; /*!< [0x000c] First Scatter-Gather Descriptor Table Offset Address of PDMA Channel n */
  115. } DSCT_T;
  116. typedef struct
  117. {
  118. /**
  119. * @var STRIDE_T::STCR
  120. * Offset: 0x500 Stride Transfer Count Register of PDMA Channel n
  121. * ---------------------------------------------------------------------------------------------------
  122. * |Bits |Field |Descriptions
  123. * | :----: | :----: | :---- |
  124. * |[15:0] |STC |PDMA Stride Transfer Count
  125. * | | |The 16-bit register defines the stride transfer count of each row.
  126. * @var STRIDE_T::ASOCR
  127. * Offset: 0x504 Address Stride Offset Register of PDMA Channel n
  128. * ---------------------------------------------------------------------------------------------------
  129. * |Bits |Field |Descriptions
  130. * | :----: | :----: | :---- |
  131. * |[15:0] |SASOL |VDMA Source Address Stride Offset Length
  132. * | | |The 16-bit register defines the source address stride transfer offset count of each row.
  133. * |[31:16] |DASOL |VDMA Destination Address Stride Offset Length
  134. * | | |The 16-bit register defines the destination address stride transfer offset count of each row.
  135. */
  136. __IO uint32_t STCR; /*!< [0x0500] Stride Transfer Count Register of PDMA Channel 0 */
  137. __IO uint32_t ASOCR; /*!< [0x0504] Address Stride Offset Register of PDMA Channel 0 */
  138. } STRIDE_T;
  139. typedef struct
  140. {
  141. /**
  142. * @var PDMA_T::CURSCAT
  143. * Offset: 0x100 Current Scatter-Gather Descriptor Table Address of PDMA Channel n
  144. * ---------------------------------------------------------------------------------------------------
  145. * |Bits |Field |Descriptions
  146. * | :----: | :----: | :---- |
  147. * |[31:0] |CURADDR |PDMA Current Description Address Register (Read Only)
  148. * | | |This field indicates a 32-bit current external description address of PDMA controller.
  149. * | | |Note: This field is read only and only used for Scatter-Gather mode to indicate the current external description address.
  150. * @var PDMA_T::CHCTL
  151. * Offset: 0x400 PDMA Channel Control Register
  152. * ---------------------------------------------------------------------------------------------------
  153. * |Bits |Field |Descriptions
  154. * | :----: | :----: | :---- |
  155. * |[15:0] |CHENn |PDMA Channel Enable Bit
  156. * | | |Set this bit to 1 to enable PDMAn operation. Channel cannot be active if it is not set as enabled.
  157. * | | |0 = PDMA channel [n] Disabled.
  158. * | | |1 = PDMA channel [n] Enabled.
  159. * | | |Note: Set corresponding bit of PDMA_PAUSE or PDMA_CHRST register will also clear this bit.
  160. * @var PDMA_T::PAUSE
  161. * Offset: 0x404 PDMA Transfer Stop Control Register
  162. * ---------------------------------------------------------------------------------------------------
  163. * |Bits |Field |Descriptions
  164. * | :----: | :----: | :---- |
  165. * |[15:0] |PAUSEn |PDMA Transfer Pause Control Register (Write Only)
  166. * | | |User can set PAUSEn bit field to pause the PDMA transfer
  167. * | | |When user sets PAUSEn bit, the PDMA controller will pause the on-going transfer, then clear the channel enable bit CHEN(PDMA_CHCTL [n], n=0,1..7) and clear request active flag
  168. * | | |If re-enable the paused channel again, the remaining transfers will be processed.
  169. * | | |0 = No effect.
  170. * | | |1 = Pause PDMA channel n transfer.
  171. * @var PDMA_T::SWREQ
  172. * Offset: 0x408 PDMA Software Request Register
  173. * ---------------------------------------------------------------------------------------------------
  174. * |Bits |Field |Descriptions
  175. * | :----: | :----: | :---- |
  176. * |[15:0] |SWREQn |PDMA Software Request Register (Write Only)
  177. * | | |Set this bit to 1 to generate a software request to PDMA [n].
  178. * | | |0 = No effect.
  179. * | | |1 = Generate a software request.
  180. * | | |Note1: User can read PDMA_TRGSTS register to know which channel is on active
  181. * | | |Active flag may be triggered by software request or peripheral request.
  182. * | | |Note2: If user does not enable corresponding PDMA channel, the software request will be ignored.
  183. * @var PDMA_T::TRGSTS
  184. * Offset: 0x40C PDMA Channel Request Status Register
  185. * ---------------------------------------------------------------------------------------------------
  186. * |Bits |Field |Descriptions
  187. * | :----: | :----: | :---- |
  188. * |[15:0] |REQSTSn |PDMA Channel Request Status (Read Only)
  189. * | | |This flag indicates whether channel[n] have a request or not, no matter request from software or peripheral
  190. * | | |When PDMA controller finishes channel transfer, this bit will be cleared automatically.
  191. * | | |0 = PDMA Channel n has no request.
  192. * | | |1 = PDMA Channel n has a request.
  193. * | | |Note: If user pauses or resets each PDMA transfer by setting PDMA_PAUSE or PDMA_CHRST register respectively, this bit will be cleared automatically after finishing current transfer.
  194. * @var PDMA_T::PRISET
  195. * Offset: 0x410 PDMA Fixed Priority Setting Register
  196. * ---------------------------------------------------------------------------------------------------
  197. * |Bits |Field |Descriptions
  198. * | :----: | :----: | :---- |
  199. * |[15:0] |FPRISETn |PDMA Fixed Priority Setting Register
  200. * | | |Set this bit to 1 to enable fixed priority level.
  201. * | | |Write Operation:
  202. * | | |0 = No effect.
  203. * | | |1 = Set PDMA channel [n] to fixed priority channel.
  204. * | | |Read Operation:
  205. * | | |0 = Corresponding PDMA channel is round-robin priority.
  206. * | | |1 = Corresponding PDMA channel is fixed priority.
  207. * | | |Note: This field only set to fixed priority, clear fixed priority use PDMA_PRICLR register.
  208. * @var PDMA_T::PRICLR
  209. * Offset: 0x414 PDMA Fixed Priority Clear Register
  210. * ---------------------------------------------------------------------------------------------------
  211. * |Bits |Field |Descriptions
  212. * | :----: | :----: | :---- |
  213. * |[15:0] |FPRICLRn |PDMA Fixed Priority Clear Register (Write Only)
  214. * | | |Set this bit to 1 to clear fixed priority level.
  215. * | | |0 = No effect.
  216. * | | |1 = Clear PDMA channel [n] fixed priority setting.
  217. * | | |Note: User can read PDMA_PRISET register to know the channel priority.
  218. * @var PDMA_T::INTEN
  219. * Offset: 0x418 PDMA Interrupt Enable Register
  220. * ---------------------------------------------------------------------------------------------------
  221. * |Bits |Field |Descriptions
  222. * | :----: | :----: | :---- |
  223. * |[15:0] |INTENn |PDMA Interrupt Enable Register
  224. * | | |This field is used for enabling PDMA channel[n] interrupt.
  225. * | | |0 = PDMA channel n interrupt Disabled.
  226. * | | |1 = PDMA channel n interrupt Enabled.
  227. * @var PDMA_T::INTSTS
  228. * Offset: 0x41C PDMA Interrupt Status Register
  229. * ---------------------------------------------------------------------------------------------------
  230. * |Bits |Field |Descriptions
  231. * | :----: | :----: | :---- |
  232. * |[0] |ABTIF |PDMA Read/Write Target Abort Interrupt Flag (Read-only)
  233. * | | |This bit indicates that PDMA has target abort error; Software can read PDMA_ABTSTS register to find which channel has target abort error.
  234. * | | |0 = No AHB bus ERROR response received.
  235. * | | |1 = AHB bus ERROR response received.
  236. * |[1] |TDIF |Transfer Done Interrupt Flag (Read Only)
  237. * | | |This bit indicates that PDMA controller has finished transmission; User can read PDMA_TDSTS register to indicate which channel finished transfer.
  238. * | | |0 = Not finished yet.
  239. * | | |1 = PDMA channel has finished transmission.
  240. * |[2] |ALIGNF |Transfer Alignment Interrupt Flag (Read Only)
  241. * | | |0 = PDMA channel source address and destination address both follow transfer width setting.
  242. * | | |1 = PDMA channel source address or destination address is not follow transfer width setting.
  243. * |[8] |REQTOF0 |Request Time-out Flag for Channel 0
  244. * | | |This flag indicates that PDMA controller has waited peripheral request for a period defined by PDMA_TOC0, user can write 1 to clear these bits.
  245. * | | |0 = No request time-out.
  246. * | | |1 = Peripheral request time-out.
  247. * |[9] |REQTOF1 |Request Time-out Flag for Channel 1
  248. * | | |This flag indicates that PDMA controller has waited peripheral request for a period defined by PDMA_TOC1, user can write 1 to clear these bits.
  249. * | | |0 = No request time-out.
  250. * | | |1 = Peripheral request time-out.
  251. * @var PDMA_T::ABTSTS
  252. * Offset: 0x420 PDMA Channel Read/Write Target Abort Flag Register
  253. * ---------------------------------------------------------------------------------------------------
  254. * |Bits |Field |Descriptions
  255. * | :----: | :----: | :---- |
  256. * |[15:0] |ABTIFn |PDMA Read/Write Target Abort Interrupt Status Flag
  257. * | | |This bit indicates which PDMA controller has target abort error; User can write 1 to clear these bits.
  258. * | | |0 = No AHB bus ERROR response received when channel n transfer.
  259. * | | |1 = AHB bus ERROR response received when channel n transfer.
  260. * @var PDMA_T::TDSTS
  261. * Offset: 0x424 PDMA Channel Transfer Done Flag Register
  262. * ---------------------------------------------------------------------------------------------------
  263. * |Bits |Field |Descriptions
  264. * | :----: | :----: | :---- |
  265. * |[15:0] |TDIFn |Transfer Done Flag Register
  266. * | | |This bit indicates whether PDMA controller channel transfer has been finished or not, user can write 1 to clear these bits.
  267. * | | |0 = PDMA channel transfer has not finished.
  268. * | | |1 = PDMA channel has finished transmission.
  269. * @var PDMA_T::ALIGN
  270. * Offset: 0x428 PDMA Transfer Alignment Status Register
  271. * ---------------------------------------------------------------------------------------------------
  272. * |Bits |Field |Descriptions
  273. * | :----: | :----: | :---- |
  274. * |[15:0] |ALIGNn |Transfer Alignment Flag Register
  275. * | | |0 = PDMA channel source address and destination address both follow transfer width setting.
  276. * | | |1 = PDMA channel source address or destination address is not follow transfer width setting.
  277. * @var PDMA_T::TACTSTS
  278. * Offset: 0x42C PDMA Transfer Active Flag Register
  279. * ---------------------------------------------------------------------------------------------------
  280. * |Bits |Field |Descriptions
  281. * | :----: | :----: | :---- |
  282. * |[15:0] |TXACTFn |Transfer on Active Flag Register (Read Only)
  283. * | | |This bit indicates which PDMA channel is in active.
  284. * | | |0 = PDMA channel is not finished.
  285. * | | |1 = PDMA channel is active.
  286. * @var PDMA_T::TOUTPSC
  287. * Offset: 0x430 PDMA Time-out Prescaler Register
  288. * ---------------------------------------------------------------------------------------------------
  289. * |Bits |Field |Descriptions
  290. * | :----: | :----: | :---- |
  291. * |[2:0] |TOUTPSC0 |PDMA Channel 0 Time-out Clock Source Prescaler Bits
  292. * | | |000 = PDMA channel 0 time-out clock source is HCLK/28.
  293. * | | |001 = PDMA channel 0 time-out clock source is HCLK/29.
  294. * | | |010 = PDMA channel 0 time-out clock source is HCLK/210.
  295. * | | |011 = PDMA channel 0 time-out clock source is HCLK/211.
  296. * | | |100 = PDMA channel 0 time-out clock source is HCLK/212.
  297. * | | |101 = PDMA channel 0 time-out clock source is HCLK/213.
  298. * | | |110 = PDMA channel 0 time-out clock source is HCLK/214.
  299. * | | |111 = PDMA channel 0 time-out clock source is HCLK/215.
  300. * |[6:4] |TOUTPSC1 |PDMA Channel 1 Time-out Clock Source Prescaler Bits
  301. * | | |000 = PDMA channel 1 time-out clock source is HCLK/28.
  302. * | | |001 = PDMA channel 1 time-out clock source is HCLK/29.
  303. * | | |010 = PDMA channel 1 time-out clock source is HCLK/210.
  304. * | | |011 = PDMA channel 1 time-out clock source is HCLK/211.
  305. * | | |100 = PDMA channel 1 time-out clock source is HCLK/212.
  306. * | | |101 = PDMA channel 1 time-out clock source is HCLK/213.
  307. * | | |110 = PDMA channel 1 time-out clock source is HCLK/214.
  308. * | | |111 = PDMA channel 1 time-out clock source is HCLK/215.
  309. * @var PDMA_T::TOUTEN
  310. * Offset: 0x434 PDMA Time-out Enable Register
  311. * ---------------------------------------------------------------------------------------------------
  312. * |Bits |Field |Descriptions
  313. * | :----: | :----: | :---- |
  314. * |[1:0] |TOUTENn |PDMA Time-out Enable Bits
  315. * | | |0 = PDMA Channel n time-out function Disable.
  316. * | | |1 = PDMA Channel n time-out function Enable.
  317. * @var PDMA_T::TOUTIEN
  318. * Offset: 0x438 PDMA Time-out Interrupt Enable Register
  319. * ---------------------------------------------------------------------------------------------------
  320. * |Bits |Field |Descriptions
  321. * | :----: | :----: | :---- |
  322. * |[1:0] |TOUTIENn |PDMA Time-out Interrupt Enable Bits
  323. * | | |0 = PDMA Channel n time-out interrupt Disable.
  324. * | | |1 = PDMA Channel n time-out interrupt Enable.
  325. * @var PDMA_T::SCATBA
  326. * Offset: 0x43C PDMA Scatter-Gather Descriptor Table Base Address Register
  327. * ---------------------------------------------------------------------------------------------------
  328. * |Bits |Field |Descriptions
  329. * | :----: | :----: | :---- |
  330. * |[31:16] |SCATBA |PDMA Scatter-gather Descriptor Table Address Register
  331. * | | |In Scatter-Gather mode, this is the base address for calculating the next link - list address
  332. * | | |The next link address equation is
  333. * | | |Next Link Address = PDMA_SCATBA + PDMA_DSCT_NEXT.
  334. * | | |Note: Only useful in Scatter-Gather mode.
  335. * @var PDMA_T::TOC0_1
  336. * Offset: 0x440 PDMA Time-out Counter Ch1 and Ch0 Register
  337. * ---------------------------------------------------------------------------------------------------
  338. * |Bits |Field |Descriptions
  339. * | :----: | :----: | :---- |
  340. * |[15:0] |TOC0 |Time-out Counter for Channel 0
  341. * | | |This controls the period of time-out function for channel 0
  342. * | | |The calculation unit is based on 10 kHz clock.
  343. * |[31:16] |TOC1 |Time-out Counter for Channel 1
  344. * | | |This controls the period of time-out function for channel 1
  345. * | | |The calculation unit is based on 10 kHz clock.
  346. * @var PDMA_T::CHRST
  347. * Offset: 0x460 PDMA Channel Reset Register
  348. * ---------------------------------------------------------------------------------------------------
  349. * |Bits |Field |Descriptions
  350. * | :----: | :----: | :---- |
  351. * |[15:0] |CHnRST |Channel N Reset
  352. * | | |0 = corresponding channel n not reset.
  353. * | | |1 = corresponding channel n is reset.
  354. * @var PDMA_T::REQSEL0_3
  355. * Offset: 0x480 PDMA Request Source Select Register 0
  356. * ---------------------------------------------------------------------------------------------------
  357. * |Bits |Field |Descriptions
  358. * | :----: | :----: | :---- |
  359. * |[6:0] |REQSRC0 |Channel 0 Request Source Selection
  360. * | | |This filed defines which peripheral is connected to PDMA channel 0
  361. * | | |User can configure the peripheral by setting REQSRC0.
  362. * | | |0 = Disable PDMA peripheral request.
  363. * | | |1 = Reserved.
  364. * | | |2 = Channel connects to USB_TX.
  365. * | | |3 = Channel connects to USB_RX.
  366. * | | |4 = Channel connects to UART0_TX.
  367. * | | |5 = Channel connects to UART0_RX.
  368. * | | |6 = Channel connects to UART1_TX.
  369. * | | |7 = Channel connects to UART1_RX.
  370. * | | |8 = Channel connects to UART2_TX.
  371. * | | |9 = Channel connects to UART2_RX.
  372. * | | |10=Channel connects to UART3_TX.
  373. * | | |11 = Channel connects to UART3_RX.
  374. * | | |12 = Channel connects to UART4_TX.
  375. * | | |13 = Channel connects to UART4_RX.
  376. * | | |14 = Channel connects to UART5_TX.
  377. * | | |15 = Channel connects to UART5_RX.
  378. * | | |16 = Channel connects to USCI0_TX.
  379. * | | |17 = Channel connects to USCI0_RX.
  380. * | | |18 = Channel connects to USCI1_TX.
  381. * | | |19 = Channel connects to USCI1_RX.
  382. * | | |20 = Channel connects to QSPI0_TX.
  383. * | | |21 = Channel connects to QSPI0_RX.
  384. * | | |22 = Channel connects to SPI0_TX.
  385. * | | |23 = Channel connects to SPI0_RX.
  386. * | | |24 = Channel connects to SPI1_TX.
  387. * | | |25 = Channel connects to SPI1_RX.
  388. * | | |26 = Channel connects to SPI2_TX.
  389. * | | |27 = Channel connects to SPI2_RX.
  390. * | | |28 = Channel connects to SPI3_TX.
  391. * | | |29 = Channel connects to SPI3_RX.
  392. * | | |30 = Reserved.
  393. * | | |31 = Reserved.
  394. * | | |32 = Channel connects to EPWM0_P1_RX.
  395. * | | |33 = Channel connects to EPWM0_P2_RX.
  396. * | | |34 = Channel connects to EPWM0_P3_RX.
  397. * | | |35 = Channel connects to EPWM1_P1_RX.
  398. * | | |36 = Channel connects to EPWM1_P2_RX.
  399. * | | |37 = Channel connects to EPWM1_P3_RX.
  400. * | | |38 = Channel connects to I2C0_TX.
  401. * | | |39 = Channel connects to I2C0_RX.
  402. * | | |40 = Channel connects to I2C1_TX.
  403. * | | |41 = Channel connects to I2C1_RX.
  404. * | | |42 = Channel connects to I2C2_TX.
  405. * | | |43 = Channel connects to I2C2_RX.
  406. * | | |44 = Channel connects to I2S0_TX.
  407. * | | |45 = Channel connects to I2S0_RX.
  408. * | | |46 = Channel connects to TMR0.
  409. * | | |47 = Channel connects to TMR1.
  410. * | | |48 = Channel connects to TMR2.
  411. * | | |49 = Channel connects to TMR3.
  412. * | | |50 = Channel connects to ADC_RX.
  413. * | | |51 = Channel connects to DAC0_TX.
  414. * | | |52 = Channel connects to DAC1_TX.
  415. * | | |53 = Channel connects to EPWM0_CH0_TX.
  416. * | | |54 = Channel connects to EPWM0_CH1_TX.
  417. * | | |55 = Channel connects to EPWM0_CH2_TX.
  418. * | | |56 = Channel connects to EPWM0_CH3_TX.
  419. * | | |57 = Channel connects to EPWM0_CH4_TX.
  420. * | | |58 = Channel connects to EPWM0_CH5_TX.
  421. * | | |59 = Channel connects to EPWM1_CH0_TX.
  422. * | | |60 = Channel connects to EPWM1_CH1_TX.
  423. * | | |61 = Channel connects to EPWM1_CH2_TX.
  424. * | | |62 = Channel connects to EPWM1_CH3_TX.
  425. * | | |63 = Channel connects to EPWM1_CH4_TX.
  426. * | | |64 = Channel connects to EPWM1_CH5_TX.
  427. * | | |65 = Channel connects to ETMC_RX.
  428. * | | |Others = Reserved.
  429. * | | |Note 1: A peripheral can't assign to two channels at the same time.
  430. * | | |Note 2: This field is useless when transfer between memory and memory.
  431. * |[14:8] |REQSRC1 |Channel 1 Request Source Selection
  432. * | | |This filed defines which peripheral is connected to PDMA channel 1
  433. * | | |User can configure the peripheral setting by REQSRC1.
  434. * | | |Note: The channel configuration is the same as REQSRC0 field
  435. * | | |Please refer to the explanation of REQSRC0.
  436. * |[22:16] |REQSRC2 |Channel 2 Request Source Selection
  437. * | | |This filed defines which peripheral is connected to PDMA channel 2
  438. * | | |User can configure the peripheral setting by REQSRC2.
  439. * | | |Note: The channel configuration is the same as REQSRC0 field
  440. * | | |Please refer to the explanation of REQSRC0.
  441. * |[30:24] |REQSRC3 |Channel 3 Request Source Selection
  442. * | | |This filed defines which peripheral is connected to PDMA channel 3
  443. * | | |User can configure the peripheral setting by REQSRC3.
  444. * | | |Note: The channel configuration is the same as REQSRC0 field
  445. * | | |Please refer to the explanation of REQSRC0.
  446. * @var PDMA_T::REQSEL4_7
  447. * Offset: 0x484 PDMA Request Source Select Register 1
  448. * ---------------------------------------------------------------------------------------------------
  449. * |Bits |Field |Descriptions
  450. * | :----: | :----: | :---- |
  451. * |[6:0] |REQSRC4 |Channel 4 Request Source Selection
  452. * | | |This filed defines which peripheral is connected to PDMA channel 4
  453. * | | |User can configure the peripheral setting by REQSRC4.
  454. * | | |Note: The channel configuration is the same as REQSRC0 field
  455. * | | |Please refer to the explanation of REQSRC0.
  456. * |[14:8] |REQSRC5 |Channel 5 Request Source Selection
  457. * | | |This filed defines which peripheral is connected to PDMA channel 5
  458. * | | |User can configure the peripheral setting by REQSRC5.
  459. * | | |Note: The channel configuration is the same as REQSRC0 field
  460. * | | |Please refer to the explanation of REQSRC0.
  461. * |[22:16] |REQSRC6 |Channel 6 Request Source Selection
  462. * | | |This filed defines which peripheral is connected to PDMA channel 6
  463. * | | |User can configure the peripheral setting by REQSRC6.
  464. * | | |Note: The channel configuration is the same as REQSRC0 field
  465. * | | |Please refer to the explanation of REQSRC0.
  466. * |[30:24] |REQSRC7 |Channel 7 Request Source Selection
  467. * | | |This filed defines which peripheral is connected to PDMA channel 7
  468. * | | |User can configure the peripheral setting by REQSRC7.
  469. * | | |Note: The channel configuration is the same as REQSRC0 field
  470. * | | |Please refer to the explanation of REQSRC0.
  471. * @var PDMA_T::REQSEL8_11
  472. * Offset: 0x488 PDMA Request Source Select Register 2
  473. * ---------------------------------------------------------------------------------------------------
  474. * |Bits |Field |Descriptions
  475. * | :----: | :----: | :---- |
  476. * |[6:0] |REQSRC8 |Channel 8 Request Source Selection
  477. * | | |This filed defines which peripheral is connected to PDMA channel 8
  478. * | | |User can configure the peripheral setting by REQSRC8.
  479. * | | |Note: The channel configuration is the same as REQSRC0 field
  480. * | | |Please refer to the explanation of REQSRC0.
  481. * |[14:8] |REQSRC9 |Channel 9 Request Source Selection
  482. * | | |This filed defines which peripheral is connected to PDMA channel 9
  483. * | | |User can configure the peripheral setting by REQSRC9.
  484. * | | |Note: The channel configuration is the same as REQSRC0 field
  485. * | | |Please refer to the explanation of REQSRC0.
  486. * |[22:16] |REQSRC10 |Channel 10 Request Source Selection
  487. * | | |This filed defines which peripheral is connected to PDMA channel 10
  488. * | | |User can configure the peripheral setting by REQSRC10.
  489. * | | |Note: The channel configuration is the same as REQSRC0 field
  490. * | | |Please refer to the explanation of REQSRC0.
  491. * |[30:24] |REQSRC11 |Channel 11 Request Source Selection
  492. * | | |This filed defines which peripheral is connected to PDMA channel 11
  493. * | | |User can configure the peripheral setting by REQSRC11.
  494. * | | |Note: The channel configuration is the same as REQSRC0 field
  495. * | | |Please refer to the explanation of REQSRC0.
  496. * @var PDMA_T::REQSEL12_15
  497. * Offset: 0x48C PDMA Request Source Select Register 3
  498. * ---------------------------------------------------------------------------------------------------
  499. * |Bits |Field |Descriptions
  500. * | :----: | :----: | :---- |
  501. * |[6:0] |REQSRC12 |Channel 12 Request Source Selection
  502. * | | |This filed defines which peripheral is connected to PDMA channel 12
  503. * | | |User can configure the peripheral setting by REQSRC12.
  504. * | | |Note: The channel configuration is the same as REQSRC0 field
  505. * | | |Please refer to the explanation of REQSRC0.
  506. * |[14:8] |REQSRC13 |Channel 13 Request Source Selection
  507. * | | |This filed defines which peripheral is connected to PDMA channel 13
  508. * | | |User can configure the peripheral setting by REQSRC13.
  509. * | | |Note: The channel configuration is the same as REQSRC0 field
  510. * | | |Please refer to the explanation of REQSRC0.
  511. * |[22:16] |REQSRC14 |Channel 14 Request Source Selection
  512. * | | |This filed defines which peripheral is connected to PDMA channel 14
  513. * | | |User can configure the peripheral setting by REQSRC14.
  514. * | | |Note: The channel configuration is the same as REQSRC0 field
  515. * | | |Please refer to the explanation of REQSRC0.
  516. * |[30:24] |REQSRC15 |Channel 15 Request Source Selection
  517. * | | |This filed defines which peripheral is connected to PDMA channel 15
  518. * | | |User can configure the peripheral setting by REQSRC15.
  519. * | | |Note: The channel configuration is the same as REQSRC0 field
  520. * | | |Please refer to the explanation of REQSRC0.
  521. */
  522. DSCT_T DSCT[16];
  523. __I uint32_t CURSCAT[16]; /*!< [0x0100] Current Scatter-Gather Descriptor Table Address of PDMA Channel n */
  524. /// @cond HIDDEN_SYMBOLS
  525. __I uint32_t RESERVE1[176];
  526. /// @endcond //HIDDEN_SYMBOLS
  527. __IO uint32_t CHCTL; /*!< [0x0400] PDMA Channel Control Register */
  528. __O uint32_t PAUSE; /*!< [0x0404] PDMA Transfer Pause Control Register */
  529. __O uint32_t SWREQ; /*!< [0x0408] PDMA Software Request Register */
  530. __I uint32_t TRGSTS; /*!< [0x040c] PDMA Channel Request Status Register */
  531. __IO uint32_t PRISET; /*!< [0x0410] PDMA Fixed Priority Setting Register */
  532. __O uint32_t PRICLR; /*!< [0x0414] PDMA Fixed Priority Clear Register */
  533. __IO uint32_t INTEN; /*!< [0x0418] PDMA Interrupt Enable Register */
  534. __IO uint32_t INTSTS; /*!< [0x041c] PDMA Interrupt Status Register */
  535. __IO uint32_t ABTSTS; /*!< [0x0420] PDMA Channel Read/Write Target Abort Flag Register */
  536. __IO uint32_t TDSTS; /*!< [0x0424] PDMA Channel Transfer Done Flag Register */
  537. __IO uint32_t ALIGN; /*!< [0x0428] PDMA Transfer Alignment Status Register */
  538. __I uint32_t TACTSTS; /*!< [0x042c] PDMA Transfer Active Flag Register */
  539. __IO uint32_t TOUTPSC; /*!< [0x0430] PDMA Time-out Prescaler Register */
  540. __IO uint32_t TOUTEN; /*!< [0x0434] PDMA Time-out Enable Register */
  541. __IO uint32_t TOUTIEN; /*!< [0x0438] PDMA Time-out Interrupt Enable Register */
  542. __IO uint32_t SCATBA; /*!< [0x043c] PDMA Scatter-Gather Descriptor Table Base Address Register */
  543. __IO uint32_t TOC0_1; /*!< [0x0440] PDMA Time-out Counter Ch1 and Ch0 Register */
  544. __IO uint32_t TOC2_3; /*!< [0x0444] PDMA Time-out Counter Ch1 and Ch0 Register */
  545. __IO uint32_t TOC4_5; /*!< [0x0448] PDMA Time-out Counter Ch1 and Ch0 Register */
  546. __IO uint32_t TOC6_7; /*!< [0x044c] PDMA Time-out Counter Ch1 and Ch0 Register */
  547. __IO uint32_t TOC8_9; /*!< [0x0450] PDMA Time-out Counter Ch1 and Ch0 Register */
  548. /// @cond HIDDEN_SYMBOLS
  549. __I uint32_t RESERVE2[3];
  550. /// @endcond //HIDDEN_SYMBOLS
  551. __IO uint32_t CHRST; /*!< [0x0460] PDMA Channel Reset Register */
  552. /// @cond HIDDEN_SYMBOLS
  553. __I uint32_t RESERVE5[3];
  554. /// @endcond //HIDDEN_SYMBOLS
  555. __IO uint32_t TOUTPSC2; /*!< [0x0470] PPDMA Time-out Prescaler Register */
  556. /// @cond HIDDEN_SYMBOLS
  557. __I uint32_t RESERVE3[3];
  558. /// @endcond //HIDDEN_SYMBOLS
  559. __IO uint32_t REQSEL0_3; /*!< [0x0480] PDMA Request Source Select Register 0 */
  560. __IO uint32_t REQSEL4_7; /*!< [0x0484] PDMA Request Source Select Register 1 */
  561. __IO uint32_t REQSEL8_11; /*!< [0x0488] PDMA Request Source Select Register 2 */
  562. __IO uint32_t REQSEL12_15; /*!< [0x048c] PDMA Request Source Select Register 3 */
  563. /// @cond HIDDEN_SYMBOLS
  564. __I uint32_t RESERVE4[28];
  565. /// @endcond //HIDDEN_SYMBOLS
  566. STRIDE_T STRIDE[6];
  567. } PDMA_T;
  568. /**
  569. @addtogroup PDMA_CONST PDMA Bit Field Definition
  570. Constant Definitions for PDMA Controller
  571. @{ */
  572. #define PDMA_DSCT_CTL_OPMODE_Pos (0) /*!< PDMA_T::DSCT_CTL: OPMODE Position */
  573. #define PDMA_DSCT_CTL_OPMODE_Msk (0x3ul << PDMA_DSCT_CTL_OPMODE_Pos) /*!< PDMA_T::DSCT_CTL: OPMODE Mask */
  574. #define PDMA_DSCT_CTL_TXTYPE_Pos (2) /*!< PDMA_T::DSCT_CTL: TXTYPE Position */
  575. #define PDMA_DSCT_CTL_TXTYPE_Msk (0x1ul << PDMA_DSCT_CTL_TXTYPE_Pos) /*!< PDMA_T::DSCT_CTL: TXTYPE Mask */
  576. #define PDMA_DSCT_CTL_BURSIZE_Pos (4) /*!< PDMA_T::DSCT_CTL: BURSIZE Position */
  577. #define PDMA_DSCT_CTL_BURSIZE_Msk (0x7ul << PDMA_DSCT_CTL_BURSIZE_Pos) /*!< PDMA_T::DSCT_CTL: BURSIZE Mask */
  578. #define PDMA_DSCT_CTL_TBINTDIS_Pos (7) /*!< PDMA_T::DSCT_CTL: TBINTDIS Position */
  579. #define PDMA_DSCT_CTL_TBINTDIS_Msk (0x1ul << PDMA_DSCT_CTL_TBINTDIS_Pos) /*!< PDMA_T::DSCT_CTL: TBINTDIS Mask */
  580. #define PDMA_DSCT_CTL_SAINC_Pos (8) /*!< PDMA_T::DSCT_CTL: SAINC Position */
  581. #define PDMA_DSCT_CTL_SAINC_Msk (0x3ul << PDMA_DSCT_CTL_SAINC_Pos) /*!< PDMA_T::DSCT_CTL: SAINC Mask */
  582. #define PDMA_DSCT_CTL_DAINC_Pos (10) /*!< PDMA_T::DSCT_CTL: DAINC Position */
  583. #define PDMA_DSCT_CTL_DAINC_Msk (0x3ul << PDMA_DSCT_CTL_DAINC_Pos) /*!< PDMA_T::DSCT_CTL: DAINC Mask */
  584. #define PDMA_DSCT_CTL_TXWIDTH_Pos (12) /*!< PDMA_T::DSCT_CTL: TXWIDTH Position */
  585. #define PDMA_DSCT_CTL_TXWIDTH_Msk (0x3ul << PDMA_DSCT_CTL_TXWIDTH_Pos) /*!< PDMA_T::DSCT_CTL: TXWIDTH Mask */
  586. #define PDMA_DSCT_CTL_TXACK_Pos (14) /*!< PDMA_T::DSCT_CTL: TXACK Position */
  587. #define PDMA_DSCT_CTL_TXACK_Msk (0x1ul << PDMA_DSCT_CTL_TXACK_Pos) /*!< PDMA_T::DSCT_CTL: TXACK Mask */
  588. #define PDMA_DSCT_CTL_STRIDEEN_Pos (15) /*!< PDMA_T::DSCT_CTL: STRIDEEN Position */
  589. #define PDMA_DSCT_CTL_STRIDEEN_Msk (0x1ul << PDMA_DSCT_CTL_STRIDEEN_Pos) /*!< PDMA_T::DSCT_CTL: STRIDEEN Mask */
  590. #define PDMA_DSCT_CTL_TXCNT_Pos (16) /*!< PDMA_T::DSCT_CTL: TXCNT Position */
  591. #define PDMA_DSCT_CTL_TXCNT_Msk (0xfffful << PDMA_DSCT_CTL_TXCNT_Pos) /*!< PDMA_T::DSCT_CTL: TXCNT Mask */
  592. #define PDMA_DSCT_SA_SA_Pos (0) /*!< PDMA_T::DSCT_SA: SA Position */
  593. #define PDMA_DSCT_SA_SA_Msk (0xfffffffful << PDMA_DSCT_SA_SA_Pos) /*!< PDMA_T::DSCT_SA: SA Mask */
  594. #define PDMA_DSCT_DA_DA_Pos (0) /*!< PDMA_T::DSCT_DA: DA Position */
  595. #define PDMA_DSCT_DA_DA_Msk (0xfffffffful << PDMA_DSCT_DA_DA_Pos) /*!< PDMA_T::DSCT_DA: DA Mask */
  596. #define PDMA_DSCT_NEXT_NEXT_Pos (0) /*!< PDMA_T::DSCT_NEXT: NEXT Position */
  597. #define PDMA_DSCT_NEXT_NEXT_Msk (0xfffful << PDMA_DSCT_NEXT_NEXT_Pos) /*!< PDMA_T::DSCT_NEXT: NEXT Mask */
  598. #define PDMA_DSCT_NEXT_EXENEXT_Pos (16) /*!< PDMA_T::DSCT_FIRST: NEXT Position */
  599. #define PDMA_DSCT_NEXT_EXENEXT_Msk (0xfffful << PDMA_DSCT_NEXT_EXENEXT_Pos) /*!< PDMA_T::DSCT_FIRST: NEXT Mask */
  600. #define PDMA_CURSCAT_CURADDR_Pos (0) /*!< PDMA_T::CURSCAT: CURADDR Position */
  601. #define PDMA_CURSCAT_CURADDR_Msk (0xfffffffful << PDMA_CURSCAT_CURADDR_Pos) /*!< PDMA_T::CURSCAT: CURADDR Mask */
  602. #define PDMA_CHCTL_CHENn_Pos (0) /*!< PDMA_T::CHCTL: CHENn Position */
  603. #define PDMA_CHCTL_CHENn_Msk (0xfffful << PDMA_CHCTL_CHENn_Pos) /*!< PDMA_T::CHCTL: CHENn Mask */
  604. #define PDMA_PAUSE_PAUSEn_Pos (0) /*!< PDMA_T::PAUSE: PAUSEn Position */
  605. #define PDMA_PAUSE_PAUSEn_Msk (0xfffful << PDMA_PAUSE_PAUSEn_Pos) /*!< PDMA_T::PAUSE: PAUSEn Mask */
  606. #define PDMA_SWREQ_SWREQn_Pos (0) /*!< PDMA_T::SWREQ: SWREQn Position */
  607. #define PDMA_SWREQ_SWREQn_Msk (0xfffful << PDMA_SWREQ_SWREQn_Pos) /*!< PDMA_T::SWREQ: SWREQn Mask */
  608. #define PDMA_TRGSTS_REQSTSn_Pos (0) /*!< PDMA_T::TRGSTS: REQSTSn Position */
  609. #define PDMA_TRGSTS_REQSTSn_Msk (0xfffful << PDMA_TRGSTS_REQSTSn_Pos) /*!< PDMA_T::TRGSTS: REQSTSn Mask */
  610. #define PDMA_PRISET_FPRISETn_Pos (0) /*!< PDMA_T::PRISET: FPRISETn Position */
  611. #define PDMA_PRISET_FPRISETn_Msk (0xfffful << PDMA_PRISET_FPRISETn_Pos) /*!< PDMA_T::PRISET: FPRISETn Mask */
  612. #define PDMA_PRICLR_FPRICLRn_Pos (0) /*!< PDMA_T::PRICLR: FPRICLRn Position */
  613. #define PDMA_PRICLR_FPRICLRn_Msk (0xfffful << PDMA_PRICLR_FPRICLRn_Pos) /*!< PDMA_T::PRICLR: FPRICLRn Mask */
  614. #define PDMA_INTEN_INTENn_Pos (0) /*!< PDMA_T::INTEN: INTENn Position */
  615. #define PDMA_INTEN_INTENn_Msk (0xfffful << PDMA_INTEN_INTENn_Pos) /*!< PDMA_T::INTEN: INTENn Mask */
  616. #define PDMA_INTSTS_ABTIF_Pos (0) /*!< PDMA_T::INTSTS: ABTIF Position */
  617. #define PDMA_INTSTS_ABTIF_Msk (0x1ul << PDMA_INTSTS_ABTIF_Pos) /*!< PDMA_T::INTSTS: ABTIF Mask */
  618. #define PDMA_INTSTS_TDIF_Pos (1) /*!< PDMA_T::INTSTS: TDIF Position */
  619. #define PDMA_INTSTS_TDIF_Msk (0x1ul << PDMA_INTSTS_TDIF_Pos) /*!< PDMA_T::INTSTS: TDIF Mask */
  620. #define PDMA_INTSTS_ALIGNF_Pos (2) /*!< PDMA_T::INTSTS: ALIGNF Position */
  621. #define PDMA_INTSTS_ALIGNF_Msk (0x1ul << PDMA_INTSTS_ALIGNF_Pos) /*!< PDMA_T::INTSTS: ALIGNF Mask */
  622. #define PDMA_INTSTS_REQTOF0_Pos (8) /*!< PDMA_T::INTSTS: REQTOF0 Position */
  623. #define PDMA_INTSTS_REQTOF0_Msk (0x1ul << PDMA_INTSTS_REQTOF0_Pos) /*!< PDMA_T::INTSTS: REQTOF0 Mask */
  624. #define PDMA_INTSTS_REQTOFn_Msk (0x3FFul << PDMA_INTSTS_REQTOF0_Pos) /*!< PDMA_T::INTSTS: REQTOFX Mask */
  625. #define PDMA_INTSTS_REQTOF1_Pos (9) /*!< PDMA_T::INTSTS: REQTOF1 Position */
  626. #define PDMA_INTSTS_REQTOF1_Msk (0x1ul << PDMA_INTSTS_REQTOF1_Pos) /*!< PDMA_T::INTSTS: REQTOF1 Mask */
  627. #define PDMA_INTSTS_REQTOF2_Pos (10) /*!< PDMA_T::INTSTS: REQTOF2 Position */
  628. #define PDMA_INTSTS_REQTOF2_Msk (0x1ul << PDMA_INTSTS_REQTOF2_Pos) /*!< PDMA_T::INTSTS: REQTOF2 Mask */
  629. #define PDMA_INTSTS_REQTOF3_Pos (11) /*!< PDMA_T::INTSTS: REQTOF3 Position */
  630. #define PDMA_INTSTS_REQTOF3_Msk (0x1ul << PDMA_INTSTS_REQTOF3_Pos) /*!< PDMA_T::INTSTS: REQTOF3 Mask */
  631. #define PDMA_INTSTS_REQTOF4_Pos (12) /*!< PDMA_T::INTSTS: REQTOF4 Position */
  632. #define PDMA_INTSTS_REQTOF4_Msk (0x1ul << PDMA_INTSTS_REQTOF4_Pos) /*!< PDMA_T::INTSTS: REQTOF4 Mask */
  633. #define PDMA_INTSTS_REQTOF5_Pos (13) /*!< PDMA_T::INTSTS: REQTOF5 Position */
  634. #define PDMA_INTSTS_REQTOF5_Msk (0x1ul << PDMA_INTSTS_REQTOF5_Pos) /*!< PDMA_T::INTSTS: REQTOF5 Mask */
  635. #define PDMA_INTSTS_REQTOF6_Pos (14) /*!< PDMA_T::INTSTS: REQTOF6 Position */
  636. #define PDMA_INTSTS_REQTOF6_Msk (0x1ul << PDMA_INTSTS_REQTOF6_Pos) /*!< PDMA_T::INTSTS: REQTOF6 Mask */
  637. #define PDMA_INTSTS_REQTOF7_Pos (15) /*!< PDMA_T::INTSTS: REQTOF7 Position */
  638. #define PDMA_INTSTS_REQTOF7_Msk (0x1ul << PDMA_INTSTS_REQTOF7_Pos) /*!< PDMA_T::INTSTS: REQTOF7 Mask */
  639. #define PDMA_INTSTS_REQTOF8_Pos (16) /*!< PDMA_T::INTSTS: REQTOF8 Position */
  640. #define PDMA_INTSTS_REQTOF8_Msk (0x1ul << PDMA_INTSTS_REQTOF8_Pos) /*!< PDMA_T::INTSTS: REQTOF8 Mask */
  641. #define PDMA_INTSTS_REQTOF9_Pos (17) /*!< PDMA_T::INTSTS: REQTOF9 Position */
  642. #define PDMA_INTSTS_REQTOF9_Msk (0x1ul << PDMA_INTSTS_REQTOF9_Pos) /*!< PDMA_T::INTSTS: REQTOF9 Mask */
  643. #define PDMA_ABTSTS_ABTIF0_Pos (0) /*!< PDMA_T::ABTSTS: ABTIF0 Position */
  644. #define PDMA_ABTSTS_ABTIF0_Msk (0x1ul << PDMA_ABTSTS_ABTIF0_Pos) /*!< PDMA_T::ABTSTS: ABTIF0 Mask */
  645. #define PDMA_ABTSTS_ABTIF1_Pos (1) /*!< PDMA_T::ABTSTS: ABTIF1 Position */
  646. #define PDMA_ABTSTS_ABTIF1_Msk (0x1ul << PDMA_ABTSTS_ABTIF1_Pos) /*!< PDMA_T::ABTSTS: ABTIF1 Mask */
  647. #define PDMA_ABTSTS_ABTIF2_Pos (2) /*!< PDMA_T::ABTSTS: ABTIF2 Position */
  648. #define PDMA_ABTSTS_ABTIF2_Msk (0x1ul << PDMA_ABTSTS_ABTIF2_Pos) /*!< PDMA_T::ABTSTS: ABTIF2 Mask */
  649. #define PDMA_ABTSTS_ABTIF3_Pos (3) /*!< PDMA_T::ABTSTS: ABTIF3 Position */
  650. #define PDMA_ABTSTS_ABTIF3_Msk (0x1ul << PDMA_ABTSTS_ABTIF3_Pos) /*!< PDMA_T::ABTSTS: ABTIF3 Mask */
  651. #define PDMA_ABTSTS_ABTIF4_Pos (4) /*!< PDMA_T::ABTSTS: ABTIF4 Position */
  652. #define PDMA_ABTSTS_ABTIF4_Msk (0x1ul << PDMA_ABTSTS_ABTIF4_Pos) /*!< PDMA_T::ABTSTS: ABTIF4 Mask */
  653. #define PDMA_ABTSTS_ABTIF5_Pos (5) /*!< PDMA_T::ABTSTS: ABTIF5 Position */
  654. #define PDMA_ABTSTS_ABTIF5_Msk (0x1ul << PDMA_ABTSTS_ABTIF5_Pos) /*!< PDMA_T::ABTSTS: ABTIF5 Mask */
  655. #define PDMA_ABTSTS_ABTIF6_Pos (6) /*!< PDMA_T::ABTSTS: ABTIF6 Position */
  656. #define PDMA_ABTSTS_ABTIF6_Msk (0x1ul << PDMA_ABTSTS_ABTIF6_Pos) /*!< PDMA_T::ABTSTS: ABTIF6 Mask */
  657. #define PDMA_ABTSTS_ABTIF7_Pos (7) /*!< PDMA_T::ABTSTS: ABTIF7 Position */
  658. #define PDMA_ABTSTS_ABTIF7_Msk (0x1ul << PDMA_ABTSTS_ABTIF7_Pos) /*!< PDMA_T::ABTSTS: ABTIF7 Mask */
  659. #define PDMA_ABTSTS_ABTIF8_Pos (8) /*!< PDMA_T::ABTSTS: ABTIF8 Position */
  660. #define PDMA_ABTSTS_ABTIF8_Msk (0x1ul << PDMA_ABTSTS_ABTIF8_Pos) /*!< PDMA_T::ABTSTS: ABTIF8 Mask */
  661. #define PDMA_ABTSTS_ABTIF9_Pos (9) /*!< PDMA_T::ABTSTS: ABTIF9 Position */
  662. #define PDMA_ABTSTS_ABTIF9_Msk (0x1ul << PDMA_ABTSTS_ABTIF9_Pos) /*!< PDMA_T::ABTSTS: ABTIF9 Mask */
  663. #define PDMA_ABTSTS_ABTIF10_Pos (10) /*!< PDMA_T::ABTSTS: ABTIF10 Position */
  664. #define PDMA_ABTSTS_ABTIF10_Msk (0x1ul << PDMA_ABTSTS_ABTIF10_Pos) /*!< PDMA_T::ABTSTS: ABTIF10 Mask */
  665. #define PDMA_ABTSTS_ABTIF11_Pos (11) /*!< PDMA_T::ABTSTS: ABTIF11 Position */
  666. #define PDMA_ABTSTS_ABTIF11_Msk (0x1ul << PDMA_ABTSTS_ABTIF11_Pos) /*!< PDMA_T::ABTSTS: ABTIF11 Mask */
  667. #define PDMA_ABTSTS_ABTIF12_Pos (12) /*!< PDMA_T::ABTSTS: ABTIF12 Position */
  668. #define PDMA_ABTSTS_ABTIF12_Msk (0x1ul << PDMA_ABTSTS_ABTIF12_Pos) /*!< PDMA_T::ABTSTS: ABTIF12 Mask */
  669. #define PDMA_ABTSTS_ABTIF13_Pos (13) /*!< PDMA_T::ABTSTS: ABTIF13 Position */
  670. #define PDMA_ABTSTS_ABTIF13_Msk (0x1ul << PDMA_ABTSTS_ABTIF13_Pos) /*!< PDMA_T::ABTSTS: ABTIF13 Mask */
  671. #define PDMA_ABTSTS_ABTIF14_Pos (14) /*!< PDMA_T::ABTSTS: ABTIF14 Position */
  672. #define PDMA_ABTSTS_ABTIF14_Msk (0x1ul << PDMA_ABTSTS_ABTIF14_Pos) /*!< PDMA_T::ABTSTS: ABTIF14 Mask */
  673. #define PDMA_ABTSTS_ABTIF15_Pos (15) /*!< PDMA_T::ABTSTS: ABTIF15 Position */
  674. #define PDMA_ABTSTS_ABTIF15_Msk (0x1ul << PDMA_ABTSTS_ABTIF15_Pos) /*!< PDMA_T::ABTSTS: ABTIF15 Mask */
  675. #define PDMA_TDSTS_TDIF0_Pos (0) /*!< PDMA_T::TDSTS: TDIF0 Position */
  676. #define PDMA_TDSTS_TDIF0_Msk (0x1ul << PDMA_TDSTS_TDIF0_Pos) /*!< PDMA_T::TDSTS: TDIF0 Mask */
  677. #define PDMA_TDSTS_TDIF1_Pos (1) /*!< PDMA_T::TDSTS: TDIF1 Position */
  678. #define PDMA_TDSTS_TDIF1_Msk (0x1ul << PDMA_TDSTS_TDIF1_Pos) /*!< PDMA_T::TDSTS: TDIF1 Mask */
  679. #define PDMA_TDSTS_TDIF2_Pos (2) /*!< PDMA_T::TDSTS: TDIF2 Position */
  680. #define PDMA_TDSTS_TDIF2_Msk (0x1ul << PDMA_TDSTS_TDIF2_Pos) /*!< PDMA_T::TDSTS: TDIF2 Mask */
  681. #define PDMA_TDSTS_TDIF3_Pos (3) /*!< PDMA_T::TDSTS: TDIF3 Position */
  682. #define PDMA_TDSTS_TDIF3_Msk (0x1ul << PDMA_TDSTS_TDIF3_Pos) /*!< PDMA_T::TDSTS: TDIF3 Mask */
  683. #define PDMA_TDSTS_TDIF4_Pos (4) /*!< PDMA_T::TDSTS: TDIF4 Position */
  684. #define PDMA_TDSTS_TDIF4_Msk (0x1ul << PDMA_TDSTS_TDIF4_Pos) /*!< PDMA_T::TDSTS: TDIF4 Mask */
  685. #define PDMA_TDSTS_TDIF5_Pos (5) /*!< PDMA_T::TDSTS: TDIF5 Position */
  686. #define PDMA_TDSTS_TDIF5_Msk (0x1ul << PDMA_TDSTS_TDIF5_Pos) /*!< PDMA_T::TDSTS: TDIF5 Mask */
  687. #define PDMA_TDSTS_TDIF6_Pos (6) /*!< PDMA_T::TDSTS: TDIF6 Position */
  688. #define PDMA_TDSTS_TDIF6_Msk (0x1ul << PDMA_TDSTS_TDIF6_Pos) /*!< PDMA_T::TDSTS: TDIF6 Mask */
  689. #define PDMA_TDSTS_TDIF7_Pos (7) /*!< PDMA_T::TDSTS: TDIF7 Position */
  690. #define PDMA_TDSTS_TDIF7_Msk (0x1ul << PDMA_TDSTS_TDIF7_Pos) /*!< PDMA_T::TDSTS: TDIF7 Mask */
  691. #define PDMA_TDSTS_TDIF8_Pos (8) /*!< PDMA_T::TDSTS: TDIF8 Position */
  692. #define PDMA_TDSTS_TDIF8_Msk (0x1ul << PDMA_TDSTS_TDIF8_Pos) /*!< PDMA_T::TDSTS: TDIF8 Mask */
  693. #define PDMA_TDSTS_TDIF9_Pos (9) /*!< PDMA_T::TDSTS: TDIF9 Position */
  694. #define PDMA_TDSTS_TDIF9_Msk (0x1ul << PDMA_TDSTS_TDIF9_Pos) /*!< PDMA_T::TDSTS: TDIF9 Mask */
  695. #define PDMA_TDSTS_TDIF10_Pos (10) /*!< PDMA_T::TDSTS: TDIF10 Position */
  696. #define PDMA_TDSTS_TDIF10_Msk (0x1ul << PDMA_TDSTS_TDIF10_Pos) /*!< PDMA_T::TDSTS: TDIF10 Mask */
  697. #define PDMA_TDSTS_TDIF11_Pos (11) /*!< PDMA_T::TDSTS: TDIF11 Position */
  698. #define PDMA_TDSTS_TDIF11_Msk (0x1ul << PDMA_TDSTS_TDIF11_Pos) /*!< PDMA_T::TDSTS: TDIF11 Mask */
  699. #define PDMA_TDSTS_TDIF12_Pos (12) /*!< PDMA_T::TDSTS: TDIF12 Position */
  700. #define PDMA_TDSTS_TDIF12_Msk (0x1ul << PDMA_TDSTS_TDIF12_Pos) /*!< PDMA_T::TDSTS: TDIF12 Mask */
  701. #define PDMA_TDSTS_TDIF13_Pos (13) /*!< PDMA_T::TDSTS: TDIF13 Position */
  702. #define PDMA_TDSTS_TDIF13_Msk (0x1ul << PDMA_TDSTS_TDIF13_Pos) /*!< PDMA_T::TDSTS: TDIF13 Mask */
  703. #define PDMA_TDSTS_TDIF14_Pos (14) /*!< PDMA_T::TDSTS: TDIF14 Position */
  704. #define PDMA_TDSTS_TDIF14_Msk (0x1ul << PDMA_TDSTS_TDIF14_Pos) /*!< PDMA_T::TDSTS: TDIF14 Mask */
  705. #define PDMA_TDSTS_TDIF15_Pos (15) /*!< PDMA_T::TDSTS: TDIF15 Position */
  706. #define PDMA_TDSTS_TDIF15_Msk (0x1ul << PDMA_TDSTS_TDIF15_Pos) /*!< PDMA_T::TDSTS: TDIF15 Mask */
  707. #define PDMA_ALIGN_ALIGNn_Pos (0) /*!< PDMA_T::ALIGN: ALIGNn Position */
  708. #define PDMA_ALIGN_ALIGNn_Msk (0xfffful << PDMA_ALIGN_ALIGNn_Pos) /*!< PDMA_T::ALIGN: ALIGNn Mask */
  709. #define PDMA_TACTSTS_TXACTFn_Pos (0) /*!< PDMA_T::TACTSTS: TXACTFn Position */
  710. #define PDMA_TACTSTS_TXACTFn_Msk (0xfffful << PDMA_TACTSTS_TXACTFn_Pos) /*!< PDMA_T::TACTSTS: TXACTFn Mask */
  711. #define PDMA_TOUTPSC_TOUTPSC0_Pos (0) /*!< PDMA_T::TOUTPSC: TOUTPSC0 Position */
  712. #define PDMA_TOUTPSC_TOUTPSC0_Msk (0x7ul << PDMA_TOUTPSC_TOUTPSC0_Pos) /*!< PDMA_T::TOUTPSC: TOUTPSC0 Mask */
  713. #define PDMA_TOUTPSC_TOUTPSC1_Pos (4) /*!< PDMA_T::TOUTPSC: TOUTPSC1 Position */
  714. #define PDMA_TOUTPSC_TOUTPSC1_Msk (0x7ul << PDMA_TOUTPSC_TOUTPSC1_Pos) /*!< PDMA_T::TOUTPSC: TOUTPSC1 Mask */
  715. #define PDMA_TOUTEN_TOUTENn_Pos (0) /*!< PDMA_T::TOUTEN: TOUTENn Position */
  716. #define PDMA_TOUTEN_TOUTENn_Msk (0x3ul << PDMA_TOUTEN_TOUTENn_Pos) /*!< PDMA_T::TOUTEN: TOUTENn Mask */
  717. #define PDMA_TOUTIEN_TOUTIENn_Pos (0) /*!< PDMA_T::TOUTIEN: TOUTIENn Position */
  718. #define PDMA_TOUTIEN_TOUTIENn_Msk (0x3ul << PDMA_TOUTIEN_TOUTIENn_Pos) /*!< PDMA_T::TOUTIEN: TOUTIENn Mask */
  719. #define PDMA_SCATBA_SCATBA_Pos (16) /*!< PDMA_T::SCATBA: SCATBA Position */
  720. #define PDMA_SCATBA_SCATBA_Msk (0xfffful << PDMA_SCATBA_SCATBA_Pos) /*!< PDMA_T::SCATBA: SCATBA Mask */
  721. #define PDMA_TOC0_1_TOC0_Pos (0) /*!< PDMA_T::TOC0_1: TOC0 Position */
  722. #define PDMA_TOC0_1_TOC0_Msk (0xfffful << PDMA_TOC0_1_TOC0_Pos) /*!< PDMA_T::TOC0_1: TOC0 Mask */
  723. #define PDMA_TOC0_1_TOC1_Pos (16) /*!< PDMA_T::TOC0_1: TOC1 Position */
  724. #define PDMA_TOC0_1_TOC1_Msk (0xfffful << PDMA_TOC0_1_TOC1_Pos) /*!< PDMA_T::TOC0_1: TOC1 Mask */
  725. #define PDMA_TOC2_3_TOC2_Pos (0) /*!< PDMA_T::TOC2_3: TOC2 Position */
  726. #define PDMA_TOC2_3_TOC2_Msk (0xfffful << PDMA_TOC2_3_TOC2_Pos) /*!< PDMA_T::TOC2_3: TOC2 Mask */
  727. #define PDMA_TOC2_3_TOC3_Pos (16) /*!< PDMA_T::TOC2_3: TOC3 Position */
  728. #define PDMA_TOC2_3_TOC3_Msk (0xfffful << PDMA_TOC2_3_TOC3_Pos) /*!< PDMA_T::TOC2_3: TOC3 Mask */
  729. #define PDMA_TOC4_5_TOC4_Pos (0) /*!< PDMA_T::TOC4_5: TOC4 Position */
  730. #define PDMA_TOC4_5_TOC4_Msk (0xfffful << PDMA_TOC4_5_TOC4_Pos) /*!< PDMA_T::TOC4_5: TOC4 Mask */
  731. #define PDMA_TOC4_5_TOC5_Pos (16) /*!< PDMA_T::TOC4_5: TOC5 Position */
  732. #define PDMA_TOC4_5_TOC5_Msk (0xfffful << PDMA_TOC4_5_TOC5_Pos) /*!< PDMA_T::TOC4_5: TOC5 Mask */
  733. #define PDMA_TOC6_7_TOC6_Pos (0) /*!< PDMA_T::TOC6_7: TOC6 Position */
  734. #define PDMA_TOC6_7_TOC6_Msk (0xfffful << PDMA_TOC6_7_TOC6_Pos) /*!< PDMA_T::TOC6_7: TOC6 Mask */
  735. #define PDMA_TOC6_7_TOC7_Pos (16) /*!< PDMA_T::TOC6_7: TOC7 Position */
  736. #define PDMA_TOC6_7_TOC7_Msk (0xfffful << PDMA_TOC6_7_TOC7_Pos) /*!< PDMA_T::TOC6_7: TOC7 Mask */
  737. #define PDMA_TOC8_9_TOC8_Pos (0) /*!< PDMA_T::TOC8_9: TOC8 Position */
  738. #define PDMA_TOC8_9_TOC8_Msk (0xfffful << PDMA_TOC8_9_TOC8_Pos) /*!< PDMA_T::TOC8_9: TOC8 Mask */
  739. #define PDMA_TOC8_9_TOC9_Pos (16) /*!< PDMA_T::TOC8_9: TOC9 Position */
  740. #define PDMA_TOC8_9_TOC9_Msk (0xfffful << PDMA_TOC8_9_TOC9_Pos) /*!< PDMA_T::TOC8_9: TOC9 Mask */
  741. #define PDMA_CHRST_CHnRST_Pos (0) /*!< PDMA_T::CHRST: CHnRST Position */
  742. #define PDMA_CHRST_CHnRST_Msk (0xfffful << PDMA_CHRST_CHnRST_Pos) /*!< PDMA_T::CHRST: CHnRST Mask */
  743. #define PDMA_REQSEL0_3_REQSRC0_Pos (0) /*!< PDMA_T::REQSEL0_3: REQSRC0 Position */
  744. #define PDMA_REQSEL0_3_REQSRC0_Msk (0x7ful << PDMA_REQSEL0_3_REQSRC0_Pos) /*!< PDMA_T::REQSEL0_3: REQSRC0 Mask */
  745. #define PDMA_REQSEL0_3_REQSRC1_Pos (8) /*!< PDMA_T::REQSEL0_3: REQSRC1 Position */
  746. #define PDMA_REQSEL0_3_REQSRC1_Msk (0x7ful << PDMA_REQSEL0_3_REQSRC1_Pos) /*!< PDMA_T::REQSEL0_3: REQSRC1 Mask */
  747. #define PDMA_REQSEL0_3_REQSRC2_Pos (16) /*!< PDMA_T::REQSEL0_3: REQSRC2 Position */
  748. #define PDMA_REQSEL0_3_REQSRC2_Msk (0x7ful << PDMA_REQSEL0_3_REQSRC2_Pos) /*!< PDMA_T::REQSEL0_3: REQSRC2 Mask */
  749. #define PDMA_REQSEL0_3_REQSRC3_Pos (24) /*!< PDMA_T::REQSEL0_3: REQSRC3 Position */
  750. #define PDMA_REQSEL0_3_REQSRC3_Msk (0x7ful << PDMA_REQSEL0_3_REQSRC3_Pos) /*!< PDMA_T::REQSEL0_3: REQSRC3 Mask */
  751. #define PDMA_REQSEL4_7_REQSRC4_Pos (0) /*!< PDMA_T::REQSEL4_7: REQSRC4 Position */
  752. #define PDMA_REQSEL4_7_REQSRC4_Msk (0x7ful << PDMA_REQSEL4_7_REQSRC4_Pos) /*!< PDMA_T::REQSEL4_7: REQSRC4 Mask */
  753. #define PDMA_REQSEL4_7_REQSRC5_Pos (8) /*!< PDMA_T::REQSEL4_7: REQSRC5 Position */
  754. #define PDMA_REQSEL4_7_REQSRC5_Msk (0x7ful << PDMA_REQSEL4_7_REQSRC5_Pos) /*!< PDMA_T::REQSEL4_7: REQSRC5 Mask */
  755. #define PDMA_REQSEL4_7_REQSRC6_Pos (16) /*!< PDMA_T::REQSEL4_7: REQSRC6 Position */
  756. #define PDMA_REQSEL4_7_REQSRC6_Msk (0x7ful << PDMA_REQSEL4_7_REQSRC6_Pos) /*!< PDMA_T::REQSEL4_7: REQSRC6 Mask */
  757. #define PDMA_REQSEL4_7_REQSRC7_Pos (24) /*!< PDMA_T::REQSEL4_7: REQSRC7 Position */
  758. #define PDMA_REQSEL4_7_REQSRC7_Msk (0x7ful << PDMA_REQSEL4_7_REQSRC7_Pos) /*!< PDMA_T::REQSEL4_7: REQSRC7 Mask */
  759. #define PDMA_REQSEL8_11_REQSRC8_Pos (0) /*!< PDMA_T::REQSEL8_11: REQSRC8 Position */
  760. #define PDMA_REQSEL8_11_REQSRC8_Msk (0x7ful << PDMA_REQSEL8_11_REQSRC8_Pos) /*!< PDMA_T::REQSEL8_11: REQSRC8 Mask */
  761. #define PDMA_REQSEL8_11_REQSRC9_Pos (8) /*!< PDMA_T::REQSEL8_11: REQSRC9 Position */
  762. #define PDMA_REQSEL8_11_REQSRC9_Msk (0x7ful << PDMA_REQSEL8_11_REQSRC9_Pos) /*!< PDMA_T::REQSEL8_11: REQSRC9 Mask */
  763. #define PDMA_REQSEL8_11_REQSRC10_Pos (16) /*!< PDMA_T::REQSEL8_11: REQSRC10 Position */
  764. #define PDMA_REQSEL8_11_REQSRC10_Msk (0x7ful << PDMA_REQSEL8_11_REQSRC10_Pos) /*!< PDMA_T::REQSEL8_11: REQSRC10 Mask */
  765. #define PDMA_REQSEL8_11_REQSRC11_Pos (24) /*!< PDMA_T::REQSEL8_11: REQSRC11 Position */
  766. #define PDMA_REQSEL8_11_REQSRC11_Msk (0x7ful << PDMA_REQSEL8_11_REQSRC11_Pos) /*!< PDMA_T::REQSEL8_11: REQSRC11 Mask */
  767. #define PDMA_REQSEL12_15_REQSRC12_Pos (0) /*!< PDMA_T::REQSEL12_15: REQSRC12 Position */
  768. #define PDMA_REQSEL12_15_REQSRC12_Msk (0x7ful << PDMA_REQSEL12_15_REQSRC12_Pos) /*!< PDMA_T::REQSEL12_15: REQSRC12 Mask */
  769. #define PDMA_REQSEL12_15_REQSRC13_Pos (8) /*!< PDMA_T::REQSEL12_15: REQSRC13 Position */
  770. #define PDMA_REQSEL12_15_REQSRC13_Msk (0x7ful << PDMA_REQSEL12_15_REQSRC13_Pos) /*!< PDMA_T::REQSEL12_15: REQSRC13 Mask */
  771. #define PDMA_REQSEL12_15_REQSRC14_Pos (16) /*!< PDMA_T::REQSEL12_15: REQSRC14 Position */
  772. #define PDMA_REQSEL12_15_REQSRC14_Msk (0x7ful << PDMA_REQSEL12_15_REQSRC14_Pos) /*!< PDMA_T::REQSEL12_15: REQSRC14 Mask */
  773. #define PDMA_REQSEL12_15_REQSRC15_Pos (24) /*!< PDMA_T::REQSEL12_15: REQSRC15 Position */
  774. #define PDMA_REQSEL12_15_REQSRC15_Msk (0x7ful << PDMA_REQSEL12_15_REQSRC15_Pos) /*!< PDMA_T::REQSEL12_15: REQSRC15 Mask */
  775. #define PDMA_STCRn_STC_Pos (0) /*!< PDMA_T::STCRn: STC Position */
  776. #define PDMA_STCRn_STC_Msk (0xfffful << PDMA_STCRn_STC_Pos) /*!< PDMA_T::STCRn: STC Mask */
  777. #define PDMA_ASOCRn_SASOL_Pos (0) /*!< PDMA_T::ASOCRn: SASOL Position */
  778. #define PDMA_ASOCRn_SASOL_Msk (0xfffful << PDMA_ASOCRn_SASOL_Pos) /*!< PDMA_T::ASOCRn: SASOL Mask */
  779. #define PDMA_ASOCRn_DASOL_Pos (16) /*!< PDMA_T::ASOCRn: DASOL Position */
  780. #define PDMA_ASOCRn_DASOL_Msk (0xfffful << PDMA_ASOCRn_DASOL_Pos) /*!< PDMA_T::ASOCRn: DASOL Mask */
  781. /**@}*/ /* PDMA_CONST */
  782. /**@}*/ /* end of PDMA register group */
  783. /**@}*/ /* end of REGISTER group */
  784. #define PDMA0 ((PDMA_T *) PDMA0_BA)
  785. #define PDMA1 ((PDMA_T *) PDMA1_BA)
  786. /** @addtogroup Standard_Driver Standard Driver
  787. @{
  788. */
  789. /** @addtogroup PDMA_Driver PDMA Driver
  790. @{
  791. */
  792. /** @addtogroup PDMA_EXPORTED_CONSTANTS PDMA Exported Constants
  793. @{
  794. */
  795. #define PDMA_CH_MAX 10UL /*!< Specify Maximum Channels of PDMA \hideinitializer */
  796. /*---------------------------------------------------------------------------------------------------------*/
  797. /* Operation Mode Constant Definitions */
  798. /*---------------------------------------------------------------------------------------------------------*/
  799. #define PDMA_OP_STOP 0x00000000UL /*!<DMA Stop Mode \hideinitializer */
  800. #define PDMA_OP_BASIC 0x00000001UL /*!<DMA Basic Mode \hideinitializer */
  801. #define PDMA_OP_SCATTER 0x00000002UL /*!<DMA Scatter-gather Mode \hideinitializer */
  802. /*---------------------------------------------------------------------------------------------------------*/
  803. /* Data Width Constant Definitions */
  804. /*---------------------------------------------------------------------------------------------------------*/
  805. #define PDMA_WIDTH_8 0x00000000UL /*!<DMA Transfer Width 8-bit \hideinitializer */
  806. #define PDMA_WIDTH_16 0x00001000UL /*!<DMA Transfer Width 16-bit \hideinitializer */
  807. #define PDMA_WIDTH_32 0x00002000UL /*!<DMA Transfer Width 32-bit \hideinitializer */
  808. /*---------------------------------------------------------------------------------------------------------*/
  809. /* Address Attribute Constant Definitions */
  810. /*---------------------------------------------------------------------------------------------------------*/
  811. #define PDMA_SAR_INC 0x00000000UL /*!<DMA SAR increment \hideinitializer */
  812. #define PDMA_SAR_FIX 0x00000300UL /*!<DMA SAR fix address \hideinitializer */
  813. #define PDMA_DAR_INC 0x00000000UL /*!<DMA DAR increment \hideinitializer */
  814. #define PDMA_DAR_FIX 0x00000C00UL /*!<DMA DAR fix address \hideinitializer */
  815. /*---------------------------------------------------------------------------------------------------------*/
  816. /* Burst Mode Constant Definitions */
  817. /*---------------------------------------------------------------------------------------------------------*/
  818. #define PDMA_REQ_SINGLE 0x00000004UL /*!<DMA Single Request \hideinitializer */
  819. #define PDMA_REQ_BURST 0x00000000UL /*!<DMA Burst Request \hideinitializer */
  820. #define PDMA_BURST_128 0x00000000UL /*!<DMA Burst 128 Transfers \hideinitializer */
  821. #define PDMA_BURST_64 0x00000010UL /*!<DMA Burst 64 Transfers \hideinitializer */
  822. #define PDMA_BURST_32 0x00000020UL /*!<DMA Burst 32 Transfers \hideinitializer */
  823. #define PDMA_BURST_16 0x00000030UL /*!<DMA Burst 16 Transfers \hideinitializer */
  824. #define PDMA_BURST_8 0x00000040UL /*!<DMA Burst 8 Transfers \hideinitializer */
  825. #define PDMA_BURST_4 0x00000050UL /*!<DMA Burst 4 Transfers \hideinitializer */
  826. #define PDMA_BURST_2 0x00000060UL /*!<DMA Burst 2 Transfers \hideinitializer */
  827. #define PDMA_BURST_1 0x00000070UL /*!<DMA Burst 1 Transfers \hideinitializer */
  828. /*---------------------------------------------------------------------------------------------------------*/
  829. /* Table Interrupt Disable Constant Definitions */
  830. /*---------------------------------------------------------------------------------------------------------*/
  831. #define PDMA_TBINTDIS_ENABLE (0x0UL<<PDMA_DSCT_CTL_TBINTDIS_Pos) /*!<DMA Table Interrupt Enabled \hideinitializer */
  832. #define PDMA_TBINTDIS_DISABLE (0x1UL<<PDMA_DSCT_CTL_TBINTDIS_Pos) /*!<DMA Table Interrupt Disabled \hideinitializer */
  833. /*---------------------------------------------------------------------------------------------------------*/
  834. /* Peripheral Transfer Mode Constant Definitions */
  835. /*---------------------------------------------------------------------------------------------------------*/
  836. #define PDMA_MEM 0UL /*!<DMA Connect to PDMA_MEM \hideinitializer */
  837. #define PDMA_UART0_TX 4UL /*!<DMA Connect to UART0_TX \hideinitializer */
  838. #define PDMA_UART0_RX 5UL /*!<DMA Connect to UART0_RX \hideinitializer */
  839. #define PDMA_UART1_TX 6UL /*!<DMA Connect to UART1_TX \hideinitializer */
  840. #define PDMA_UART1_RX 7UL /*!<DMA Connect to UART1_RX \hideinitializer */
  841. #define PDMA_UART2_TX 8UL /*!<DMA Connect to UART2_TX \hideinitializer */
  842. #define PDMA_UART2_RX 9UL /*!<DMA Connect to UART2_RX \hideinitializer */
  843. #define PDMA_UART3_TX 10UL /*!<DMA Connect to UART3_TX \hideinitializer */
  844. #define PDMA_UART3_RX 11UL /*!<DMA Connect to UART3_RX \hideinitializer */
  845. #define PDMA_UART4_TX 12UL /*!<DMA Connect to UART4_TX \hideinitializer */
  846. #define PDMA_UART4_RX 13UL /*!<DMA Connect to UART4_RX \hideinitializer */
  847. #define PDMA_UART5_TX 14UL /*!<DMA Connect to UART5_TX \hideinitializer */
  848. #define PDMA_UART5_RX 15UL /*!<DMA Connect to UART5_RX \hideinitializer */
  849. #define PDMA_UART6_TX 16UL /*!<DMA Connect to UART6_TX \hideinitializer */
  850. #define PDMA_UART6_RX 17UL /*!<DMA Connect to UART6_RX \hideinitializer */
  851. #define PDMA_UART7_TX 18UL /*!<DMA Connect to UART7_TX \hideinitializer */
  852. #define PDMA_UART7_RX 19UL /*!<DMA Connect to UART7_RX \hideinitializer */
  853. #define PDMA_QSPI0_TX 20UL /*!<DMA Connect to QSPI0_TX \hideinitializer */
  854. #define PDMA_QSPI0_RX 21UL /*!<DMA Connect to QSPI0_RX \hideinitializer */
  855. #define PDMA_SPI0_TX 22UL /*!<DMA Connect to SPI0_TX \hideinitializer */
  856. #define PDMA_SPI0_RX 23UL /*!<DMA Connect to SPI0_RX \hideinitializer */
  857. #define PDMA_SPI1_TX 24UL /*!<DMA Connect to SPI1_TX \hideinitializer */
  858. #define PDMA_SPI1_RX 25UL /*!<DMA Connect to SPI1_RX \hideinitializer */
  859. #define PDMA_UART8_TX 26UL /*!<DMA Connect to UART8_TX \hideinitializer */
  860. #define PDMA_UART8_RX 27UL /*!<DMA Connect to UART8_RX \hideinitializer */
  861. #define PDMA_UART9_TX 28UL /*!<DMA Connect to UART9_TX \hideinitializer */
  862. #define PDMA_UART9_RX 29UL /*!<DMA Connect to UART9_RX \hideinitializer */
  863. #define PDMA_I2C0_TX 38UL /*!<DMA Connect to I2C0_TX \hideinitializer */
  864. #define PDMA_I2C0_RX 39UL /*!<DMA Connect to I2C0_RX \hideinitializer */
  865. #define PDMA_I2C1_TX 40UL /*!<DMA Connect to I2C1_TX \hideinitializer */
  866. #define PDMA_I2C1_RX 41UL /*!<DMA Connect to I2C1_RX \hideinitializer */
  867. #define PDMA_I2C2_TX 42UL /*!<DMA Connect to I2C2_TX \hideinitializer */
  868. #define PDMA_I2C2_RX 43UL /*!<DMA Connect to I2C2_RX \hideinitializer */
  869. #define PDMA_I2C3_TX 44UL /*!<DMA Connect to I2C3_TX \hideinitializer */
  870. #define PDMA_I2C3_RX 45UL /*!<DMA Connect to I2C3_RX \hideinitializer */
  871. #define PDMA_TIMER0 46UL /*!<DMA Connect to TIMER0 \hideinitializer */
  872. #define PDMA_TIMER1 47UL /*!<DMA Connect to TIMER1 \hideinitializer */
  873. #define PDMA_TIMER2 48UL /*!<DMA Connect to TIMER2 \hideinitializer */
  874. #define PDMA_TIMER3 49UL /*!<DMA Connect to TIMER3 \hideinitializer */
  875. #define PDMA_TIMER4 50UL /*!<DMA Connect to TIMER4 \hideinitializer */
  876. #define PDMA_TIMER5 51UL /*!<DMA Connect to TIMER5 \hideinitializer */
  877. /*---------------------------------------------------------------------------------------------------------*/
  878. /* Interrupt Type Constant Definitions */
  879. /*---------------------------------------------------------------------------------------------------------*/
  880. #define PDMA_INT_TRANS_DONE 0x00000000UL /*!<Transfer Done Interrupt \hideinitializer */
  881. #define PDMA_INT_TEMPTY 0x00000001UL /*!<Table Empty Interrupt \hideinitializer */
  882. #define PDMA_INT_TIMEOUT 0x00000002UL /*!<Timeout Interrupt \hideinitializer */
  883. /*@}*/ /* end of group PDMA_EXPORTED_CONSTANTS */
  884. /** @addtogroup PDMA_EXPORTED_FUNCTIONS PDMA Exported Functions
  885. @{
  886. */
  887. /**
  888. * @brief Get PDMA Interrupt Status
  889. *
  890. * @param[in] pdma The pointer of the specified PDMA module
  891. *
  892. * @return None
  893. *
  894. * @details This macro gets the interrupt status.
  895. * \hideinitializer
  896. */
  897. #define PDMA_GET_INT_STATUS(pdma) ((uint32_t)(pdma->INTSTS))
  898. /**
  899. * @brief Get Transfer Done Interrupt Status
  900. *
  901. * @param[in] pdma The pointer of the specified PDMA module
  902. *
  903. * @return None
  904. *
  905. * @details Get the transfer done Interrupt status.
  906. * \hideinitializer
  907. */
  908. #define PDMA_GET_TD_STS(pdma) ((uint32_t)(pdma->TDSTS))
  909. /**
  910. * @brief Clear Transfer Done Interrupt Status
  911. *
  912. * @param[in] pdma The pointer of the specified PDMA module
  913. *
  914. * @param[in] u32Mask The channel mask
  915. *
  916. * @return None
  917. *
  918. * @details Clear the transfer done Interrupt status.
  919. * \hideinitializer
  920. */
  921. #define PDMA_CLR_TD_FLAG(pdma,u32Mask) ((uint32_t)(pdma->TDSTS = (u32Mask)))
  922. /**
  923. * @brief Get Target Abort Interrupt Status
  924. *
  925. * @param[in] pdma The pointer of the specified PDMA module
  926. *
  927. * @return None
  928. *
  929. * @details Get the target abort Interrupt status.
  930. * \hideinitializer
  931. */
  932. #define PDMA_GET_ABORT_STS(pdma) ((uint32_t)(pdma->ABTSTS))
  933. /**
  934. * @brief Clear Target Abort Interrupt Status
  935. *
  936. * @param[in] pdma The pointer of the specified PDMA module
  937. *
  938. * @param[in] u32Mask The channel mask
  939. *
  940. * @return None
  941. *
  942. * @details Clear the target abort Interrupt status.
  943. * \hideinitializer
  944. */
  945. #define PDMA_CLR_ABORT_FLAG(pdma,u32Mask) ((uint32_t)(pdma->ABTSTS = (u32Mask)))
  946. /**
  947. * @brief Get Alignment Interrupt Status
  948. *
  949. * @param[in] pdma The pointer of the specified PDMA module
  950. *
  951. * @return None
  952. *
  953. * @details Get Alignment Interrupt status.
  954. * \hideinitializer
  955. */
  956. #define PDMA_GET_ALIGN_STS(pdma) ((uint32_t)(PDMA->ALIGN))
  957. /**
  958. * @brief Clear Alignment Interrupt Status
  959. *
  960. * @param[in] pdma The pointer of the specified PDMA module
  961. * @param[in] u32Mask The channel mask
  962. *
  963. * @return None
  964. *
  965. * @details Clear the Alignment Interrupt status.
  966. * \hideinitializer
  967. */
  968. #define PDMA_CLR_ALIGN_FLAG(pdma,u32Mask) ((uint32_t)(pdma->ALIGN = (u32Mask)))
  969. /**
  970. * @brief Clear Timeout Interrupt Status
  971. *
  972. * @param[in] pdma The pointer of the specified PDMA module
  973. * @param[in] u32Ch The selected channel
  974. *
  975. * @return None
  976. *
  977. * @details Clear the selected channel timeout interrupt status.
  978. * \hideinitializer
  979. */
  980. #define PDMA_CLR_TMOUT_FLAG(pdma,u32Ch) ((uint32_t)(pdma->INTSTS = (1 << ((u32Ch) + 8))))
  981. /**
  982. * @brief Check Channel Status
  983. *
  984. * @param[in] pdma The pointer of the specified PDMA module
  985. * @param[in] u32Ch The selected channel
  986. *
  987. * @retval 0 Idle state
  988. * @retval 1 Busy state
  989. *
  990. * @details Check the selected channel is busy or not.
  991. * \hideinitializer
  992. */
  993. #define PDMA_IS_CH_BUSY(pdma,u32Ch) ((uint32_t)(pdma->TRGSTS & (1 << (u32Ch)))? 1 : 0)
  994. /**
  995. * @brief Set Source Address
  996. *
  997. * @param[in] pdma The pointer of the specified PDMA module
  998. * @param[in] u32Ch The selected channel
  999. * @param[in] u32Addr The selected address
  1000. *
  1001. * @return None
  1002. *
  1003. * @details This macro set the selected channel source address.
  1004. * \hideinitializer
  1005. */
  1006. #define PDMA_SET_SRC_ADDR(pdma,u32Ch, u32Addr) ((uint32_t)(pdma->DSCT[(u32Ch)].SA = (u32Addr)))
  1007. /**
  1008. * @brief Set Destination Address
  1009. *
  1010. * @param[in] pdma The pointer of the specified PDMA module
  1011. * @param[in] u32Ch The selected channel
  1012. * @param[in] u32Addr The selected address
  1013. *
  1014. * @return None
  1015. *
  1016. * @details This macro set the selected channel destination address.
  1017. * \hideinitializer
  1018. */
  1019. #define PDMA_SET_DST_ADDR(pdma,u32Ch, u32Addr) ((uint32_t)(pdma->DSCT[(u32Ch)].DA = (u32Addr)))
  1020. /**
  1021. * @brief Set Transfer Count
  1022. *
  1023. * @param[in] pdma The pointer of the specified PDMA module
  1024. * @param[in] u32Ch The selected channel
  1025. * @param[in] u32TransCount Transfer Count
  1026. *
  1027. * @return None
  1028. *
  1029. * @details This macro set the selected channel transfer count.
  1030. * \hideinitializer
  1031. */
  1032. #define PDMA_SET_TRANS_CNT(pdma,u32Ch, u32TransCount) ((uint32_t)(pdma->DSCT[(u32Ch)].CTL=(pdma->DSCT[(u32Ch)].CTL&~PDMA_DSCT_CTL_TXCNT_Msk)|(((u32TransCount)-1) << PDMA_DSCT_CTL_TXCNT_Pos)))
  1033. /**
  1034. * @brief Set Scatter-gather descriptor Address
  1035. *
  1036. * @param[in] pdma The pointer of the specified PDMA module
  1037. * @param[in] u32Ch The selected channel
  1038. * @param[in] u32Addr The descriptor address
  1039. *
  1040. * @return None
  1041. *
  1042. * @details This macro set the selected channel scatter-gather descriptor address.
  1043. * \hideinitializer
  1044. */
  1045. #define PDMA_SET_SCATTER_DESC(pdma,u32Ch, u32Addr) ((uint32_t)(pdma->DSCT[(u32Ch)].NEXT = (u32Addr) - (pdma->SCATBA)))
  1046. /**
  1047. * @brief Stop the channel
  1048. *
  1049. * @param[in] pdma The pointer of the specified PDMA module
  1050. *
  1051. * @param[in] u32Ch The selected channel
  1052. *
  1053. * @return None
  1054. *
  1055. * @details This macro stop the selected channel.
  1056. * \hideinitializer
  1057. */
  1058. #define PDMA_STOP(pdma,u32Ch) ((uint32_t)(pdma->PAUSE = (1 << (u32Ch))))
  1059. /**
  1060. * @brief Pause the channel
  1061. *
  1062. * @param[in] pdma The pointer of the specified PDMA module
  1063. *
  1064. * @param[in] u32Ch The selected channel
  1065. *
  1066. * @return None
  1067. *
  1068. * @details This macro pause the selected channel.
  1069. * \hideinitializer
  1070. */
  1071. #define PDMA_PAUSE(pdma,u32Ch) ((uint32_t)(pdma->PAUSE = (1 << (u32Ch))))
  1072. /*---------------------------------------------------------------------------------------------------------*/
  1073. /* Define PDMA functions prototype */
  1074. /*---------------------------------------------------------------------------------------------------------*/
  1075. void PDMA_Open(PDMA_T *pdma, uint32_t u32Mask);
  1076. void PDMA_Close(PDMA_T *pdma);
  1077. void PDMA_SetTransferCnt(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32Width, uint32_t u32TransCount);
  1078. void PDMA_SetTransferAddr(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32SrcAddr, uint32_t u32SrcCtrl, uint32_t u32DstAddr, uint32_t u32DstCtrl);
  1079. void PDMA_SetTransferMode(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32Peripheral, uint32_t u32ScatterEn, uint32_t u32DescAddr);
  1080. void PDMA_SetBurstType(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32BurstType, uint32_t u32BurstSize);
  1081. void PDMA_EnableTimeout(PDMA_T *pdma, uint32_t u32Mask);
  1082. void PDMA_DisableTimeout(PDMA_T *pdma, uint32_t u32Mask);
  1083. void PDMA_SetTimeOut(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32OnOff, uint32_t u32TimeOutCnt);
  1084. void PDMA_Trigger(PDMA_T *pdma, uint32_t u32Ch);
  1085. void PDMA_EnableInt(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32Mask);
  1086. void PDMA_DisableInt(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32Mask);
  1087. void PDMA_SetStride(PDMA_T *pdma, uint32_t u32Ch, uint32_t u32DestLen, uint32_t u32SrcLen, uint32_t u32TransCount);
  1088. /*@}*/ /* end of group PDMA_EXPORTED_FUNCTIONS */
  1089. /*@}*/ /* end of group PDMA_Driver */
  1090. /*@}*/ /* end of group Standard_Driver */
  1091. #ifdef __cplusplus
  1092. }
  1093. #endif
  1094. #endif /* __NU_PDMA_H__ */