udma.h 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740
  1. //*****************************************************************************
  2. //
  3. // udma.h - Prototypes and macros for the uDMA controller.
  4. //
  5. // Copyright (c) 2007-2011 Texas Instruments Incorporated. All rights reserved.
  6. // Software License Agreement
  7. //
  8. // Texas Instruments (TI) is supplying this software for use solely and
  9. // exclusively on TI's microcontroller products. The software is owned by
  10. // TI and/or its suppliers, and is protected under applicable copyright
  11. // laws. You may not combine this software with "viral" open-source
  12. // software in order to form a larger program.
  13. //
  14. // THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
  15. // NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
  16. // NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  17. // A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
  18. // CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
  19. // DAMAGES, FOR ANY REASON WHATSOEVER.
  20. //
  21. // This is part of revision 8264 of the Stellaris Peripheral Driver Library.
  22. //
  23. //*****************************************************************************
  24. #ifndef __UDMA_H__
  25. #define __UDMA_H__
  26. //*****************************************************************************
  27. //
  28. // If building with a C++ compiler, make all of the definitions in this header
  29. // have a C binding.
  30. //
  31. //*****************************************************************************
  32. #ifdef __cplusplus
  33. extern "C"
  34. {
  35. #endif
  36. //*****************************************************************************
  37. //
  38. //! \addtogroup udma_api
  39. //! @{
  40. //
  41. //*****************************************************************************
  42. //*****************************************************************************
  43. //
  44. // A structure that defines an entry in the channel control table. These
  45. // fields are used by the uDMA controller and normally it is not necessary for
  46. // software to directly read or write fields in the table.
  47. //
  48. //*****************************************************************************
  49. typedef struct
  50. {
  51. //
  52. // The ending source address of the data transfer.
  53. //
  54. volatile void *pvSrcEndAddr;
  55. //
  56. // The ending destination address of the data transfer.
  57. //
  58. volatile void *pvDstEndAddr;
  59. //
  60. // The channel control mode.
  61. //
  62. volatile unsigned long ulControl;
  63. //
  64. // An unused location.
  65. //
  66. volatile unsigned long ulSpare;
  67. }
  68. tDMAControlTable;
  69. //*****************************************************************************
  70. //
  71. //! A helper macro for building scatter-gather task table entries.
  72. //!
  73. //! \param ulTransferCount is the count of items to transfer for this task.
  74. //! \param ulItemSize is the bit size of the items to transfer for this task.
  75. //! \param ulSrcIncrement is the bit size increment for source data.
  76. //! \param pvSrcAddr is the starting address of the data to transfer.
  77. //! \param ulDstIncrement is the bit size increment for destination data.
  78. //! \param pvDstAddr is the starting address of the destination data.
  79. //! \param ulArbSize is the arbitration size to use for the transfer task.
  80. //! \param ulMode is the transfer mode for this task.
  81. //!
  82. //! This macro is intended to be used to help populate a table of uDMA tasks
  83. //! for a scatter-gather transfer. This macro will calculate the values for
  84. //! the fields of a task structure entry based on the input parameters.
  85. //!
  86. //! There are specific requirements for the values of each parameter. No
  87. //! checking is done so it is up to the caller to ensure that correct values
  88. //! are used for the parameters.
  89. //!
  90. //! The \e ulTransferCount parameter is the number of items that will be
  91. //! transferred by this task. It must be in the range 1-1024.
  92. //!
  93. //! The \e ulItemSize parameter is the bit size of the transfer data. It must
  94. //! be one of \b UDMA_SIZE_8, \b UDMA_SIZE_16, or \b UDMA_SIZE_32.
  95. //!
  96. //! The \e ulSrcIncrement parameter is the increment size for the source data.
  97. //! It must be one of \b UDMA_SRC_INC_8, \b UDMA_SRC_INC_16,
  98. //! \b UDMA_SRC_INC_32, or \b UDMA_SRC_INC_NONE.
  99. //!
  100. //! The \e pvSrcAddr parameter is a void pointer to the beginning of the source
  101. //! data.
  102. //!
  103. //! The \e ulDstIncrement parameter is the increment size for the destination
  104. //! data. It must be one of \b UDMA_DST_INC_8, \b UDMA_DST_INC_16,
  105. //! \b UDMA_DST_INC_32, or \b UDMA_DST_INC_NONE.
  106. //!
  107. //! The \e pvDstAddr parameter is a void pointer to the beginning of the
  108. //! location where the data will be transferred.
  109. //!
  110. //! The \e ulArbSize parameter is the arbitration size for the transfer, and
  111. //! must be one of \b UDMA_ARB_1, \b UDMA_ARB_2, \b UDMA_ARB_4, and so on
  112. //! up to \b UDMA_ARB_1024. This is used to select the arbitration size in
  113. //! powers of 2, from 1 to 1024.
  114. //!
  115. //! The \e ulMode parameter is the mode to use for this transfer task. It
  116. //! must be one of \b UDMA_MODE_BASIC, \b UDMA_MODE_AUTO,
  117. //! \b UDMA_MODE_MEM_SCATTER_GATHER, or \b UDMA_MODE_PER_SCATTER_GATHER. Note
  118. //! that normally all tasks will be one of the scatter-gather modes while the
  119. //! last task is a task list will be AUTO or BASIC.
  120. //!
  121. //! This macro is intended to be used to initialize individual entries of
  122. //! a structure of tDMAControlTable type, like this:
  123. //!
  124. //! \verbatim
  125. //! tDMAControlTable MyTaskList[] =
  126. //! {
  127. //! uDMATaskStructEntry(Task1Count, UDMA_SIZE_8,
  128. //! UDMA_SRC_INC_8, MySourceBuf,
  129. //! UDMA_DST_INC_8, MyDestBuf,
  130. //! UDMA_ARB_8, UDMA_MODE_MEM_SCATTER_GATHER),
  131. //! uDMATaskStructEntry(Task2Count, ... ),
  132. //! }
  133. //! \endverbatim
  134. //!
  135. //! \return Nothing; this is not a function.
  136. //
  137. //*****************************************************************************
  138. #define uDMATaskStructEntry(ulTransferCount, \
  139. ulItemSize, \
  140. ulSrcIncrement, \
  141. pvSrcAddr, \
  142. ulDstIncrement, \
  143. pvDstAddr, \
  144. ulArbSize, \
  145. ulMode) \
  146. { \
  147. (((ulSrcIncrement) == UDMA_SRC_INC_NONE) ? (void *)(pvSrcAddr) : \
  148. ((void *)(&((unsigned char *)(pvSrcAddr))[((ulTransferCount) << \
  149. ((ulSrcIncrement) >> 26)) - 1]))), \
  150. (((ulDstIncrement) == UDMA_DST_INC_NONE) ? (void *)(pvDstAddr) : \
  151. ((void *)(&((unsigned char *)(pvDstAddr))[((ulTransferCount) << \
  152. ((ulDstIncrement) >> 30)) - 1]))), \
  153. (ulSrcIncrement) | (ulDstIncrement) | (ulItemSize) | (ulArbSize) | \
  154. (((ulTransferCount) - 1) << 4) | \
  155. ((((ulMode) == UDMA_MODE_MEM_SCATTER_GATHER) || \
  156. ((ulMode) == UDMA_MODE_PER_SCATTER_GATHER)) ? \
  157. (ulMode) | UDMA_MODE_ALT_SELECT : (ulMode)), 0 \
  158. }
  159. //*****************************************************************************
  160. //
  161. // Close the Doxygen group.
  162. //! @}
  163. //
  164. //*****************************************************************************
  165. //*****************************************************************************
  166. //
  167. // Flags that can be passed to uDMAChannelAttributeEnable(),
  168. // uDMAChannelAttributeDisable(), and returned from uDMAChannelAttributeGet().
  169. //
  170. //*****************************************************************************
  171. #define UDMA_ATTR_USEBURST 0x00000001
  172. #define UDMA_ATTR_ALTSELECT 0x00000002
  173. #define UDMA_ATTR_HIGH_PRIORITY 0x00000004
  174. #define UDMA_ATTR_REQMASK 0x00000008
  175. #define UDMA_ATTR_ALL 0x0000000F
  176. //*****************************************************************************
  177. //
  178. // DMA control modes that can be passed to uDMAModeSet() and returned
  179. // uDMAModeGet().
  180. //
  181. //*****************************************************************************
  182. #define UDMA_MODE_STOP 0x00000000
  183. #define UDMA_MODE_BASIC 0x00000001
  184. #define UDMA_MODE_AUTO 0x00000002
  185. #define UDMA_MODE_PINGPONG 0x00000003
  186. #define UDMA_MODE_MEM_SCATTER_GATHER \
  187. 0x00000004
  188. #define UDMA_MODE_PER_SCATTER_GATHER \
  189. 0x00000006
  190. #define UDMA_MODE_ALT_SELECT 0x00000001
  191. //*****************************************************************************
  192. //
  193. // Channel configuration values that can be passed to uDMAControlSet().
  194. //
  195. //*****************************************************************************
  196. #define UDMA_DST_INC_8 0x00000000
  197. #define UDMA_DST_INC_16 0x40000000
  198. #define UDMA_DST_INC_32 0x80000000
  199. #define UDMA_DST_INC_NONE 0xc0000000
  200. #define UDMA_SRC_INC_8 0x00000000
  201. #define UDMA_SRC_INC_16 0x04000000
  202. #define UDMA_SRC_INC_32 0x08000000
  203. #define UDMA_SRC_INC_NONE 0x0c000000
  204. #define UDMA_SIZE_8 0x00000000
  205. #define UDMA_SIZE_16 0x11000000
  206. #define UDMA_SIZE_32 0x22000000
  207. #define UDMA_ARB_1 0x00000000
  208. #define UDMA_ARB_2 0x00004000
  209. #define UDMA_ARB_4 0x00008000
  210. #define UDMA_ARB_8 0x0000c000
  211. #define UDMA_ARB_16 0x00010000
  212. #define UDMA_ARB_32 0x00014000
  213. #define UDMA_ARB_64 0x00018000
  214. #define UDMA_ARB_128 0x0001c000
  215. #define UDMA_ARB_256 0x00020000
  216. #define UDMA_ARB_512 0x00024000
  217. #define UDMA_ARB_1024 0x00028000
  218. #define UDMA_NEXT_USEBURST 0x00000008
  219. //*****************************************************************************
  220. //
  221. // Channel numbers to be passed to API functions that require a channel number
  222. // ID.
  223. //
  224. //*****************************************************************************
  225. #define UDMA_CHANNEL_USBEP1RX 0
  226. #define UDMA_CHANNEL_USBEP1TX 1
  227. #define UDMA_CHANNEL_USBEP2RX 2
  228. #define UDMA_CHANNEL_USBEP2TX 3
  229. #define UDMA_CHANNEL_USBEP3RX 4
  230. #define UDMA_CHANNEL_USBEP3TX 5
  231. #define UDMA_CHANNEL_ETH0RX 6
  232. #define UDMA_CHANNEL_ETH0TX 7
  233. #define UDMA_CHANNEL_UART0RX 8
  234. #define UDMA_CHANNEL_UART0TX 9
  235. #define UDMA_CHANNEL_SSI0RX 10
  236. #define UDMA_CHANNEL_SSI0TX 11
  237. #define UDMA_CHANNEL_ADC0 14
  238. #define UDMA_CHANNEL_ADC1 15
  239. #define UDMA_CHANNEL_ADC2 16
  240. #define UDMA_CHANNEL_ADC3 17
  241. #define UDMA_CHANNEL_TMR0A 18
  242. #define UDMA_CHANNEL_TMR0B 19
  243. #define UDMA_CHANNEL_TMR1A 20
  244. #define UDMA_CHANNEL_TMR1B 21
  245. #define UDMA_CHANNEL_UART1RX 22
  246. #define UDMA_CHANNEL_UART1TX 23
  247. #define UDMA_CHANNEL_SSI1RX 24
  248. #define UDMA_CHANNEL_SSI1TX 25
  249. #define UDMA_CHANNEL_I2S0RX 28
  250. #define UDMA_CHANNEL_I2S0TX 29
  251. #define UDMA_CHANNEL_SW 30
  252. //*****************************************************************************
  253. //
  254. // Flags to be OR'd with the channel ID to indicate if the primary or alternate
  255. // control structure should be used.
  256. //
  257. //*****************************************************************************
  258. #define UDMA_PRI_SELECT 0x00000000
  259. #define UDMA_ALT_SELECT 0x00000020
  260. //*****************************************************************************
  261. //
  262. // uDMA interrupt sources, to be passed to uDMAIntRegister() and
  263. // uDMAIntUnregister().
  264. //
  265. //*****************************************************************************
  266. #define UDMA_INT_SW 62
  267. #define UDMA_INT_ERR 63
  268. //*****************************************************************************
  269. //
  270. // Channel numbers to be passed to API functions that require a channel number
  271. // ID. These are for secondary peripheral assignments.
  272. //
  273. //*****************************************************************************
  274. #define UDMA_SEC_CHANNEL_UART2RX_0 \
  275. 0
  276. #define UDMA_SEC_CHANNEL_UART2TX_1 \
  277. 1
  278. #define UDMA_SEC_CHANNEL_TMR3A 2
  279. #define UDMA_SEC_CHANNEL_TMR3B 3
  280. #define UDMA_SEC_CHANNEL_TMR2A_4 \
  281. 4
  282. #define UDMA_SEC_CHANNEL_TMR2B_5 \
  283. 5
  284. #define UDMA_SEC_CHANNEL_TMR2A_6 \
  285. 6
  286. #define UDMA_SEC_CHANNEL_TMR2B_7 \
  287. 7
  288. #define UDMA_SEC_CHANNEL_UART1RX \
  289. 8
  290. #define UDMA_SEC_CHANNEL_UART1TX \
  291. 9
  292. #define UDMA_SEC_CHANNEL_SSI1RX 10
  293. #define UDMA_SEC_CHANNEL_SSI1TX 11
  294. #define UDMA_SEC_CHANNEL_UART2RX_12 \
  295. 12
  296. #define UDMA_SEC_CHANNEL_UART2TX_13 \
  297. 13
  298. #define UDMA_SEC_CHANNEL_TMR2A_14 \
  299. 14
  300. #define UDMA_SEC_CHANNEL_TMR2B_15 \
  301. 15
  302. #define UDMA_SEC_CHANNEL_TMR1A 18
  303. #define UDMA_SEC_CHANNEL_TMR1B 19
  304. #define UDMA_SEC_CHANNEL_EPI0RX 20
  305. #define UDMA_SEC_CHANNEL_EPI0TX 21
  306. #define UDMA_SEC_CHANNEL_ADC10 24
  307. #define UDMA_SEC_CHANNEL_ADC11 25
  308. #define UDMA_SEC_CHANNEL_ADC12 26
  309. #define UDMA_SEC_CHANNEL_ADC13 27
  310. #define UDMA_SEC_CHANNEL_SW 30
  311. //*****************************************************************************
  312. //
  313. // uDMA default/secondary peripheral selections, to be passed to
  314. // uDMAChannelSelectSecondary() and uDMAChannelSelectDefault().
  315. //
  316. //*****************************************************************************
  317. #define UDMA_DEF_USBEP1RX_SEC_UART2RX \
  318. 0x00000001
  319. #define UDMA_DEF_USBEP1TX_SEC_UART2TX \
  320. 0x00000002
  321. #define UDMA_DEF_USBEP2RX_SEC_TMR3A \
  322. 0x00000004
  323. #define UDMA_DEF_USBEP2TX_SEC_TMR3B \
  324. 0x00000008
  325. #define UDMA_DEF_USBEP3RX_SEC_TMR2A \
  326. 0x00000010
  327. #define UDMA_DEF_USBEP3TX_SEC_TMR2B \
  328. 0x00000020
  329. #define UDMA_DEF_ETH0RX_SEC_TMR2A \
  330. 0x00000040
  331. #define UDMA_DEF_ETH0TX_SEC_TMR2B \
  332. 0x00000080
  333. #define UDMA_DEF_UART0RX_SEC_UART1RX \
  334. 0x00000100
  335. #define UDMA_DEF_UART0TX_SEC_UART1TX \
  336. 0x00000200
  337. #define UDMA_DEF_SSI0RX_SEC_SSI1RX \
  338. 0x00000400
  339. #define UDMA_DEF_SSI0TX_SEC_SSI1TX \
  340. 0x00000800
  341. #define UDMA_DEF_RESERVED_SEC_UART2RX \
  342. 0x00001000
  343. #define UDMA_DEF_RESERVED_SEC_UART2TX \
  344. 0x00002000
  345. #define UDMA_DEF_ADC00_SEC_TMR2A \
  346. 0x00004000
  347. #define UDMA_DEF_ADC01_SEC_TMR2B \
  348. 0x00008000
  349. #define UDMA_DEF_ADC02_SEC_RESERVED \
  350. 0x00010000
  351. #define UDMA_DEF_ADC03_SEC_RESERVED \
  352. 0x00020000
  353. #define UDMA_DEF_TMR0A_SEC_TMR1A \
  354. 0x00040000
  355. #define UDMA_DEF_TMR0B_SEC_TMR1B \
  356. 0x00080000
  357. #define UDMA_DEF_TMR1A_SEC_EPI0RX \
  358. 0x00100000
  359. #define UDMA_DEF_TMR1B_SEC_EPI0TX \
  360. 0x00200000
  361. #define UDMA_DEF_UART1RX_SEC_RESERVED \
  362. 0x00400000
  363. #define UDMA_DEF_UART1TX_SEC_RESERVED \
  364. 0x00800000
  365. #define UDMA_DEF_SSI1RX_SEC_ADC10 \
  366. 0x01000000
  367. #define UDMA_DEF_SSI1TX_SEC_ADC11 \
  368. 0x02000000
  369. #define UDMA_DEF_RESERVED_SEC_ADC12 \
  370. 0x04000000
  371. #define UDMA_DEF_RESERVED_SEC_ADC13 \
  372. 0x08000000
  373. #define UDMA_DEF_I2S0RX_SEC_RESERVED \
  374. 0x10000000
  375. #define UDMA_DEF_I2S0TX_SEC_RESERVED \
  376. 0x20000000
  377. //*****************************************************************************
  378. //
  379. // Values that can be passed to uDMAChannelMapConfigure() to select peripheral
  380. // mapping for each channel. The channels named RESERVED may be assigned
  381. // to a peripheral in future parts.
  382. //
  383. //*****************************************************************************
  384. //
  385. // Channel 0
  386. //
  387. #define UDMA_CH0_USB0EP1RX 0x00000000
  388. #define UDMA_CH0_UART2RX 0x00010000
  389. #define UDMA_CH0_RESERVED2 0x00020000
  390. #define UDMA_CH0_TIMER4A 0x00030000
  391. #define UDMA_CH0_RESERVED4 0x00040000
  392. //
  393. // Channel 1
  394. //
  395. #define UDMA_CH1_USB0EP1TX 0x00000001
  396. #define UDMA_CH1_UART2TX 0x00010001
  397. #define UDMA_CH1_RESERVED2 0x00020001
  398. #define UDMA_CH1_TIMER4B 0x00030001
  399. #define UDMA_CH1_RESERVED4 0x00040001
  400. //
  401. // Channel 2
  402. //
  403. #define UDMA_CH2_USB0EP2RX 0x00000002
  404. #define UDMA_CH2_TIMER3A 0x00010002
  405. #define UDMA_CH2_RESERVED2 0x00020002
  406. #define UDMA_CH2_RESERVED3 0x00030002
  407. #define UDMA_CH2_RESERVED4 0x00040002
  408. //
  409. // Channel 3
  410. //
  411. #define UDMA_CH3_USB0EP2TX 0x00000003
  412. #define UDMA_CH3_TIMER3B 0x00010003
  413. #define UDMA_CH3_RESERVED2 0x00020003
  414. #define UDMA_CH3_LPC0_3 0x00030003
  415. #define UDMA_CH3_RESERVED4 0x00040003
  416. //
  417. // Channel 4
  418. //
  419. #define UDMA_CH4_USB0EP3RX 0x00000004
  420. #define UDMA_CH4_TIMER2A 0x00010004
  421. #define UDMA_CH4_RESERVED2 0x00020004
  422. #define UDMA_CH4_GPIOA 0x00030004
  423. #define UDMA_CH4_RESERVED4 0x00040004
  424. //
  425. // Channel 5
  426. //
  427. #define UDMA_CH5_USB0EP3TX 0x00000005
  428. #define UDMA_CH5_TIMER2B 0x00010005
  429. #define UDMA_CH5_RESERVED2 0x00020005
  430. #define UDMA_CH5_GPIOB 0x00030005
  431. #define UDMA_CH5_RESERVED4 0x00040005
  432. //
  433. // Channel 6
  434. //
  435. #define UDMA_CH6_RESERVED0 0x00000006
  436. #define UDMA_CH6_TIMER2A 0x00010006
  437. #define UDMA_CH6_UART5RX 0x00020006
  438. #define UDMA_CH6_GPIOC 0x00030006
  439. #define UDMA_CH6_I2C0RX 0x00040006
  440. //
  441. // Channel 7
  442. //
  443. #define UDMA_CH7_RESERVED0 0x00000007
  444. #define UDMA_CH7_TIMER2B 0x00010007
  445. #define UDMA_CH7_UART5TX 0x00020007
  446. #define UDMA_CH7_GPIOD 0x00030007
  447. #define UDMA_CH7_I2C0TX 0x00040007
  448. //
  449. // Channel 8
  450. //
  451. #define UDMA_CH8_UART0RX 0x00000008
  452. #define UDMA_CH8_UART1RX 0x00010008
  453. #define UDMA_CH8_RESERVED2 0x00020008
  454. #define UDMA_CH8_TIMER5A 0x00030008
  455. #define UDMA_CH8_I2C1RX 0x00040008
  456. //
  457. // Channel 9
  458. //
  459. #define UDMA_CH9_UART0TX 0x00000009
  460. #define UDMA_CH9_UART1TX 0x00010009
  461. #define UDMA_CH9_RESERVED2 0x00020009
  462. #define UDMA_CH9_TIMER5B 0x00030009
  463. #define UDMA_CH9_I2C1TX 0x00040009
  464. //
  465. // Channel 10
  466. //
  467. #define UDMA_CH10_SSI0RX 0x0000000A
  468. #define UDMA_CH10_SSI1RX 0x0001000A
  469. #define UDMA_CH10_UART6RX 0x0002000A
  470. #define UDMA_CH10_WTIMER0A 0x0003000A
  471. #define UDMA_CH10_I2C2RX 0x0004000A
  472. //
  473. // Channel 11
  474. //
  475. #define UDMA_CH11_SSI0TX 0x0000000B
  476. #define UDMA_CH11_SSI1TX 0x0001000B
  477. #define UDMA_CH11_UART6TX 0x0002000B
  478. #define UDMA_CH11_WTIMER0B 0x0003000B
  479. #define UDMA_CH11_I2C2TX 0x0004000B
  480. //
  481. // Channel 12
  482. //
  483. #define UDMA_CH12_RESERVED0 0x0000000C
  484. #define UDMA_CH12_UART2RX 0x0001000C
  485. #define UDMA_CH12_SSI2RX 0x0002000C
  486. #define UDMA_CH12_WTIMER1A 0x0003000C
  487. #define UDMA_CH12_GPIOK 0x0004000C
  488. //
  489. // Channel 13
  490. //
  491. #define UDMA_CH13_RESERVED0 0x0000000D
  492. #define UDMA_CH13_UART2TX 0x0001000D
  493. #define UDMA_CH13_SSI2TX 0x0002000D
  494. #define UDMA_CH13_WTIMER1B 0x0003000D
  495. #define UDMA_CH13_GPIOL 0x0004000D
  496. //
  497. // Channel 14
  498. //
  499. #define UDMA_CH14_ADC0_0 0x0000000E
  500. #define UDMA_CH14_TIMER2A 0x0001000E
  501. #define UDMA_CH14_SSI3RX 0x0002000E
  502. #define UDMA_CH14_GPIOE 0x0003000E
  503. #define UDMA_CH14_GPIOM 0x0004000E
  504. //
  505. // Channel 15
  506. //
  507. #define UDMA_CH15_ADC0_1 0x0000000F
  508. #define UDMA_CH15_TIMER2B 0x0001000F
  509. #define UDMA_CH15_SSI3TX 0x0002000F
  510. #define UDMA_CH15_GPIOF 0x0003000F
  511. #define UDMA_CH15_GPION 0x0004000F
  512. //
  513. // Channel 16
  514. //
  515. #define UDMA_CH16_ADC0_2 0x00000010
  516. #define UDMA_CH16_RESERVED1 0x00010010
  517. #define UDMA_CH16_UART3RX 0x00020010
  518. #define UDMA_CH16_WTIMER2A 0x00030010
  519. #define UDMA_CH16_GPIOP 0x00040010
  520. //
  521. // Channel 17
  522. //
  523. #define UDMA_CH17_ADC0_3 0x00000011
  524. #define UDMA_CH17_RESERVED1 0x00010011
  525. #define UDMA_CH17_UART3TX 0x00020011
  526. #define UDMA_CH17_WTIMER2B 0x00030011
  527. #define UDMA_CH17_RESERVED4 0x00040011
  528. //
  529. // Channel 18
  530. //
  531. #define UDMA_CH18_TIMER0A 0x00000012
  532. #define UDMA_CH18_TIMER1A 0x00010012
  533. #define UDMA_CH18_UART4RX 0x00020012
  534. #define UDMA_CH18_GPIOB 0x00030012
  535. #define UDMA_CH18_I2C3RX 0x00040012
  536. //
  537. // Channel 19
  538. //
  539. #define UDMA_CH19_TIMER0B 0x00000013
  540. #define UDMA_CH19_TIMER1B 0x00010013
  541. #define UDMA_CH19_UART4TX 0x00020013
  542. #define UDMA_CH19_GPIOG 0x00030013
  543. #define UDMA_CH19_I2C3TX 0x00040013
  544. //
  545. // Channel 20
  546. //
  547. #define UDMA_CH20_TIMER1A 0x00000014
  548. #define UDMA_CH20_RESERVED1 0x00010014
  549. #define UDMA_CH20_UART7RX 0x00020014
  550. #define UDMA_CH20_GPIOH 0x00030014
  551. #define UDMA_CH20_I2C4RX 0x00040014
  552. //
  553. // Channel 21
  554. //
  555. #define UDMA_CH21_TIMER1B 0x00000015
  556. #define UDMA_CH21_RESERVED1 0x00010015
  557. #define UDMA_CH21_UART7TX 0x00020015
  558. #define UDMA_CH21_GPIOJ 0x00030015
  559. #define UDMA_CH21_I2C4TX 0x00040015
  560. //
  561. // Channel 22
  562. //
  563. #define UDMA_CH22_UART1RX 0x00000016
  564. #define UDMA_CH22_RESERVED1 0x00010016
  565. #define UDMA_CH22_RESERVED2 0x00020016
  566. #define UDMA_CH22_LPC0_2 0x00030016
  567. #define UDMA_CH22_I2C5RX 0x00040016
  568. //
  569. // Channel 23
  570. //
  571. #define UDMA_CH23_UART1TX 0x00000017
  572. #define UDMA_CH23_RESERVED1 0x00010017
  573. #define UDMA_CH23_RESERVED2 0x00020017
  574. #define UDMA_CH23_LPC0_1 0x00030017
  575. #define UDMA_CH23_I2C5TX 0x00040017
  576. //
  577. // Channel 24
  578. //
  579. #define UDMA_CH24_SSI1RX 0x00000018
  580. #define UDMA_CH24_ADC1_0 0x00010018
  581. #define UDMA_CH24_RESERVED2 0x00020018
  582. #define UDMA_CH24_WTIMER3A 0x00030018
  583. #define UDMA_CH24_GPIOQ 0x00040018
  584. //
  585. // Channel 25
  586. //
  587. #define UDMA_CH25_SSI1TX 0x00000019
  588. #define UDMA_CH25_ADC1_1 0x00010019
  589. #define UDMA_CH25_RESERVED2 0x00020019
  590. #define UDMA_CH25_WTIMER3B 0x00030019
  591. #define UDMA_CH25_RESERVED4 0x00040019
  592. //
  593. // Channel 26
  594. //
  595. #define UDMA_CH26_RESERVED0 0x0000001A
  596. #define UDMA_CH26_ADC1_2 0x0001001A
  597. #define UDMA_CH26_RESERVED2 0x0002001A
  598. #define UDMA_CH26_WTIMER4A 0x0003001A
  599. #define UDMA_CH26_RESERVED4 0x0004001A
  600. //
  601. // Channel 27
  602. //
  603. #define UDMA_CH27_RESERVED0 0x0000001B
  604. #define UDMA_CH27_ADC1_3 0x0001001B
  605. #define UDMA_CH27_RESERVED2 0x0002001B
  606. #define UDMA_CH27_WTIMER4B 0x0003001B
  607. #define UDMA_CH27_RESERVED4 0x0004001B
  608. //
  609. // Channel 28
  610. //
  611. #define UDMA_CH28_RESERVED0 0x0000001C
  612. #define UDMA_CH28_RESERVED1 0x0001001C
  613. #define UDMA_CH28_RESERVED2 0x0002001C
  614. #define UDMA_CH28_WTIMER5A 0x0003001C
  615. #define UDMA_CH28_RESERVED4 0x0004001C
  616. //
  617. // Channel 29
  618. //
  619. #define UDMA_CH29_RESERVED0 0x0000001D
  620. #define UDMA_CH29_RESERVED1 0x0001001D
  621. #define UDMA_CH29_RESERVED2 0x0002001D
  622. #define UDMA_CH29_WTIMER5B 0x0003001D
  623. #define UDMA_CH29_RESERVED4 0x0004001D
  624. //
  625. // Channel 30
  626. //
  627. #define UDMA_CH30_SW 0x0000001E
  628. #define UDMA_CH30_RESERVED1 0x0001001E
  629. #define UDMA_CH30_RESERVED2 0x0002001E
  630. #define UDMA_CH30_RESERVED3 0x0003001E
  631. #define UDMA_CH30_RESERVED4 0x0004001E
  632. //
  633. // Channel 31
  634. //
  635. #define UDMA_CH31_RESERVED0 0x0000001F
  636. #define UDMA_CH31_RESERVED1 0x0001001F
  637. #define UDMA_CH31_RESERVED2 0x0002001F
  638. #define UDMA_CH31_LPC0_0 0x0003001F
  639. #define UDMA_CH31_RESERVED4 0x0004001F
  640. //*****************************************************************************
  641. //
  642. // API Function prototypes
  643. //
  644. //*****************************************************************************
  645. extern void uDMAEnable(void);
  646. extern void uDMADisable(void);
  647. extern unsigned long uDMAErrorStatusGet(void);
  648. extern void uDMAErrorStatusClear(void);
  649. extern void uDMAChannelEnable(unsigned long ulChannelNum);
  650. extern void uDMAChannelDisable(unsigned long ulChannelNum);
  651. extern tBoolean uDMAChannelIsEnabled(unsigned long ulChannelNum);
  652. extern void uDMAControlBaseSet(void *pControlTable);
  653. extern void *uDMAControlBaseGet(void);
  654. extern void *uDMAControlAlternateBaseGet(void);
  655. extern void uDMAChannelRequest(unsigned long ulChannelNum);
  656. extern void uDMAChannelAttributeEnable(unsigned long ulChannelNum,
  657. unsigned long ulAttr);
  658. extern void uDMAChannelAttributeDisable(unsigned long ulChannelNum,
  659. unsigned long ulAttr);
  660. extern unsigned long uDMAChannelAttributeGet(unsigned long ulChannelNum);
  661. extern void uDMAChannelControlSet(unsigned long ulChannelStructIndex,
  662. unsigned long ulControl);
  663. extern void uDMAChannelTransferSet(unsigned long ulChannelStructIndex,
  664. unsigned long ulMode, void *pvSrcAddr,
  665. void *pvDstAddr,
  666. unsigned long ulTransferSize);
  667. extern void uDMAChannelScatterGatherSet(unsigned long ulChannelNum,
  668. unsigned ulTaskCount, void *pvTaskList,
  669. unsigned long ulIsPeriphSG);
  670. extern unsigned long uDMAChannelSizeGet(unsigned long ulChannelStructIndex);
  671. extern unsigned long uDMAChannelModeGet(unsigned long ulChannelStructIndex);
  672. extern void uDMAIntRegister(unsigned long ulIntChannel,
  673. void (*pfnHandler)(void));
  674. extern void uDMAIntUnregister(unsigned long ulIntChannel);
  675. extern void uDMAChannelSelectDefault(unsigned long ulDefPeriphs);
  676. extern void uDMAChannelSelectSecondary(unsigned long ulSecPeriphs);
  677. extern unsigned long uDMAIntStatus(void);
  678. extern void uDMAIntClear(unsigned long ulChanMask);
  679. extern void uDMAChannelAssign(unsigned long ulMapping);
  680. //*****************************************************************************
  681. //
  682. // Mark the end of the C bindings section for C++ compilers.
  683. //
  684. //*****************************************************************************
  685. #ifdef __cplusplus
  686. }
  687. #endif
  688. #endif // __UDMA_H__