hw_udmachctl.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. /******************************************************************************
  2. * Filename: hw_udmachctl.h
  3. * Revised: $Date: 2013-04-12 15:10:54 +0200 (Fri, 12 Apr 2013) $
  4. * Revision: $Revision: 9735 $
  5. *
  6. * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
  7. *
  8. *
  9. * Redistribution and use in source and binary forms, with or without
  10. * modification, are permitted provided that the following conditions
  11. * are met:
  12. *
  13. * Redistributions of source code must retain the above copyright
  14. * notice, this list of conditions and the following disclaimer.
  15. *
  16. * Redistributions in binary form must reproduce the above copyright
  17. * notice, this list of conditions and the following disclaimer in the
  18. * documentation and/or other materials provided with the 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. ******************************************************************************/
  37. #ifndef __HW_UDMACHCTL_H__
  38. #define __HW_UDMACHCTL_H__
  39. //*****************************************************************************
  40. //
  41. // The following are defines for the UDMACHCTL register offsets.
  42. //
  43. //*****************************************************************************
  44. #define UDMACHCTL_O_SRCENDP 0x00000000
  45. #define UDMACHCTL_O_DSTENDP 0x00000004
  46. #define UDMACHCTL_O_CHCTL 0x00000008
  47. //*****************************************************************************
  48. //
  49. // The following are defines for the bit fields in the
  50. // UDMACHCTL_O_SRCENDP register.
  51. //
  52. //*****************************************************************************
  53. #define UDMACHCTL_SRCENDP_ADDR_M \
  54. 0xFFFFFFFF // Source address end pointer This
  55. // field points to the last address
  56. // of the uDMA transfer source
  57. // (inclusive). If the source
  58. // address is not incrementing (the
  59. // SRCINC field in the DMACHCTL
  60. // register is 0x3), then this
  61. // field points at the source
  62. // location itself (such as a
  63. // peripheral control register).
  64. #define UDMACHCTL_SRCENDP_ADDR_S 0
  65. //*****************************************************************************
  66. //
  67. // The following are defines for the bit fields in the
  68. // UDMACHCTL_O_DSTENDP register.
  69. //
  70. //*****************************************************************************
  71. #define UDMACHCTL_DSTENDP_ADDR_M \
  72. 0xFFFFFFFF // Destination address end pointer
  73. // This field points to the last
  74. // address of the uDMA transfer
  75. // destination (inclusive). If the
  76. // destination address is not
  77. // incrementing (the DSTINC field
  78. // in the DMACHCTL register is
  79. // 0x3), then this field points at
  80. // the destination location itself
  81. // (such as a peripheral control
  82. // register).
  83. #define UDMACHCTL_DSTENDP_ADDR_S 0
  84. //*****************************************************************************
  85. //
  86. // The following are defines for the bit fields in the
  87. // UDMACHCTL_O_CHCTL register.
  88. //
  89. //*****************************************************************************
  90. #define UDMACHCTL_CHCTL_DSTINC_M \
  91. 0xC0000000 // Destination address increment
  92. // This field configures the
  93. // destination address increment.
  94. // The address increment value must
  95. // be equal or greater than the
  96. // value of the destination size
  97. // (DSTSIZE). 0x0: Byte - Increment
  98. // by 8-bit locations 0x1:
  99. // Half-word - Increment by 16-bit
  100. // locations 0x2: Word - Increment
  101. // by 32-bit locations 0x3: No
  102. // increment - Address remains set
  103. // to the value of the Destination
  104. // address end pointer (DMADSTENDP)
  105. // for the channel.
  106. #define UDMACHCTL_CHCTL_DSTINC_S 30
  107. #define UDMACHCTL_CHCTL_DSTSIZE_M \
  108. 0x30000000 // Destination data size This
  109. // field configures the destination
  110. // item data size. Note: DSTSIZE
  111. // must be the same as SRCSIZE.
  112. // 0x0: Byte - 8-bit data size 0x1:
  113. // Half-word - 16-bit data size
  114. // 0x2: Word - 32-bit data size
  115. // 0x3: Reserved
  116. #define UDMACHCTL_CHCTL_DSTSIZE_S 28
  117. #define UDMACHCTL_CHCTL_SRCINC_M \
  118. 0x0C000000 // Source address increment This
  119. // field configures the source
  120. // address increment. The address
  121. // increment value must be equal or
  122. // greater than the value of the
  123. // source size (SRCSIZE). 0x0: Byte
  124. // - Increment by 8-bit locations
  125. // 0x1: Half-word - Increment by
  126. // 16-bit locations 0x2: Word -
  127. // Increment by 32-bit locations
  128. // 0x3: No increment - Address
  129. // remains set to the value of the
  130. // Source address end pointer
  131. // (DMASRCENDP) for the channel.
  132. #define UDMACHCTL_CHCTL_SRCINC_S 26
  133. #define UDMACHCTL_CHCTL_SRCSIZE_M \
  134. 0x03000000 // Source data size This field
  135. // configures the source item data
  136. // size. Note: SRCSIZE must be the
  137. // same as DSTSIZE. 0x0: Byte -
  138. // 8-bit data size 0x1: Half-word -
  139. // 16-bit data size 0x2: Word -
  140. // 32-bit data size 0x3: Reserved
  141. #define UDMACHCTL_CHCTL_SRCSIZE_S 24
  142. #define UDMACHCTL_CHCTL_ARBSIZE_M \
  143. 0x0003C000 // Arbitration size This field
  144. // configures the number of
  145. // transfers that can occur before
  146. // the uDMA controller
  147. // re-arbitrates. The possible
  148. // arbitration rate configurations
  149. // represent powers of 2 and are
  150. // shown below. 0x0: 1 Transfer -
  151. // Arbitrates after each uDMA
  152. // transfer 0x1: 2 Transfers 0x2: 4
  153. // Transfers 0x3: 8 Transfers 0x4:
  154. // 16 Transfers 0x5: 32 Transfers
  155. // 0x6: 64 Transfers 0x7: 128
  156. // Transfers 0x8: 256 Transfers
  157. // 0x9: 512 Transfers 0xA-0xF: 1024
  158. // Transfers - In this
  159. // configuration, no arbitration
  160. // occurs during the uDMA transfer
  161. // because the maximum transfer
  162. // size is 1024.
  163. #define UDMACHCTL_CHCTL_ARBSIZE_S 14
  164. #define UDMACHCTL_CHCTL_XFERSIZE_M \
  165. 0x00003FF0 // Transfer size (minus 1) This
  166. // field configures the total
  167. // number of items to transfer. The
  168. // value of this field is 1 less
  169. // than the number to transfer
  170. // (value 0 means transfer 1 item).
  171. // The maximum value for this
  172. // 10-bit field is 1023which
  173. // represents a transfer size of
  174. // 1024 items. The transfer size is
  175. // the number of items, not the
  176. // number of bytes, If the data
  177. // size is 32 bits, then this value
  178. // is the number of 32-bit words to
  179. // transfer. The uDMA controller
  180. // updates this field immediately
  181. // before entering the arbitration
  182. // process, so it contrains the
  183. // number of outstanding items that
  184. // is necessary to complete the
  185. // uDMA cycle.
  186. #define UDMACHCTL_CHCTL_XFERSIZE_S 4
  187. #define UDMACHCTL_CHCTL_NXTUSEBURST \
  188. 0x00000008 // Next useburst This field
  189. // controls whether the Useburst
  190. // SET[n] bit is automatically set
  191. // for the last transfer of a
  192. // peripheral scatter-gather
  193. // operation. Normally, for the
  194. // last transfer, if the number of
  195. // remaining items to transfer is
  196. // less than the arbitration size,
  197. // the uDMA controller uses single
  198. // transfers to complete the
  199. // transaction. If this bit is set,
  200. // then the controller uses a burst
  201. // transfer to complete the last
  202. // transfer.
  203. #define UDMACHCTL_CHCTL_NXTUSEBURST_M \
  204. 0x00000008
  205. #define UDMACHCTL_CHCTL_NXTUSEBURST_S 3
  206. #define UDMACHCTL_CHCTL_XFERMODE_M \
  207. 0x00000007 // uDMA transfer mode This field
  208. // configures the operating mode of
  209. // the uDMA cycle. Refer to "Micro
  210. // Direct Memory Access - Transfer
  211. // Modes" for a detailed
  212. // explanation of transfer modes.
  213. // Because this register is in
  214. // system RAM, it has no reset
  215. // value. Therefore, this field
  216. // should be initialized to 0
  217. // before the channel is enabled.
  218. // 0x0: Stop 0x1: Basic 0x2:
  219. // Auto-request 0x3: Ping-pong 0x4:
  220. // Memory scatter-gather 0x5:
  221. // Alternate memory scatter-gather
  222. // 0x6: Peripheral scatter-gather
  223. // 0x7: Alternate peripheral
  224. // scatter-gather
  225. #define UDMACHCTL_CHCTL_XFERMODE_S 0
  226. #endif // __HW_UDMACHCTL_H__