am_reg_ioslave.h 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514
  1. //*****************************************************************************
  2. //
  3. // am_reg_ioslave.h
  4. //! @file
  5. //!
  6. //! @brief Register macros for the IOSLAVE module
  7. //
  8. //*****************************************************************************
  9. //*****************************************************************************
  10. //
  11. // Copyright (c) 2017, Ambiq Micro
  12. // All rights reserved.
  13. //
  14. // Redistribution and use in source and binary forms, with or without
  15. // modification, are permitted provided that the following conditions are met:
  16. //
  17. // 1. Redistributions of source code must retain the above copyright notice,
  18. // this list of conditions and the following disclaimer.
  19. //
  20. // 2. Redistributions in binary form must reproduce the above copyright
  21. // notice, this list of conditions and the following disclaimer in the
  22. // documentation and/or other materials provided with the distribution.
  23. //
  24. // 3. Neither the name of the copyright holder nor the names of its
  25. // contributors may be used to endorse or promote products derived from this
  26. // software without specific prior written permission.
  27. //
  28. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  29. // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  30. // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  31. // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
  32. // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  33. // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  34. // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  35. // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  36. // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  37. // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  38. // POSSIBILITY OF SUCH DAMAGE.
  39. //
  40. // This is part of revision 1.2.11 of the AmbiqSuite Development Package.
  41. //
  42. //*****************************************************************************
  43. #ifndef AM_REG_IOSLAVE_H
  44. #define AM_REG_IOSLAVE_H
  45. //*****************************************************************************
  46. //
  47. // Instance finder. (1 instance(s) available)
  48. //
  49. //*****************************************************************************
  50. #define AM_REG_IOSLAVE_NUM_MODULES 1
  51. #define AM_REG_IOSLAVEn(n) \
  52. (REG_IOSLAVE_BASEADDR + 0x00000000 * n)
  53. //*****************************************************************************
  54. //
  55. // Register offsets.
  56. //
  57. //*****************************************************************************
  58. #define AM_REG_IOSLAVE_FIFOPTR_O 0x00000100
  59. #define AM_REG_IOSLAVE_FIFOCFG_O 0x00000104
  60. #define AM_REG_IOSLAVE_FIFOTHR_O 0x00000108
  61. #define AM_REG_IOSLAVE_FUPD_O 0x0000010C
  62. #define AM_REG_IOSLAVE_FIFOCTR_O 0x00000110
  63. #define AM_REG_IOSLAVE_FIFOINC_O 0x00000114
  64. #define AM_REG_IOSLAVE_CFG_O 0x00000118
  65. #define AM_REG_IOSLAVE_PRENC_O 0x0000011C
  66. #define AM_REG_IOSLAVE_IOINTCTL_O 0x00000120
  67. #define AM_REG_IOSLAVE_GENADD_O 0x00000124
  68. #define AM_REG_IOSLAVE_INTEN_O 0x00000200
  69. #define AM_REG_IOSLAVE_INTSTAT_O 0x00000204
  70. #define AM_REG_IOSLAVE_INTCLR_O 0x00000208
  71. #define AM_REG_IOSLAVE_INTSET_O 0x0000020C
  72. #define AM_REG_IOSLAVE_REGACCINTEN_O 0x00000210
  73. #define AM_REG_IOSLAVE_REGACCINTSTAT_O 0x00000214
  74. #define AM_REG_IOSLAVE_REGACCINTCLR_O 0x00000218
  75. #define AM_REG_IOSLAVE_REGACCINTSET_O 0x0000021C
  76. //*****************************************************************************
  77. //
  78. // IOSLAVE_INTEN - IO Slave Interrupts: Enable
  79. //
  80. //*****************************************************************************
  81. // Transfer complete interrupt, write to register space.
  82. #define AM_REG_IOSLAVE_INTEN_XCMPWR_S 9
  83. #define AM_REG_IOSLAVE_INTEN_XCMPWR_M 0x00000200
  84. #define AM_REG_IOSLAVE_INTEN_XCMPWR(n) (((uint32_t)(n) << 9) & 0x00000200)
  85. // Transfer complete interrupt, write to FIFO space.
  86. #define AM_REG_IOSLAVE_INTEN_XCMPWF_S 8
  87. #define AM_REG_IOSLAVE_INTEN_XCMPWF_M 0x00000100
  88. #define AM_REG_IOSLAVE_INTEN_XCMPWF(n) (((uint32_t)(n) << 8) & 0x00000100)
  89. // Transfer complete interrupt, read from register space.
  90. #define AM_REG_IOSLAVE_INTEN_XCMPRR_S 7
  91. #define AM_REG_IOSLAVE_INTEN_XCMPRR_M 0x00000080
  92. #define AM_REG_IOSLAVE_INTEN_XCMPRR(n) (((uint32_t)(n) << 7) & 0x00000080)
  93. // Transfer complete interrupt, read from FIFO space.
  94. #define AM_REG_IOSLAVE_INTEN_XCMPRF_S 6
  95. #define AM_REG_IOSLAVE_INTEN_XCMPRF_M 0x00000040
  96. #define AM_REG_IOSLAVE_INTEN_XCMPRF(n) (((uint32_t)(n) << 6) & 0x00000040)
  97. // I2C Interrupt Write interrupt.
  98. #define AM_REG_IOSLAVE_INTEN_IOINTW_S 5
  99. #define AM_REG_IOSLAVE_INTEN_IOINTW_M 0x00000020
  100. #define AM_REG_IOSLAVE_INTEN_IOINTW(n) (((uint32_t)(n) << 5) & 0x00000020)
  101. // I2C General Address interrupt.
  102. #define AM_REG_IOSLAVE_INTEN_GENAD_S 4
  103. #define AM_REG_IOSLAVE_INTEN_GENAD_M 0x00000010
  104. #define AM_REG_IOSLAVE_INTEN_GENAD(n) (((uint32_t)(n) << 4) & 0x00000010)
  105. // FIFO Read Error interrupt.
  106. #define AM_REG_IOSLAVE_INTEN_FRDERR_S 3
  107. #define AM_REG_IOSLAVE_INTEN_FRDERR_M 0x00000008
  108. #define AM_REG_IOSLAVE_INTEN_FRDERR(n) (((uint32_t)(n) << 3) & 0x00000008)
  109. // FIFO Underflow interrupt.
  110. #define AM_REG_IOSLAVE_INTEN_FUNDFL_S 2
  111. #define AM_REG_IOSLAVE_INTEN_FUNDFL_M 0x00000004
  112. #define AM_REG_IOSLAVE_INTEN_FUNDFL(n) (((uint32_t)(n) << 2) & 0x00000004)
  113. // FIFO Overflow interrupt.
  114. #define AM_REG_IOSLAVE_INTEN_FOVFL_S 1
  115. #define AM_REG_IOSLAVE_INTEN_FOVFL_M 0x00000002
  116. #define AM_REG_IOSLAVE_INTEN_FOVFL(n) (((uint32_t)(n) << 1) & 0x00000002)
  117. // FIFO Size interrupt.
  118. #define AM_REG_IOSLAVE_INTEN_FSIZE_S 0
  119. #define AM_REG_IOSLAVE_INTEN_FSIZE_M 0x00000001
  120. #define AM_REG_IOSLAVE_INTEN_FSIZE(n) (((uint32_t)(n) << 0) & 0x00000001)
  121. //*****************************************************************************
  122. //
  123. // IOSLAVE_INTSTAT - IO Slave Interrupts: Status
  124. //
  125. //*****************************************************************************
  126. // Transfer complete interrupt, write to register space.
  127. #define AM_REG_IOSLAVE_INTSTAT_XCMPWR_S 9
  128. #define AM_REG_IOSLAVE_INTSTAT_XCMPWR_M 0x00000200
  129. #define AM_REG_IOSLAVE_INTSTAT_XCMPWR(n) (((uint32_t)(n) << 9) & 0x00000200)
  130. // Transfer complete interrupt, write to FIFO space.
  131. #define AM_REG_IOSLAVE_INTSTAT_XCMPWF_S 8
  132. #define AM_REG_IOSLAVE_INTSTAT_XCMPWF_M 0x00000100
  133. #define AM_REG_IOSLAVE_INTSTAT_XCMPWF(n) (((uint32_t)(n) << 8) & 0x00000100)
  134. // Transfer complete interrupt, read from register space.
  135. #define AM_REG_IOSLAVE_INTSTAT_XCMPRR_S 7
  136. #define AM_REG_IOSLAVE_INTSTAT_XCMPRR_M 0x00000080
  137. #define AM_REG_IOSLAVE_INTSTAT_XCMPRR(n) (((uint32_t)(n) << 7) & 0x00000080)
  138. // Transfer complete interrupt, read from FIFO space.
  139. #define AM_REG_IOSLAVE_INTSTAT_XCMPRF_S 6
  140. #define AM_REG_IOSLAVE_INTSTAT_XCMPRF_M 0x00000040
  141. #define AM_REG_IOSLAVE_INTSTAT_XCMPRF(n) (((uint32_t)(n) << 6) & 0x00000040)
  142. // I2C Interrupt Write interrupt.
  143. #define AM_REG_IOSLAVE_INTSTAT_IOINTW_S 5
  144. #define AM_REG_IOSLAVE_INTSTAT_IOINTW_M 0x00000020
  145. #define AM_REG_IOSLAVE_INTSTAT_IOINTW(n) (((uint32_t)(n) << 5) & 0x00000020)
  146. // I2C General Address interrupt.
  147. #define AM_REG_IOSLAVE_INTSTAT_GENAD_S 4
  148. #define AM_REG_IOSLAVE_INTSTAT_GENAD_M 0x00000010
  149. #define AM_REG_IOSLAVE_INTSTAT_GENAD(n) (((uint32_t)(n) << 4) & 0x00000010)
  150. // FIFO Read Error interrupt.
  151. #define AM_REG_IOSLAVE_INTSTAT_FRDERR_S 3
  152. #define AM_REG_IOSLAVE_INTSTAT_FRDERR_M 0x00000008
  153. #define AM_REG_IOSLAVE_INTSTAT_FRDERR(n) (((uint32_t)(n) << 3) & 0x00000008)
  154. // FIFO Underflow interrupt.
  155. #define AM_REG_IOSLAVE_INTSTAT_FUNDFL_S 2
  156. #define AM_REG_IOSLAVE_INTSTAT_FUNDFL_M 0x00000004
  157. #define AM_REG_IOSLAVE_INTSTAT_FUNDFL(n) (((uint32_t)(n) << 2) & 0x00000004)
  158. // FIFO Overflow interrupt.
  159. #define AM_REG_IOSLAVE_INTSTAT_FOVFL_S 1
  160. #define AM_REG_IOSLAVE_INTSTAT_FOVFL_M 0x00000002
  161. #define AM_REG_IOSLAVE_INTSTAT_FOVFL(n) (((uint32_t)(n) << 1) & 0x00000002)
  162. // FIFO Size interrupt.
  163. #define AM_REG_IOSLAVE_INTSTAT_FSIZE_S 0
  164. #define AM_REG_IOSLAVE_INTSTAT_FSIZE_M 0x00000001
  165. #define AM_REG_IOSLAVE_INTSTAT_FSIZE(n) (((uint32_t)(n) << 0) & 0x00000001)
  166. //*****************************************************************************
  167. //
  168. // IOSLAVE_INTCLR - IO Slave Interrupts: Clear
  169. //
  170. //*****************************************************************************
  171. // Transfer complete interrupt, write to register space.
  172. #define AM_REG_IOSLAVE_INTCLR_XCMPWR_S 9
  173. #define AM_REG_IOSLAVE_INTCLR_XCMPWR_M 0x00000200
  174. #define AM_REG_IOSLAVE_INTCLR_XCMPWR(n) (((uint32_t)(n) << 9) & 0x00000200)
  175. // Transfer complete interrupt, write to FIFO space.
  176. #define AM_REG_IOSLAVE_INTCLR_XCMPWF_S 8
  177. #define AM_REG_IOSLAVE_INTCLR_XCMPWF_M 0x00000100
  178. #define AM_REG_IOSLAVE_INTCLR_XCMPWF(n) (((uint32_t)(n) << 8) & 0x00000100)
  179. // Transfer complete interrupt, read from register space.
  180. #define AM_REG_IOSLAVE_INTCLR_XCMPRR_S 7
  181. #define AM_REG_IOSLAVE_INTCLR_XCMPRR_M 0x00000080
  182. #define AM_REG_IOSLAVE_INTCLR_XCMPRR(n) (((uint32_t)(n) << 7) & 0x00000080)
  183. // Transfer complete interrupt, read from FIFO space.
  184. #define AM_REG_IOSLAVE_INTCLR_XCMPRF_S 6
  185. #define AM_REG_IOSLAVE_INTCLR_XCMPRF_M 0x00000040
  186. #define AM_REG_IOSLAVE_INTCLR_XCMPRF(n) (((uint32_t)(n) << 6) & 0x00000040)
  187. // I2C Interrupt Write interrupt.
  188. #define AM_REG_IOSLAVE_INTCLR_IOINTW_S 5
  189. #define AM_REG_IOSLAVE_INTCLR_IOINTW_M 0x00000020
  190. #define AM_REG_IOSLAVE_INTCLR_IOINTW(n) (((uint32_t)(n) << 5) & 0x00000020)
  191. // I2C General Address interrupt.
  192. #define AM_REG_IOSLAVE_INTCLR_GENAD_S 4
  193. #define AM_REG_IOSLAVE_INTCLR_GENAD_M 0x00000010
  194. #define AM_REG_IOSLAVE_INTCLR_GENAD(n) (((uint32_t)(n) << 4) & 0x00000010)
  195. // FIFO Read Error interrupt.
  196. #define AM_REG_IOSLAVE_INTCLR_FRDERR_S 3
  197. #define AM_REG_IOSLAVE_INTCLR_FRDERR_M 0x00000008
  198. #define AM_REG_IOSLAVE_INTCLR_FRDERR(n) (((uint32_t)(n) << 3) & 0x00000008)
  199. // FIFO Underflow interrupt.
  200. #define AM_REG_IOSLAVE_INTCLR_FUNDFL_S 2
  201. #define AM_REG_IOSLAVE_INTCLR_FUNDFL_M 0x00000004
  202. #define AM_REG_IOSLAVE_INTCLR_FUNDFL(n) (((uint32_t)(n) << 2) & 0x00000004)
  203. // FIFO Overflow interrupt.
  204. #define AM_REG_IOSLAVE_INTCLR_FOVFL_S 1
  205. #define AM_REG_IOSLAVE_INTCLR_FOVFL_M 0x00000002
  206. #define AM_REG_IOSLAVE_INTCLR_FOVFL(n) (((uint32_t)(n) << 1) & 0x00000002)
  207. // FIFO Size interrupt.
  208. #define AM_REG_IOSLAVE_INTCLR_FSIZE_S 0
  209. #define AM_REG_IOSLAVE_INTCLR_FSIZE_M 0x00000001
  210. #define AM_REG_IOSLAVE_INTCLR_FSIZE(n) (((uint32_t)(n) << 0) & 0x00000001)
  211. //*****************************************************************************
  212. //
  213. // IOSLAVE_INTSET - IO Slave Interrupts: Set
  214. //
  215. //*****************************************************************************
  216. // Transfer complete interrupt, write to register space.
  217. #define AM_REG_IOSLAVE_INTSET_XCMPWR_S 9
  218. #define AM_REG_IOSLAVE_INTSET_XCMPWR_M 0x00000200
  219. #define AM_REG_IOSLAVE_INTSET_XCMPWR(n) (((uint32_t)(n) << 9) & 0x00000200)
  220. // Transfer complete interrupt, write to FIFO space.
  221. #define AM_REG_IOSLAVE_INTSET_XCMPWF_S 8
  222. #define AM_REG_IOSLAVE_INTSET_XCMPWF_M 0x00000100
  223. #define AM_REG_IOSLAVE_INTSET_XCMPWF(n) (((uint32_t)(n) << 8) & 0x00000100)
  224. // Transfer complete interrupt, read from register space.
  225. #define AM_REG_IOSLAVE_INTSET_XCMPRR_S 7
  226. #define AM_REG_IOSLAVE_INTSET_XCMPRR_M 0x00000080
  227. #define AM_REG_IOSLAVE_INTSET_XCMPRR(n) (((uint32_t)(n) << 7) & 0x00000080)
  228. // Transfer complete interrupt, read from FIFO space.
  229. #define AM_REG_IOSLAVE_INTSET_XCMPRF_S 6
  230. #define AM_REG_IOSLAVE_INTSET_XCMPRF_M 0x00000040
  231. #define AM_REG_IOSLAVE_INTSET_XCMPRF(n) (((uint32_t)(n) << 6) & 0x00000040)
  232. // I2C Interrupt Write interrupt.
  233. #define AM_REG_IOSLAVE_INTSET_IOINTW_S 5
  234. #define AM_REG_IOSLAVE_INTSET_IOINTW_M 0x00000020
  235. #define AM_REG_IOSLAVE_INTSET_IOINTW(n) (((uint32_t)(n) << 5) & 0x00000020)
  236. // I2C General Address interrupt.
  237. #define AM_REG_IOSLAVE_INTSET_GENAD_S 4
  238. #define AM_REG_IOSLAVE_INTSET_GENAD_M 0x00000010
  239. #define AM_REG_IOSLAVE_INTSET_GENAD(n) (((uint32_t)(n) << 4) & 0x00000010)
  240. // FIFO Read Error interrupt.
  241. #define AM_REG_IOSLAVE_INTSET_FRDERR_S 3
  242. #define AM_REG_IOSLAVE_INTSET_FRDERR_M 0x00000008
  243. #define AM_REG_IOSLAVE_INTSET_FRDERR(n) (((uint32_t)(n) << 3) & 0x00000008)
  244. // FIFO Underflow interrupt.
  245. #define AM_REG_IOSLAVE_INTSET_FUNDFL_S 2
  246. #define AM_REG_IOSLAVE_INTSET_FUNDFL_M 0x00000004
  247. #define AM_REG_IOSLAVE_INTSET_FUNDFL(n) (((uint32_t)(n) << 2) & 0x00000004)
  248. // FIFO Overflow interrupt.
  249. #define AM_REG_IOSLAVE_INTSET_FOVFL_S 1
  250. #define AM_REG_IOSLAVE_INTSET_FOVFL_M 0x00000002
  251. #define AM_REG_IOSLAVE_INTSET_FOVFL(n) (((uint32_t)(n) << 1) & 0x00000002)
  252. // FIFO Size interrupt.
  253. #define AM_REG_IOSLAVE_INTSET_FSIZE_S 0
  254. #define AM_REG_IOSLAVE_INTSET_FSIZE_M 0x00000001
  255. #define AM_REG_IOSLAVE_INTSET_FSIZE(n) (((uint32_t)(n) << 0) & 0x00000001)
  256. //*****************************************************************************
  257. //
  258. // IOSLAVE_REGACCINTEN - Register Access Interrupts: Enable
  259. //
  260. //*****************************************************************************
  261. // Register access interrupts.
  262. #define AM_REG_IOSLAVE_REGACCINTEN_REGACC_S 0
  263. #define AM_REG_IOSLAVE_REGACCINTEN_REGACC_M 0xFFFFFFFF
  264. #define AM_REG_IOSLAVE_REGACCINTEN_REGACC(n) (((uint32_t)(n) << 0) & 0xFFFFFFFF)
  265. //*****************************************************************************
  266. //
  267. // IOSLAVE_REGACCINTSTAT - Register Access Interrupts: Status
  268. //
  269. //*****************************************************************************
  270. // Register access interrupts.
  271. #define AM_REG_IOSLAVE_REGACCINTSTAT_REGACC_S 0
  272. #define AM_REG_IOSLAVE_REGACCINTSTAT_REGACC_M 0xFFFFFFFF
  273. #define AM_REG_IOSLAVE_REGACCINTSTAT_REGACC(n) (((uint32_t)(n) << 0) & 0xFFFFFFFF)
  274. //*****************************************************************************
  275. //
  276. // IOSLAVE_REGACCINTCLR - Register Access Interrupts: Clear
  277. //
  278. //*****************************************************************************
  279. // Register access interrupts.
  280. #define AM_REG_IOSLAVE_REGACCINTCLR_REGACC_S 0
  281. #define AM_REG_IOSLAVE_REGACCINTCLR_REGACC_M 0xFFFFFFFF
  282. #define AM_REG_IOSLAVE_REGACCINTCLR_REGACC(n) (((uint32_t)(n) << 0) & 0xFFFFFFFF)
  283. //*****************************************************************************
  284. //
  285. // IOSLAVE_REGACCINTSET - Register Access Interrupts: Set
  286. //
  287. //*****************************************************************************
  288. // Register access interrupts.
  289. #define AM_REG_IOSLAVE_REGACCINTSET_REGACC_S 0
  290. #define AM_REG_IOSLAVE_REGACCINTSET_REGACC_M 0xFFFFFFFF
  291. #define AM_REG_IOSLAVE_REGACCINTSET_REGACC(n) (((uint32_t)(n) << 0) & 0xFFFFFFFF)
  292. //*****************************************************************************
  293. //
  294. // IOSLAVE_FIFOPTR - Current FIFO Pointer
  295. //
  296. //*****************************************************************************
  297. // The number of bytes currently in the hardware FIFO.
  298. #define AM_REG_IOSLAVE_FIFOPTR_FIFOSIZ_S 8
  299. #define AM_REG_IOSLAVE_FIFOPTR_FIFOSIZ_M 0x0000FF00
  300. #define AM_REG_IOSLAVE_FIFOPTR_FIFOSIZ(n) (((uint32_t)(n) << 8) & 0x0000FF00)
  301. // Current FIFO pointer.
  302. #define AM_REG_IOSLAVE_FIFOPTR_FIFOPTR_S 0
  303. #define AM_REG_IOSLAVE_FIFOPTR_FIFOPTR_M 0x000000FF
  304. #define AM_REG_IOSLAVE_FIFOPTR_FIFOPTR(n) (((uint32_t)(n) << 0) & 0x000000FF)
  305. //*****************************************************************************
  306. //
  307. // IOSLAVE_FIFOCFG - FIFO Configuration
  308. //
  309. //*****************************************************************************
  310. // Defines the read-only area. The IO Slave read-only area is situated in LRAM
  311. // at (ROBASE*8) to (FIFOOBASE*8-1)
  312. #define AM_REG_IOSLAVE_FIFOCFG_ROBASE_S 24
  313. #define AM_REG_IOSLAVE_FIFOCFG_ROBASE_M 0x3F000000
  314. #define AM_REG_IOSLAVE_FIFOCFG_ROBASE(n) (((uint32_t)(n) << 24) & 0x3F000000)
  315. // These bits hold the maximum FIFO address in 8 byte segments. It is also the
  316. // beginning of the RAM area of the LRAM. Note that no RAM area is configured
  317. // if FIFOMAX is set to 0x1F.
  318. #define AM_REG_IOSLAVE_FIFOCFG_FIFOMAX_S 8
  319. #define AM_REG_IOSLAVE_FIFOCFG_FIFOMAX_M 0x00003F00
  320. #define AM_REG_IOSLAVE_FIFOCFG_FIFOMAX(n) (((uint32_t)(n) << 8) & 0x00003F00)
  321. // These bits hold the base address of the I/O FIFO in 8 byte segments. The IO
  322. // Slave FIFO is situated in LRAM at (FIFOBASE*8) to (FIFOMAX*8-1).
  323. #define AM_REG_IOSLAVE_FIFOCFG_FIFOBASE_S 0
  324. #define AM_REG_IOSLAVE_FIFOCFG_FIFOBASE_M 0x0000001F
  325. #define AM_REG_IOSLAVE_FIFOCFG_FIFOBASE(n) (((uint32_t)(n) << 0) & 0x0000001F)
  326. //*****************************************************************************
  327. //
  328. // IOSLAVE_FIFOTHR - FIFO Threshold Configuration
  329. //
  330. //*****************************************************************************
  331. // FIFO size interrupt threshold.
  332. #define AM_REG_IOSLAVE_FIFOTHR_FIFOTHR_S 0
  333. #define AM_REG_IOSLAVE_FIFOTHR_FIFOTHR_M 0x000000FF
  334. #define AM_REG_IOSLAVE_FIFOTHR_FIFOTHR(n) (((uint32_t)(n) << 0) & 0x000000FF)
  335. //*****************************************************************************
  336. //
  337. // IOSLAVE_FUPD - FIFO Update Status
  338. //
  339. //*****************************************************************************
  340. // This bitfield indicates an IO read is active.
  341. #define AM_REG_IOSLAVE_FUPD_IOREAD_S 1
  342. #define AM_REG_IOSLAVE_FUPD_IOREAD_M 0x00000002
  343. #define AM_REG_IOSLAVE_FUPD_IOREAD(n) (((uint32_t)(n) << 1) & 0x00000002)
  344. // This bit indicates that a FIFO update is underway.
  345. #define AM_REG_IOSLAVE_FUPD_FIFOUPD_S 0
  346. #define AM_REG_IOSLAVE_FUPD_FIFOUPD_M 0x00000001
  347. #define AM_REG_IOSLAVE_FUPD_FIFOUPD(n) (((uint32_t)(n) << 0) & 0x00000001)
  348. //*****************************************************************************
  349. //
  350. // IOSLAVE_FIFOCTR - Overall FIFO Counter
  351. //
  352. //*****************************************************************************
  353. // Virtual FIFO byte count
  354. #define AM_REG_IOSLAVE_FIFOCTR_FIFOCTR_S 0
  355. #define AM_REG_IOSLAVE_FIFOCTR_FIFOCTR_M 0x000003FF
  356. #define AM_REG_IOSLAVE_FIFOCTR_FIFOCTR(n) (((uint32_t)(n) << 0) & 0x000003FF)
  357. //*****************************************************************************
  358. //
  359. // IOSLAVE_FIFOINC - Overall FIFO Counter Increment
  360. //
  361. //*****************************************************************************
  362. // Increment the Overall FIFO Counter by this value on a write
  363. #define AM_REG_IOSLAVE_FIFOINC_FIFOINC_S 0
  364. #define AM_REG_IOSLAVE_FIFOINC_FIFOINC_M 0x000003FF
  365. #define AM_REG_IOSLAVE_FIFOINC_FIFOINC(n) (((uint32_t)(n) << 0) & 0x000003FF)
  366. //*****************************************************************************
  367. //
  368. // IOSLAVE_CFG - I/O Slave Configuration
  369. //
  370. //*****************************************************************************
  371. // IOSLAVE interface enable.
  372. #define AM_REG_IOSLAVE_CFG_IFCEN_S 31
  373. #define AM_REG_IOSLAVE_CFG_IFCEN_M 0x80000000
  374. #define AM_REG_IOSLAVE_CFG_IFCEN(n) (((uint32_t)(n) << 31) & 0x80000000)
  375. #define AM_REG_IOSLAVE_CFG_IFCEN_DIS 0x00000000
  376. #define AM_REG_IOSLAVE_CFG_IFCEN_EN 0x80000000
  377. // 7-bit or 10-bit I2C device address.
  378. #define AM_REG_IOSLAVE_CFG_I2CADDR_S 8
  379. #define AM_REG_IOSLAVE_CFG_I2CADDR_M 0x000FFF00
  380. #define AM_REG_IOSLAVE_CFG_I2CADDR(n) (((uint32_t)(n) << 8) & 0x000FFF00)
  381. // This bit holds the cycle to initiate an I/O RAM read.
  382. #define AM_REG_IOSLAVE_CFG_STARTRD_S 4
  383. #define AM_REG_IOSLAVE_CFG_STARTRD_M 0x00000010
  384. #define AM_REG_IOSLAVE_CFG_STARTRD(n) (((uint32_t)(n) << 4) & 0x00000010)
  385. #define AM_REG_IOSLAVE_CFG_STARTRD_LATE 0x00000000
  386. #define AM_REG_IOSLAVE_CFG_STARTRD_EARLY 0x00000010
  387. // This bit selects the transfer bit ordering.
  388. #define AM_REG_IOSLAVE_CFG_LSB_S 2
  389. #define AM_REG_IOSLAVE_CFG_LSB_M 0x00000004
  390. #define AM_REG_IOSLAVE_CFG_LSB(n) (((uint32_t)(n) << 2) & 0x00000004)
  391. #define AM_REG_IOSLAVE_CFG_LSB_MSB_FIRST 0x00000000
  392. #define AM_REG_IOSLAVE_CFG_LSB_LSB_FIRST 0x00000004
  393. // This bit selects SPI polarity.
  394. #define AM_REG_IOSLAVE_CFG_SPOL_S 1
  395. #define AM_REG_IOSLAVE_CFG_SPOL_M 0x00000002
  396. #define AM_REG_IOSLAVE_CFG_SPOL(n) (((uint32_t)(n) << 1) & 0x00000002)
  397. #define AM_REG_IOSLAVE_CFG_SPOL_SPI_MODES_0_3 0x00000000
  398. #define AM_REG_IOSLAVE_CFG_SPOL_SPI_MODES_1_2 0x00000002
  399. // This bit selects the I/O interface.
  400. #define AM_REG_IOSLAVE_CFG_IFCSEL_S 0
  401. #define AM_REG_IOSLAVE_CFG_IFCSEL_M 0x00000001
  402. #define AM_REG_IOSLAVE_CFG_IFCSEL(n) (((uint32_t)(n) << 0) & 0x00000001)
  403. #define AM_REG_IOSLAVE_CFG_IFCSEL_I2C 0x00000000
  404. #define AM_REG_IOSLAVE_CFG_IFCSEL_SPI 0x00000001
  405. //*****************************************************************************
  406. //
  407. // IOSLAVE_PRENC - I/O Slave Interrupt Priority Encode
  408. //
  409. //*****************************************************************************
  410. // These bits hold the priority encode of the REGACC interrupts.
  411. #define AM_REG_IOSLAVE_PRENC_PRENC_S 0
  412. #define AM_REG_IOSLAVE_PRENC_PRENC_M 0x0000001F
  413. #define AM_REG_IOSLAVE_PRENC_PRENC(n) (((uint32_t)(n) << 0) & 0x0000001F)
  414. //*****************************************************************************
  415. //
  416. // IOSLAVE_IOINTCTL - I/O Interrupt Control
  417. //
  418. //*****************************************************************************
  419. // These bits set the IOINT interrupts when written with a 1.
  420. #define AM_REG_IOSLAVE_IOINTCTL_IOINTSET_S 24
  421. #define AM_REG_IOSLAVE_IOINTCTL_IOINTSET_M 0xFF000000
  422. #define AM_REG_IOSLAVE_IOINTCTL_IOINTSET(n) (((uint32_t)(n) << 24) & 0xFF000000)
  423. // This bit clears all of the IOINT interrupts when written with a 1.
  424. #define AM_REG_IOSLAVE_IOINTCTL_IOINTCLR_S 16
  425. #define AM_REG_IOSLAVE_IOINTCTL_IOINTCLR_M 0x00010000
  426. #define AM_REG_IOSLAVE_IOINTCTL_IOINTCLR(n) (((uint32_t)(n) << 16) & 0x00010000)
  427. // These bits read the IOINT interrupts.
  428. #define AM_REG_IOSLAVE_IOINTCTL_IOINT_S 8
  429. #define AM_REG_IOSLAVE_IOINTCTL_IOINT_M 0x0000FF00
  430. #define AM_REG_IOSLAVE_IOINTCTL_IOINT(n) (((uint32_t)(n) << 8) & 0x0000FF00)
  431. // These read-only bits indicate whether the IOINT interrupts are enabled.
  432. #define AM_REG_IOSLAVE_IOINTCTL_IOINTEN_S 0
  433. #define AM_REG_IOSLAVE_IOINTCTL_IOINTEN_M 0x000000FF
  434. #define AM_REG_IOSLAVE_IOINTCTL_IOINTEN(n) (((uint32_t)(n) << 0) & 0x000000FF)
  435. //*****************************************************************************
  436. //
  437. // IOSLAVE_GENADD - General Address Data
  438. //
  439. //*****************************************************************************
  440. // The data supplied on the last General Address reference.
  441. #define AM_REG_IOSLAVE_GENADD_GADATA_S 0
  442. #define AM_REG_IOSLAVE_GENADD_GADATA_M 0x000000FF
  443. #define AM_REG_IOSLAVE_GENADD_GADATA(n) (((uint32_t)(n) << 0) & 0x000000FF)
  444. #endif // AM_REG_IOSLAVE_H