udma.h 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899
  1. //*****************************************************************************
  2. //
  3. // udma.h - Prototypes and macros for the uDMA controller.
  4. //
  5. // Copyright (c) 2007-2014 Texas Instruments Incorporated. All rights reserved.
  6. // Software License Agreement
  7. //
  8. // Redistribution and use in source and binary forms, with or without
  9. // modification, are permitted provided that the following conditions
  10. // are met:
  11. //
  12. // Redistributions of source code must retain the above copyright
  13. // notice, this list of conditions and the following disclaimer.
  14. //
  15. // Redistributions in binary form must reproduce the above copyright
  16. // notice, this list of conditions and the following disclaimer in the
  17. // documentation and/or other materials provided with the
  18. // distribution.
  19. //
  20. // Neither the name of Texas Instruments Incorporated nor the names of
  21. // its contributors may be used to endorse or promote products derived
  22. // from this software without specific prior written permission.
  23. //
  24. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  25. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  26. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  27. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  28. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  29. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  30. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  31. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  32. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  33. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  34. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  35. //
  36. // This is part of revision 2.1.0.12573 of the Tiva Peripheral Driver Library.
  37. //
  38. //*****************************************************************************
  39. #ifndef __DRIVERLIB_UDMA_H__
  40. #define __DRIVERLIB_UDMA_H__
  41. //*****************************************************************************
  42. //
  43. // If building with a C++ compiler, make all of the definitions in this header
  44. // have a C binding.
  45. //
  46. //*****************************************************************************
  47. #ifdef __cplusplus
  48. extern "C"
  49. {
  50. #endif
  51. //*****************************************************************************
  52. //
  53. //! \addtogroup udma_api
  54. //! @{
  55. //
  56. //*****************************************************************************
  57. //*****************************************************************************
  58. //
  59. // A structure that defines an entry in the channel control table. These
  60. // fields are used by the uDMA controller and normally it is not necessary for
  61. // software to directly read or write fields in the table.
  62. //
  63. //*****************************************************************************
  64. typedef struct
  65. {
  66. //
  67. // The ending source address of the data transfer.
  68. //
  69. volatile void *pvSrcEndAddr;
  70. //
  71. // The ending destination address of the data transfer.
  72. //
  73. volatile void *pvDstEndAddr;
  74. //
  75. // The channel control mode.
  76. //
  77. volatile uint32_t ui32Control;
  78. //
  79. // An unused location.
  80. //
  81. volatile uint32_t ui32Spare;
  82. }
  83. tDMAControlTable;
  84. //*****************************************************************************
  85. //
  86. //! A helper macro for building scatter-gather task table entries.
  87. //!
  88. //! \param ui32TransferCount is the count of items to transfer for this task.
  89. //! \param ui32ItemSize is the bit size of the items to transfer for this task.
  90. //! \param ui32SrcIncrement is the bit size increment for source data.
  91. //! \param pvSrcAddr is the starting address of the data to transfer.
  92. //! \param ui32DstIncrement is the bit size increment for destination data.
  93. //! \param pvDstAddr is the starting address of the destination data.
  94. //! \param ui32ArbSize is the arbitration size to use for the transfer task.
  95. //! \param ui32Mode is the transfer mode for this task.
  96. //!
  97. //! This macro is intended to be used to help populate a table of uDMA tasks
  98. //! for a scatter-gather transfer. This macro will calculate the values for
  99. //! the fields of a task structure entry based on the input parameters.
  100. //!
  101. //! There are specific requirements for the values of each parameter. No
  102. //! checking is done so it is up to the caller to ensure that correct values
  103. //! are used for the parameters.
  104. //!
  105. //! The \e ui32TransferCount parameter is the number of items that will be
  106. //! transferred by this task. It must be in the range 1-1024.
  107. //!
  108. //! The \e ui32ItemSize parameter is the bit size of the transfer data. It
  109. //! must be one of \b UDMA_SIZE_8, \b UDMA_SIZE_16, or \b UDMA_SIZE_32.
  110. //!
  111. //! The \e ui32SrcIncrement parameter is the increment size for the source
  112. //! data. It must be one of \b UDMA_SRC_INC_8, \b UDMA_SRC_INC_16,
  113. //! \b UDMA_SRC_INC_32, or \b UDMA_SRC_INC_NONE.
  114. //!
  115. //! The \e pvSrcAddr parameter is a void pointer to the beginning of the source
  116. //! data.
  117. //!
  118. //! The \e ui32DstIncrement parameter is the increment size for the destination
  119. //! data. It must be one of \b UDMA_DST_INC_8, \b UDMA_DST_INC_16,
  120. //! \b UDMA_DST_INC_32, or \b UDMA_DST_INC_NONE.
  121. //!
  122. //! The \e pvDstAddr parameter is a void pointer to the beginning of the
  123. //! location where the data will be transferred.
  124. //!
  125. //! The \e ui32ArbSize parameter is the arbitration size for the transfer, and
  126. //! must be one of \b UDMA_ARB_1, \b UDMA_ARB_2, \b UDMA_ARB_4, and so on
  127. //! up to \b UDMA_ARB_1024. This is used to select the arbitration size in
  128. //! powers of 2, from 1 to 1024.
  129. //!
  130. //! The \e ui32Mode parameter is the mode to use for this transfer task. It
  131. //! must be one of \b UDMA_MODE_BASIC, \b UDMA_MODE_AUTO,
  132. //! \b UDMA_MODE_MEM_SCATTER_GATHER, or \b UDMA_MODE_PER_SCATTER_GATHER. Note
  133. //! that normally all tasks will be one of the scatter-gather modes while the
  134. //! last task is a task list will be AUTO or BASIC.
  135. //!
  136. //! This macro is intended to be used to initialize individual entries of
  137. //! a structure of tDMAControlTable type, like this:
  138. //!
  139. //! \verbatim
  140. //! tDMAControlTable MyTaskList[] =
  141. //! {
  142. //! uDMATaskStructEntry(Task1Count, UDMA_SIZE_8,
  143. //! UDMA_SRC_INC_8, MySourceBuf,
  144. //! UDMA_DST_INC_8, MyDestBuf,
  145. //! UDMA_ARB_8, UDMA_MODE_MEM_SCATTER_GATHER),
  146. //! uDMATaskStructEntry(Task2Count, ...),
  147. //! }
  148. //! \endverbatim
  149. //!
  150. //! \return Nothing; this is not a function.
  151. //
  152. //*****************************************************************************
  153. #define uDMATaskStructEntry(ui32TransferCount, \
  154. ui32ItemSize, \
  155. ui32SrcIncrement, \
  156. pvSrcAddr, \
  157. ui32DstIncrement, \
  158. pvDstAddr, \
  159. ui32ArbSize, \
  160. ui32Mode) \
  161. { \
  162. (((ui32SrcIncrement) == UDMA_SRC_INC_NONE) ? (void *)(pvSrcAddr) : \
  163. ((void *)(&((uint8_t *)(pvSrcAddr))[((ui32TransferCount) << \
  164. ((ui32SrcIncrement) >> 26)) - 1]))), \
  165. (((ui32DstIncrement) == UDMA_DST_INC_NONE) ? (void *)(pvDstAddr) :\
  166. ((void *)(&((uint8_t *)(pvDstAddr))[((ui32TransferCount) << \
  167. ((ui32DstIncrement) >> 30)) - 1]))), \
  168. (ui32SrcIncrement) | (ui32DstIncrement) | (ui32ItemSize) | \
  169. (ui32ArbSize) | \
  170. (((ui32TransferCount) - 1) << 4) | \
  171. ((((ui32Mode) == UDMA_MODE_MEM_SCATTER_GATHER) || \
  172. ((ui32Mode) == UDMA_MODE_PER_SCATTER_GATHER)) ? \
  173. (ui32Mode) | UDMA_MODE_ALT_SELECT : (ui32Mode)), 0 \
  174. }
  175. //*****************************************************************************
  176. //
  177. // Close the Doxygen group.
  178. //! @}
  179. //
  180. //*****************************************************************************
  181. //*****************************************************************************
  182. //
  183. // Flags that can be passed to uDMAChannelAttributeEnable(),
  184. // uDMAChannelAttributeDisable(), and returned from uDMAChannelAttributeGet().
  185. //
  186. //*****************************************************************************
  187. #define UDMA_ATTR_USEBURST 0x00000001
  188. #define UDMA_ATTR_ALTSELECT 0x00000002
  189. #define UDMA_ATTR_HIGH_PRIORITY 0x00000004
  190. #define UDMA_ATTR_REQMASK 0x00000008
  191. #define UDMA_ATTR_ALL 0x0000000F
  192. //*****************************************************************************
  193. //
  194. // DMA control modes that can be passed to uDMAModeSet() and returned
  195. // uDMAModeGet().
  196. //
  197. //*****************************************************************************
  198. #define UDMA_MODE_STOP 0x00000000
  199. #define UDMA_MODE_BASIC 0x00000001
  200. #define UDMA_MODE_AUTO 0x00000002
  201. #define UDMA_MODE_PINGPONG 0x00000003
  202. #define UDMA_MODE_MEM_SCATTER_GATHER \
  203. 0x00000004
  204. #define UDMA_MODE_PER_SCATTER_GATHER \
  205. 0x00000006
  206. #define UDMA_MODE_ALT_SELECT 0x00000001
  207. //*****************************************************************************
  208. //
  209. // Channel configuration values that can be passed to uDMAControlSet().
  210. //
  211. //*****************************************************************************
  212. #define UDMA_DST_INC_8 0x00000000
  213. #define UDMA_DST_INC_16 0x40000000
  214. #define UDMA_DST_INC_32 0x80000000
  215. #define UDMA_DST_INC_NONE 0xc0000000
  216. #define UDMA_SRC_INC_8 0x00000000
  217. #define UDMA_SRC_INC_16 0x04000000
  218. #define UDMA_SRC_INC_32 0x08000000
  219. #define UDMA_SRC_INC_NONE 0x0c000000
  220. #define UDMA_SIZE_8 0x00000000
  221. #define UDMA_SIZE_16 0x11000000
  222. #define UDMA_SIZE_32 0x22000000
  223. #define UDMA_DST_PROT_PRIV 0x00200000
  224. #define UDMA_SRC_PROT_PRIV 0x00040000
  225. #define UDMA_ARB_1 0x00000000
  226. #define UDMA_ARB_2 0x00004000
  227. #define UDMA_ARB_4 0x00008000
  228. #define UDMA_ARB_8 0x0000c000
  229. #define UDMA_ARB_16 0x00010000
  230. #define UDMA_ARB_32 0x00014000
  231. #define UDMA_ARB_64 0x00018000
  232. #define UDMA_ARB_128 0x0001c000
  233. #define UDMA_ARB_256 0x00020000
  234. #define UDMA_ARB_512 0x00024000
  235. #define UDMA_ARB_1024 0x00028000
  236. #define UDMA_NEXT_USEBURST 0x00000008
  237. //*****************************************************************************
  238. //
  239. // Channel numbers to be passed to API functions that require a channel number
  240. // ID.
  241. //
  242. //*****************************************************************************
  243. #define UDMA_CHANNEL_USBEP1RX 0
  244. #define UDMA_CHANNEL_USBEP1TX 1
  245. #define UDMA_CHANNEL_USBEP2RX 2
  246. #define UDMA_CHANNEL_USBEP2TX 3
  247. #define UDMA_CHANNEL_USBEP3RX 4
  248. #define UDMA_CHANNEL_USBEP3TX 5
  249. #define UDMA_CHANNEL_ETH0RX 6
  250. #define UDMA_CHANNEL_ETH0TX 7
  251. #define UDMA_CHANNEL_UART0RX 8
  252. #define UDMA_CHANNEL_UART0TX 9
  253. #define UDMA_CHANNEL_SSI0RX 10
  254. #define UDMA_CHANNEL_SSI0TX 11
  255. #define UDMA_CHANNEL_ADC0 14
  256. #define UDMA_CHANNEL_ADC1 15
  257. #define UDMA_CHANNEL_ADC2 16
  258. #define UDMA_CHANNEL_ADC3 17
  259. #define UDMA_CHANNEL_TMR0A 18
  260. #define UDMA_CHANNEL_TMR0B 19
  261. #define UDMA_CHANNEL_TMR1A 20
  262. #define UDMA_CHANNEL_TMR1B 21
  263. #define UDMA_CHANNEL_UART1RX 22
  264. #define UDMA_CHANNEL_UART1TX 23
  265. #define UDMA_CHANNEL_SSI1RX 24
  266. #define UDMA_CHANNEL_SSI1TX 25
  267. #define UDMA_CHANNEL_I2S0RX 28
  268. #define UDMA_CHANNEL_I2S0TX 29
  269. #define UDMA_CHANNEL_SW 30
  270. //*****************************************************************************
  271. //
  272. // Flags to be OR'd with the channel ID to indicate if the primary or alternate
  273. // control structure should be used.
  274. //
  275. //*****************************************************************************
  276. #define UDMA_PRI_SELECT 0x00000000
  277. #define UDMA_ALT_SELECT 0x00000020
  278. //*****************************************************************************
  279. //
  280. // uDMA interrupt sources, to be passed to uDMAIntRegister() and
  281. // uDMAIntUnregister().
  282. //
  283. //*****************************************************************************
  284. #define UDMA_INT_SW 62
  285. #define UDMA_INT_ERR 63
  286. //*****************************************************************************
  287. //
  288. // Channel numbers to be passed to API functions that require a channel number
  289. // ID. These are for secondary peripheral assignments.
  290. //
  291. //*****************************************************************************
  292. #define UDMA_SEC_CHANNEL_UART2RX_0 \
  293. 0
  294. #define UDMA_SEC_CHANNEL_UART2TX_1 \
  295. 1
  296. #define UDMA_SEC_CHANNEL_TMR3A 2
  297. #define UDMA_SEC_CHANNEL_TMR3B 3
  298. #define UDMA_SEC_CHANNEL_TMR2A_4 \
  299. 4
  300. #define UDMA_SEC_CHANNEL_TMR2B_5 \
  301. 5
  302. #define UDMA_SEC_CHANNEL_TMR2A_6 \
  303. 6
  304. #define UDMA_SEC_CHANNEL_TMR2B_7 \
  305. 7
  306. #define UDMA_SEC_CHANNEL_UART1RX \
  307. 8
  308. #define UDMA_SEC_CHANNEL_UART1TX \
  309. 9
  310. #define UDMA_SEC_CHANNEL_SSI1RX 10
  311. #define UDMA_SEC_CHANNEL_SSI1TX 11
  312. #define UDMA_SEC_CHANNEL_UART2RX_12 \
  313. 12
  314. #define UDMA_SEC_CHANNEL_UART2TX_13 \
  315. 13
  316. #define UDMA_SEC_CHANNEL_TMR2A_14 \
  317. 14
  318. #define UDMA_SEC_CHANNEL_TMR2B_15 \
  319. 15
  320. #define UDMA_SEC_CHANNEL_TMR1A 18
  321. #define UDMA_SEC_CHANNEL_TMR1B 19
  322. #define UDMA_SEC_CHANNEL_EPI0RX 20
  323. #define UDMA_SEC_CHANNEL_EPI0TX 21
  324. #define UDMA_SEC_CHANNEL_ADC10 24
  325. #define UDMA_SEC_CHANNEL_ADC11 25
  326. #define UDMA_SEC_CHANNEL_ADC12 26
  327. #define UDMA_SEC_CHANNEL_ADC13 27
  328. #define UDMA_SEC_CHANNEL_SW 30
  329. //*****************************************************************************
  330. //
  331. // Values that can be passed to uDMAChannelAssign() to select peripheral
  332. // mapping for each channel. The channels named RESERVED may be assigned
  333. // to a peripheral in future parts.
  334. //
  335. //*****************************************************************************
  336. //
  337. // Channel 0
  338. //
  339. #define UDMA_CH0_USB0EP1RX 0x00000000
  340. #define UDMA_CH0_UART2RX 0x00010000
  341. #define UDMA_CH0_RESERVED2 0x00020000
  342. #define UDMA_CH0_TIMER4A 0x00030000
  343. #define UDMA_CH0_RESERVED4 0x00040000
  344. #define UDMA_CH0_RESERVED5 0x00050000
  345. #define UDMA_CH0_I2C0RX 0x00060000
  346. #define UDMA_CH0_RESERVED7 0x00070000
  347. #define UDMA_CH0_RESERVED8 0x00080000
  348. //
  349. // Channel 1
  350. //
  351. #define UDMA_CH1_USB0EP1TX 0x00000001
  352. #define UDMA_CH1_UART2TX 0x00010001
  353. #define UDMA_CH1_RESERVED2 0x00020001
  354. #define UDMA_CH1_TIMER4B 0x00030001
  355. #define UDMA_CH1_RESERVED4 0x00040001
  356. #define UDMA_CH1_RESERVED5 0x00050001
  357. #define UDMA_CH1_I2C0TX 0x00060001
  358. #define UDMA_CH1_RESERVED7 0x00070001
  359. #define UDMA_CH1_RESERVED8 0x00080001
  360. //
  361. // Channel 2
  362. //
  363. #define UDMA_CH2_USB0EP2RX 0x00000002
  364. #define UDMA_CH2_TIMER3A 0x00010002
  365. #define UDMA_CH2_RESERVED2 0x00020002
  366. #define UDMA_CH2_RESERVED3 0x00030002
  367. #define UDMA_CH2_RESERVED4 0x00040002
  368. #define UDMA_CH2_RESERVED5 0x00050002
  369. #define UDMA_CH2_I2C1RX 0x00060002
  370. #define UDMA_CH2_RESERVED7 0x00070002
  371. #define UDMA_CH2_RESERVED8 0x00080002
  372. //
  373. // Channel 3
  374. //
  375. #define UDMA_CH3_USB0EP2TX 0x00000003
  376. #define UDMA_CH3_TIMER3B 0x00010003
  377. #define UDMA_CH3_RESERVED2 0x00020003
  378. #define UDMA_CH3_LPC0_3 0x00030003
  379. #define UDMA_CH3_RESERVED4 0x00040003
  380. #define UDMA_CH3_RESERVED5 0x00050003
  381. #define UDMA_CH3_I2C1TX 0x00060003
  382. #define UDMA_CH3_RESERVED7 0x00070003
  383. #define UDMA_CH3_RESERVED8 0x00080003
  384. //
  385. // Channel 4
  386. //
  387. #define UDMA_CH4_USB0EP3RX 0x00000004
  388. #define UDMA_CH4_TIMER2A 0x00010004
  389. #define UDMA_CH4_RESERVED2 0x00020004
  390. #define UDMA_CH4_GPIOA 0x00030004
  391. #define UDMA_CH4_RESERVED4 0x00040004
  392. #define UDMA_CH4_SHAMD50CIN 0x00050004
  393. #define UDMA_CH4_I2C2RX 0x00060004
  394. #define UDMA_CH4_RESERVED7 0x00070004
  395. #define UDMA_CH4_RESERVED8 0x00080004
  396. //
  397. // Channel 5
  398. //
  399. #define UDMA_CH5_USB0EP3TX 0x00000005
  400. #define UDMA_CH5_TIMER2B 0x00010005
  401. #define UDMA_CH5_RESERVED2 0x00020005
  402. #define UDMA_CH5_GPIOB 0x00030005
  403. #define UDMA_CH5_RESERVED4 0x00040005
  404. #define UDMA_CH5_SHAMD50DIN 0x00050005
  405. #define UDMA_CH5_I2C2TX 0x00060005
  406. #define UDMA_CH5_RESERVED7 0x00070005
  407. #define UDMA_CH5_RESERVED8 0x00080005
  408. //
  409. // Channel 6
  410. //
  411. #define UDMA_CH6_RESERVED0 0x00000006
  412. #define UDMA_CH6_ETH0RX 0x00000006
  413. #define UDMA_CH6_TIMER2A 0x00010006
  414. #define UDMA_CH6_UART5RX 0x00020006
  415. #define UDMA_CH6_GPIOC 0x00030006
  416. #define UDMA_CH6_I2C0RX 0x00040006
  417. #define UDMA_CH6_SHAMD50COUT 0x00050006
  418. #define UDMA_CH6_RESERVED6 0x00060006
  419. #define UDMA_CH6_RESERVED7 0x00070006
  420. #define UDMA_CH6_RESERVED8 0x00080006
  421. //
  422. // Channel 7
  423. //
  424. #define UDMA_CH7_RESERVED0 0x00000007
  425. #define UDMA_CH7_ETH0TX 0x00000007
  426. #define UDMA_CH7_TIMER2B 0x00010007
  427. #define UDMA_CH7_UART5TX 0x00020007
  428. #define UDMA_CH7_GPIOD 0x00030007
  429. #define UDMA_CH7_I2C0TX 0x00040007
  430. #define UDMA_CH7_RESERVED5 0x00050007
  431. #define UDMA_CH7_RESERVED6 0x00060007
  432. #define UDMA_CH7_RESERVED7 0x00070007
  433. #define UDMA_CH7_RESERVED8 0x00080007
  434. //
  435. // Channel 8
  436. //
  437. #define UDMA_CH8_UART0RX 0x00000008
  438. #define UDMA_CH8_UART1RX 0x00010008
  439. #define UDMA_CH8_RESERVED2 0x00020008
  440. #define UDMA_CH8_TIMER5A 0x00030008
  441. #define UDMA_CH8_I2C1RX 0x00040008
  442. #define UDMA_CH8_RESERVED5 0x00050008
  443. #define UDMA_CH8_RESERVED6 0x00060008
  444. #define UDMA_CH8_RESERVED7 0x00070008
  445. #define UDMA_CH8_RESERVED8 0x00080008
  446. //
  447. // Channel 9
  448. //
  449. #define UDMA_CH9_UART0TX 0x00000009
  450. #define UDMA_CH9_UART1TX 0x00010009
  451. #define UDMA_CH9_RESERVED2 0x00020009
  452. #define UDMA_CH9_TIMER5B 0x00030009
  453. #define UDMA_CH9_I2C1TX 0x00040009
  454. #define UDMA_CH9_RESERVED5 0x00050009
  455. #define UDMA_CH9_RESERVED6 0x00060009
  456. #define UDMA_CH9_RESERVED7 0x00070009
  457. #define UDMA_CH9_RESERVED8 0x00080009
  458. //
  459. // Channel 10
  460. //
  461. #define UDMA_CH10_SSI0RX 0x0000000A
  462. #define UDMA_CH10_SSI1RX 0x0001000A
  463. #define UDMA_CH10_UART6RX 0x0002000A
  464. #define UDMA_CH10_WTIMER0A 0x0003000A
  465. #define UDMA_CH10_I2C2RX 0x0004000A
  466. #define UDMA_CH10_RESERVED5 0x0005000A
  467. #define UDMA_CH10_RESERVED6 0x0006000A
  468. #define UDMA_CH10_TIMER6A 0x0007000A
  469. #define UDMA_CH10_RESERVED8 0x0008000A
  470. //
  471. // Channel 11
  472. //
  473. #define UDMA_CH11_SSI0TX 0x0000000B
  474. #define UDMA_CH11_SSI1TX 0x0001000B
  475. #define UDMA_CH11_UART6TX 0x0002000B
  476. #define UDMA_CH11_WTIMER0B 0x0003000B
  477. #define UDMA_CH11_I2C2TX 0x0004000B
  478. #define UDMA_CH11_RESERVED5 0x0005000B
  479. #define UDMA_CH11_RESERVED6 0x0006000B
  480. #define UDMA_CH11_TIMER6B 0x0007000B
  481. #define UDMA_CH11_RESERVED8 0x0008000B
  482. //
  483. // Channel 12
  484. //
  485. #define UDMA_CH12_RESERVED0 0x0000000C
  486. #define UDMA_CH12_UART2RX 0x0001000C
  487. #define UDMA_CH12_SSI2RX 0x0002000C
  488. #define UDMA_CH12_WTIMER1A 0x0003000C
  489. #define UDMA_CH12_GPIOK 0x0004000C
  490. #define UDMA_CH12_AES0CIN 0x0005000C
  491. #define UDMA_CH12_RESERVED6 0x0006000C
  492. #define UDMA_CH12_TIMER7A 0x0007000C
  493. #define UDMA_CH12_RESERVED8 0x0008000C
  494. //
  495. // Channel 13
  496. //
  497. #define UDMA_CH13_RESERVED0 0x0000000D
  498. #define UDMA_CH13_UART2TX 0x0001000D
  499. #define UDMA_CH13_SSI2TX 0x0002000D
  500. #define UDMA_CH13_WTIMER1B 0x0003000D
  501. #define UDMA_CH13_GPIOL 0x0004000D
  502. #define UDMA_CH13_AES0COUT 0x0005000D
  503. #define UDMA_CH13_RESERVED6 0x0006000D
  504. #define UDMA_CH13_TIMER7B 0x0007000D
  505. #define UDMA_CH13_RESERVED8 0x0008000D
  506. //
  507. // Channel 14
  508. //
  509. #define UDMA_CH14_ADC0_0 0x0000000E
  510. #define UDMA_CH14_TIMER2A 0x0001000E
  511. #define UDMA_CH14_SSI3RX 0x0002000E
  512. #define UDMA_CH14_GPIOE 0x0003000E
  513. #define UDMA_CH14_GPIOM 0x0004000E
  514. #define UDMA_CH14_AES0DIN 0x0005000E
  515. #define UDMA_CH14_RESERVED6 0x0006000E
  516. #define UDMA_CH14_RESERVED7 0x0007000E
  517. #define UDMA_CH14_RESERVED8 0x0008000E
  518. //
  519. // Channel 15
  520. //
  521. #define UDMA_CH15_ADC0_1 0x0000000F
  522. #define UDMA_CH15_TIMER2B 0x0001000F
  523. #define UDMA_CH15_SSI3TX 0x0002000F
  524. #define UDMA_CH15_GPIOF 0x0003000F
  525. #define UDMA_CH15_GPION 0x0004000F
  526. #define UDMA_CH15_AES0DOUT 0x0005000F
  527. #define UDMA_CH15_RESERVED6 0x0006000F
  528. #define UDMA_CH15_RESERVED7 0x0007000F
  529. #define UDMA_CH15_RESERVED8 0x0008000F
  530. //
  531. // Channel 16
  532. //
  533. #define UDMA_CH16_ADC0_2 0x00000010
  534. #define UDMA_CH16_RESERVED1 0x00010010
  535. #define UDMA_CH16_UART3RX 0x00020010
  536. #define UDMA_CH16_WTIMER2A 0x00030010
  537. #define UDMA_CH16_GPIOP 0x00040010
  538. #define UDMA_CH16_RESERVED5 0x00050010
  539. #define UDMA_CH16_RESERVED6 0x00060010
  540. #define UDMA_CH16_RESERVED7 0x00070010
  541. #define UDMA_CH16_RESERVED8 0x00080010
  542. //
  543. // Channel 17
  544. //
  545. #define UDMA_CH17_ADC0_3 0x00000011
  546. #define UDMA_CH17_RESERVED1 0x00010011
  547. #define UDMA_CH17_UART3TX 0x00020011
  548. #define UDMA_CH17_WTIMER2B 0x00030011
  549. #define UDMA_CH17_RESERVED4 0x00040011
  550. #define UDMA_CH17_RESERVED5 0x00050011
  551. #define UDMA_CH17_RESERVED6 0x00060011
  552. #define UDMA_CH17_RESERVED7 0x00070011
  553. #define UDMA_CH17_RESERVED8 0x00080011
  554. //
  555. // Channel 18
  556. //
  557. #define UDMA_CH18_TIMER0A 0x00000012
  558. #define UDMA_CH18_TIMER1A 0x00010012
  559. #define UDMA_CH18_UART4RX 0x00020012
  560. #define UDMA_CH18_GPIOB 0x00030012
  561. #define UDMA_CH18_I2C3RX 0x00040012
  562. #define UDMA_CH18_RESERVED5 0x00050012
  563. #define UDMA_CH18_RESERVED6 0x00060012
  564. #define UDMA_CH18_RESERVED7 0x00070012
  565. #define UDMA_CH18_RESERVED8 0x00080012
  566. //
  567. // Channel 19
  568. //
  569. #define UDMA_CH19_TIMER0B 0x00000013
  570. #define UDMA_CH19_TIMER1B 0x00010013
  571. #define UDMA_CH19_UART4TX 0x00020013
  572. #define UDMA_CH19_GPIOG 0x00030013
  573. #define UDMA_CH19_I2C3TX 0x00040013
  574. #define UDMA_CH19_RESERVED5 0x00050013
  575. #define UDMA_CH19_RESERVED6 0x00060013
  576. #define UDMA_CH19_RESERVED7 0x00070013
  577. #define UDMA_CH19_RESERVED8 0x00080013
  578. //
  579. // Channel 20
  580. //
  581. #define UDMA_CH20_TIMER1A 0x00000014
  582. #define UDMA_CH20_RESERVED1 0x00010014
  583. #define UDMA_CH20_EPI0RX 0x00010014
  584. #define UDMA_CH20_UART7RX 0x00020014
  585. #define UDMA_CH20_GPIOH 0x00030014
  586. #define UDMA_CH20_I2C4RX 0x00040014
  587. #define UDMA_CH20_DES0CIN 0x00050014
  588. #define UDMA_CH20_RESERVED6 0x00060014
  589. #define UDMA_CH20_RESERVED7 0x00070014
  590. #define UDMA_CH20_RESERVED8 0x00080014
  591. //
  592. // Channel 21
  593. //
  594. #define UDMA_CH21_TIMER1B 0x00000015
  595. #define UDMA_CH21_RESERVED1 0x00010015
  596. #define UDMA_CH21_EPI0TX 0x00010015
  597. #define UDMA_CH21_UART7TX 0x00020015
  598. #define UDMA_CH21_GPIOJ 0x00030015
  599. #define UDMA_CH21_I2C4TX 0x00040015
  600. #define UDMA_CH21_DES0DIN 0x00050015
  601. #define UDMA_CH21_RESERVED6 0x00060015
  602. #define UDMA_CH21_RESERVED7 0x00070015
  603. #define UDMA_CH21_RESERVED8 0x00080015
  604. //
  605. // Channel 22
  606. //
  607. #define UDMA_CH22_UART1RX 0x00000016
  608. #define UDMA_CH22_RESERVED1 0x00010016
  609. #define UDMA_CH22_RESERVED2 0x00020016
  610. #define UDMA_CH22_LPC0_2 0x00030016
  611. #define UDMA_CH22_I2C5RX 0x00040016
  612. #define UDMA_CH22_DES0DOUT 0x00050016
  613. #define UDMA_CH22_RESERVED6 0x00060016
  614. #define UDMA_CH22_RESERVED7 0x00070016
  615. #define UDMA_CH22_I2C8RX 0x00080016
  616. //
  617. // Channel 23
  618. //
  619. #define UDMA_CH23_UART1TX 0x00000017
  620. #define UDMA_CH23_RESERVED1 0x00010017
  621. #define UDMA_CH23_RESERVED2 0x00020017
  622. #define UDMA_CH23_LPC0_1 0x00030017
  623. #define UDMA_CH23_I2C5TX 0x00040017
  624. #define UDMA_CH23_RESERVED5 0x00050017
  625. #define UDMA_CH23_RESERVED6 0x00060017
  626. #define UDMA_CH23_RESERVED7 0x00070017
  627. #define UDMA_CH23_I2C8TX 0x00080017
  628. //
  629. // Channel 24
  630. //
  631. #define UDMA_CH24_SSI1RX 0x00000018
  632. #define UDMA_CH24_ADC1_0 0x00010018
  633. #define UDMA_CH24_RESERVED2 0x00020018
  634. #define UDMA_CH24_WTIMER3A 0x00030018
  635. #define UDMA_CH24_GPIOQ 0x00040018
  636. #define UDMA_CH24_RESERVED5 0x00050018
  637. #define UDMA_CH24_RESERVED6 0x00060018
  638. #define UDMA_CH24_RESERVED7 0x00070018
  639. #define UDMA_CH24_I2C9RX 0x00080018
  640. //
  641. // Channel 25
  642. //
  643. #define UDMA_CH25_SSI1TX 0x00000019
  644. #define UDMA_CH25_ADC1_1 0x00010019
  645. #define UDMA_CH25_RESERVED2 0x00020019
  646. #define UDMA_CH25_WTIMER3B 0x00030019
  647. #define UDMA_CH25_RESERVED4 0x00040019
  648. #define UDMA_CH25_RESERVED5 0x00050019
  649. #define UDMA_CH25_RESERVED6 0x00060019
  650. #define UDMA_CH25_RESERVED7 0x00070019
  651. #define UDMA_CH25_I2C9TX 0x00080019
  652. //
  653. // Channel 26
  654. //
  655. #define UDMA_CH26_RESERVED0 0x0000001A
  656. #define UDMA_CH26_ADC1_2 0x0001001A
  657. #define UDMA_CH26_RESERVED2 0x0002001A
  658. #define UDMA_CH26_WTIMER4A 0x0003001A
  659. #define UDMA_CH26_RESERVED4 0x0004001A
  660. #define UDMA_CH26_RESERVED5 0x0005001A
  661. #define UDMA_CH26_RESERVED6 0x0006001A
  662. #define UDMA_CH26_RESERVED7 0x0007001A
  663. #define UDMA_CH26_I2C6RX 0x0008001A
  664. //
  665. // Channel 27
  666. //
  667. #define UDMA_CH27_RESERVED0 0x0000001B
  668. #define UDMA_CH27_ADC1_3 0x0001001B
  669. #define UDMA_CH27_RESERVED2 0x0002001B
  670. #define UDMA_CH27_WTIMER4B 0x0003001B
  671. #define UDMA_CH27_RESERVED4 0x0004001B
  672. #define UDMA_CH27_RESERVED5 0x0005001B
  673. #define UDMA_CH27_RESERVED6 0x0006001B
  674. #define UDMA_CH27_RESERVED7 0x0007001B
  675. #define UDMA_CH27_I2C6TX 0x0008001B
  676. //
  677. // Channel 28
  678. //
  679. #define UDMA_CH28_RESERVED0 0x0000001C
  680. #define UDMA_CH28_RESERVED1 0x0001001C
  681. #define UDMA_CH28_RESERVED2 0x0002001C
  682. #define UDMA_CH28_WTIMER5A 0x0003001C
  683. #define UDMA_CH28_RESERVED4 0x0004001C
  684. #define UDMA_CH28_RESERVED5 0x0005001C
  685. #define UDMA_CH28_RESERVED6 0x0006001C
  686. #define UDMA_CH28_RESERVED7 0x0007001C
  687. #define UDMA_CH28_I2C7RX 0x0008001C
  688. //
  689. // Channel 29
  690. //
  691. #define UDMA_CH29_RESERVED0 0x0000001D
  692. #define UDMA_CH29_RESERVED1 0x0001001D
  693. #define UDMA_CH29_RESERVED2 0x0002001D
  694. #define UDMA_CH29_WTIMER5B 0x0003001D
  695. #define UDMA_CH29_RESERVED4 0x0004001D
  696. #define UDMA_CH29_RESERVED5 0x0005001D
  697. #define UDMA_CH29_RESERVED6 0x0006001D
  698. #define UDMA_CH29_RESERVED7 0x0007001D
  699. #define UDMA_CH29_I2C7TX 0x0008001D
  700. //
  701. // Channel 30
  702. //
  703. #define UDMA_CH30_SW 0x0000001E
  704. #define UDMA_CH30_RESERVED1 0x0001001E
  705. #define UDMA_CH30_RESERVED2 0x0002001E
  706. #define UDMA_CH30_RESERVED3 0x0003001E
  707. #define UDMA_CH30_RESERVED4 0x0004001E
  708. #define UDMA_CH30_RESERVED5 0x0005001E
  709. #define UDMA_CH30_RESERVED6 0x0006001E
  710. #define UDMA_CH30_EPI0RX 0x0007001E
  711. #define UDMA_CH30_1WIRE0 0x0008001E
  712. //
  713. // Channel 31
  714. //
  715. #define UDMA_CH31_RESERVED0 0x0000001F
  716. #define UDMA_CH31_RESERVED1 0x0001001F
  717. #define UDMA_CH31_RESERVED2 0x0002001F
  718. #define UDMA_CH31_LPC0_0 0x0003001F
  719. #define UDMA_CH31_RESERVED4 0x0004001F
  720. #define UDMA_CH31_RESERVED5 0x0005001F
  721. #define UDMA_CH31_RESERVED6 0x0006001F
  722. #define UDMA_CH31_EPI0RX 0x0007001F
  723. #define UDMA_CH31_RESERVED8 0x0008001F
  724. //*****************************************************************************
  725. //
  726. // API Function prototypes
  727. //
  728. //*****************************************************************************
  729. extern void uDMAEnable(void);
  730. extern void uDMADisable(void);
  731. extern uint32_t uDMAErrorStatusGet(void);
  732. extern void uDMAErrorStatusClear(void);
  733. extern void uDMAChannelEnable(uint32_t ui32ChannelNum);
  734. extern void uDMAChannelDisable(uint32_t ui32ChannelNum);
  735. extern bool uDMAChannelIsEnabled(uint32_t ui32ChannelNum);
  736. extern void uDMAControlBaseSet(void *pControlTable);
  737. extern void *uDMAControlBaseGet(void);
  738. extern void *uDMAControlAlternateBaseGet(void);
  739. extern void uDMAChannelRequest(uint32_t ui32ChannelNum);
  740. extern void uDMAChannelAttributeEnable(uint32_t ui32ChannelNum,
  741. uint32_t ui32Attr);
  742. extern void uDMAChannelAttributeDisable(uint32_t ui32ChannelNum,
  743. uint32_t ui32Attr);
  744. extern uint32_t uDMAChannelAttributeGet(uint32_t ui32ChannelNum);
  745. extern void uDMAChannelControlSet(uint32_t ui32ChannelStructIndex,
  746. uint32_t ui32Control);
  747. extern void uDMAChannelTransferSet(uint32_t ui32ChannelStructIndex,
  748. uint32_t ui32Mode, void *pvSrcAddr,
  749. void *pvDstAddr, uint32_t ui32TransferSize);
  750. extern void uDMAChannelScatterGatherSet(uint32_t ui32ChannelNum,
  751. uint32_t ui32TaskCount,
  752. void *pvTaskList,
  753. uint32_t ui32IsPeriphSG);
  754. extern uint32_t uDMAChannelSizeGet(uint32_t ui32ChannelStructIndex);
  755. extern uint32_t uDMAChannelModeGet(uint32_t ui32ChannelStructIndex);
  756. extern void uDMAIntRegister(uint32_t ui32IntChannel, void (*pfnHandler)(void));
  757. extern void uDMAIntUnregister(uint32_t ui32IntChannel);
  758. extern uint32_t uDMAIntStatus(void);
  759. extern void uDMAIntClear(uint32_t ui32ChanMask);
  760. extern void uDMAChannelAssign(uint32_t ui32Mapping);
  761. //*****************************************************************************
  762. //
  763. // The following functions and definitions are deprecated and will be removed
  764. // from the API in the future. Use uDMAChannelAssign() instead to accomplish
  765. // the same end.
  766. //
  767. //*****************************************************************************
  768. #ifndef DEPRECATED
  769. //*****************************************************************************
  770. //
  771. // uDMA default/secondary peripheral selections, to be passed to
  772. // uDMAChannelSelectSecondary() and uDMAChannelSelectDefault().
  773. //
  774. //*****************************************************************************
  775. #define UDMA_DEF_USBEP1RX_SEC_UART2RX \
  776. 0x00000001
  777. #define UDMA_DEF_USBEP1TX_SEC_UART2TX \
  778. 0x00000002
  779. #define UDMA_DEF_USBEP2RX_SEC_TMR3A \
  780. 0x00000004
  781. #define UDMA_DEF_USBEP2TX_SEC_TMR3B \
  782. 0x00000008
  783. #define UDMA_DEF_USBEP3RX_SEC_TMR2A \
  784. 0x00000010
  785. #define UDMA_DEF_USBEP3TX_SEC_TMR2B \
  786. 0x00000020
  787. #define UDMA_DEF_ETH0RX_SEC_TMR2A \
  788. 0x00000040
  789. #define UDMA_DEF_ETH0TX_SEC_TMR2B \
  790. 0x00000080
  791. #define UDMA_DEF_UART0RX_SEC_UART1RX \
  792. 0x00000100
  793. #define UDMA_DEF_UART0TX_SEC_UART1TX \
  794. 0x00000200
  795. #define UDMA_DEF_SSI0RX_SEC_SSI1RX \
  796. 0x00000400
  797. #define UDMA_DEF_SSI0TX_SEC_SSI1TX \
  798. 0x00000800
  799. #define UDMA_DEF_RESERVED_SEC_UART2RX \
  800. 0x00001000
  801. #define UDMA_DEF_RESERVED_SEC_UART2TX \
  802. 0x00002000
  803. #define UDMA_DEF_ADC00_SEC_TMR2A \
  804. 0x00004000
  805. #define UDMA_DEF_ADC01_SEC_TMR2B \
  806. 0x00008000
  807. #define UDMA_DEF_ADC02_SEC_RESERVED \
  808. 0x00010000
  809. #define UDMA_DEF_ADC03_SEC_RESERVED \
  810. 0x00020000
  811. #define UDMA_DEF_TMR0A_SEC_TMR1A \
  812. 0x00040000
  813. #define UDMA_DEF_TMR0B_SEC_TMR1B \
  814. 0x00080000
  815. #define UDMA_DEF_TMR1A_SEC_EPI0RX \
  816. 0x00100000
  817. #define UDMA_DEF_TMR1B_SEC_EPI0TX \
  818. 0x00200000
  819. #define UDMA_DEF_UART1RX_SEC_RESERVED \
  820. 0x00400000
  821. #define UDMA_DEF_UART1TX_SEC_RESERVED \
  822. 0x00800000
  823. #define UDMA_DEF_SSI1RX_SEC_ADC10 \
  824. 0x01000000
  825. #define UDMA_DEF_SSI1TX_SEC_ADC11 \
  826. 0x02000000
  827. #define UDMA_DEF_RESERVED_SEC_ADC12 \
  828. 0x04000000
  829. #define UDMA_DEF_RESERVED_SEC_ADC13 \
  830. 0x08000000
  831. #define UDMA_DEF_I2S0RX_SEC_RESERVED \
  832. 0x10000000
  833. #define UDMA_DEF_I2S0TX_SEC_RESERVED \
  834. 0x20000000
  835. extern void uDMAChannelSelectDefault(uint32_t ui32DefPeriphs);
  836. extern void uDMAChannelSelectSecondary(uint32_t ui32SecPeriphs);
  837. #endif
  838. //*****************************************************************************
  839. //
  840. // Mark the end of the C bindings section for C++ compilers.
  841. //
  842. //*****************************************************************************
  843. #ifdef __cplusplus
  844. }
  845. #endif
  846. #endif // __DRIVERLIB_UDMA_H__