am_reg_iomstr.h 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587
  1. //*****************************************************************************
  2. //
  3. // am_reg_iomstr.h
  4. //! @file
  5. //!
  6. //! @brief Register macros for the IOMSTR 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_IOMSTR_H
  44. #define AM_REG_IOMSTR_H
  45. //*****************************************************************************
  46. //
  47. // Instance finder. (6 instance(s) available)
  48. //
  49. //*****************************************************************************
  50. #define AM_REG_IOMSTR_NUM_MODULES 6
  51. #define AM_REG_IOMSTRn(n) \
  52. (REG_IOMSTR_BASEADDR + 0x00001000 * n)
  53. //*****************************************************************************
  54. //
  55. // Register offsets.
  56. //
  57. //*****************************************************************************
  58. #define AM_REG_IOMSTR_FIFO_O 0x00000000
  59. #define AM_REG_IOMSTR_FIFOPTR_O 0x00000100
  60. #define AM_REG_IOMSTR_TLNGTH_O 0x00000104
  61. #define AM_REG_IOMSTR_FIFOTHR_O 0x00000108
  62. #define AM_REG_IOMSTR_CLKCFG_O 0x0000010C
  63. #define AM_REG_IOMSTR_CMD_O 0x00000110
  64. #define AM_REG_IOMSTR_CMDRPT_O 0x00000114
  65. #define AM_REG_IOMSTR_STATUS_O 0x00000118
  66. #define AM_REG_IOMSTR_CFG_O 0x0000011C
  67. #define AM_REG_IOMSTR_INTEN_O 0x00000200
  68. #define AM_REG_IOMSTR_INTSTAT_O 0x00000204
  69. #define AM_REG_IOMSTR_INTCLR_O 0x00000208
  70. #define AM_REG_IOMSTR_INTSET_O 0x0000020C
  71. //*****************************************************************************
  72. //
  73. // IOMSTR_INTEN - IO Master Interrupts: Enable
  74. //
  75. //*****************************************************************************
  76. // This is the arbitration loss interrupt. This error occurs if another master
  77. // collides with an IO Master transfer. Generally, the IOM started an operation
  78. // but found SDA already low.
  79. #define AM_REG_IOMSTR_INTEN_ARB_S 10
  80. #define AM_REG_IOMSTR_INTEN_ARB_M 0x00000400
  81. #define AM_REG_IOMSTR_INTEN_ARB(n) (((uint32_t)(n) << 10) & 0x00000400)
  82. // This is the STOP command interrupt. A STOP bit was detected by the IOM.
  83. #define AM_REG_IOMSTR_INTEN_STOP_S 9
  84. #define AM_REG_IOMSTR_INTEN_STOP_M 0x00000200
  85. #define AM_REG_IOMSTR_INTEN_STOP(n) (((uint32_t)(n) << 9) & 0x00000200)
  86. // This is the START command interrupt. A START from another master was
  87. // detected. Software must wait for a STOP before proceeding.
  88. #define AM_REG_IOMSTR_INTEN_START_S 8
  89. #define AM_REG_IOMSTR_INTEN_START_M 0x00000100
  90. #define AM_REG_IOMSTR_INTEN_START(n) (((uint32_t)(n) << 8) & 0x00000100)
  91. // This is the illegal command interrupt. Software attempted to issue a CMD
  92. // while another CMD was already in progress. Or an attempt was made to issue a
  93. // non-zero-length write CMD with an empty FIFO.
  94. #define AM_REG_IOMSTR_INTEN_ICMD_S 7
  95. #define AM_REG_IOMSTR_INTEN_ICMD_M 0x00000080
  96. #define AM_REG_IOMSTR_INTEN_ICMD(n) (((uint32_t)(n) << 7) & 0x00000080)
  97. // This is the illegal FIFO access interrupt. An attempt was made to read the
  98. // FIFO during a write CMD. Or an attempt was made to write the FIFO on a read
  99. // CMD.
  100. #define AM_REG_IOMSTR_INTEN_IACC_S 6
  101. #define AM_REG_IOMSTR_INTEN_IACC_M 0x00000040
  102. #define AM_REG_IOMSTR_INTEN_IACC(n) (((uint32_t)(n) << 6) & 0x00000040)
  103. // This is the WTLEN interrupt.
  104. #define AM_REG_IOMSTR_INTEN_WTLEN_S 5
  105. #define AM_REG_IOMSTR_INTEN_WTLEN_M 0x00000020
  106. #define AM_REG_IOMSTR_INTEN_WTLEN(n) (((uint32_t)(n) << 5) & 0x00000020)
  107. // This is the I2C NAK interrupt. The expected ACK from the slave was not
  108. // received by the IOM.
  109. #define AM_REG_IOMSTR_INTEN_NAK_S 4
  110. #define AM_REG_IOMSTR_INTEN_NAK_M 0x00000010
  111. #define AM_REG_IOMSTR_INTEN_NAK(n) (((uint32_t)(n) << 4) & 0x00000010)
  112. // This is the Write FIFO Overflow interrupt. An attempt was made to write the
  113. // FIFO while it was full (i.e. while FIFOSIZ > 124).
  114. #define AM_REG_IOMSTR_INTEN_FOVFL_S 3
  115. #define AM_REG_IOMSTR_INTEN_FOVFL_M 0x00000008
  116. #define AM_REG_IOMSTR_INTEN_FOVFL(n) (((uint32_t)(n) << 3) & 0x00000008)
  117. // This is the Read FIFO Underflow interrupt. An attempt was made to read FIFO
  118. // when empty (i.e. while FIFOSIZ less than 4).
  119. #define AM_REG_IOMSTR_INTEN_FUNDFL_S 2
  120. #define AM_REG_IOMSTR_INTEN_FUNDFL_M 0x00000004
  121. #define AM_REG_IOMSTR_INTEN_FUNDFL(n) (((uint32_t)(n) << 2) & 0x00000004)
  122. // This is the FIFO Threshold interrupt.
  123. #define AM_REG_IOMSTR_INTEN_THR_S 1
  124. #define AM_REG_IOMSTR_INTEN_THR_M 0x00000002
  125. #define AM_REG_IOMSTR_INTEN_THR(n) (((uint32_t)(n) << 1) & 0x00000002)
  126. // This is the Command Complete interrupt.
  127. #define AM_REG_IOMSTR_INTEN_CMDCMP_S 0
  128. #define AM_REG_IOMSTR_INTEN_CMDCMP_M 0x00000001
  129. #define AM_REG_IOMSTR_INTEN_CMDCMP(n) (((uint32_t)(n) << 0) & 0x00000001)
  130. //*****************************************************************************
  131. //
  132. // IOMSTR_INTSTAT - IO Master Interrupts: Status
  133. //
  134. //*****************************************************************************
  135. // This is the arbitration loss interrupt. This error occurs if another master
  136. // collides with an IO Master transfer. Generally, the IOM started an operation
  137. // but found SDA already low.
  138. #define AM_REG_IOMSTR_INTSTAT_ARB_S 10
  139. #define AM_REG_IOMSTR_INTSTAT_ARB_M 0x00000400
  140. #define AM_REG_IOMSTR_INTSTAT_ARB(n) (((uint32_t)(n) << 10) & 0x00000400)
  141. // This is the STOP command interrupt. A STOP bit was detected by the IOM.
  142. #define AM_REG_IOMSTR_INTSTAT_STOP_S 9
  143. #define AM_REG_IOMSTR_INTSTAT_STOP_M 0x00000200
  144. #define AM_REG_IOMSTR_INTSTAT_STOP(n) (((uint32_t)(n) << 9) & 0x00000200)
  145. // This is the START command interrupt. A START from another master was
  146. // detected. Software must wait for a STOP before proceeding.
  147. #define AM_REG_IOMSTR_INTSTAT_START_S 8
  148. #define AM_REG_IOMSTR_INTSTAT_START_M 0x00000100
  149. #define AM_REG_IOMSTR_INTSTAT_START(n) (((uint32_t)(n) << 8) & 0x00000100)
  150. // This is the illegal command interrupt. Software attempted to issue a CMD
  151. // while another CMD was already in progress. Or an attempt was made to issue a
  152. // non-zero-length write CMD with an empty FIFO.
  153. #define AM_REG_IOMSTR_INTSTAT_ICMD_S 7
  154. #define AM_REG_IOMSTR_INTSTAT_ICMD_M 0x00000080
  155. #define AM_REG_IOMSTR_INTSTAT_ICMD(n) (((uint32_t)(n) << 7) & 0x00000080)
  156. // This is the illegal FIFO access interrupt. An attempt was made to read the
  157. // FIFO during a write CMD. Or an attempt was made to write the FIFO on a read
  158. // CMD.
  159. #define AM_REG_IOMSTR_INTSTAT_IACC_S 6
  160. #define AM_REG_IOMSTR_INTSTAT_IACC_M 0x00000040
  161. #define AM_REG_IOMSTR_INTSTAT_IACC(n) (((uint32_t)(n) << 6) & 0x00000040)
  162. // This is the WTLEN interrupt.
  163. #define AM_REG_IOMSTR_INTSTAT_WTLEN_S 5
  164. #define AM_REG_IOMSTR_INTSTAT_WTLEN_M 0x00000020
  165. #define AM_REG_IOMSTR_INTSTAT_WTLEN(n) (((uint32_t)(n) << 5) & 0x00000020)
  166. // This is the I2C NAK interrupt. The expected ACK from the slave was not
  167. // received by the IOM.
  168. #define AM_REG_IOMSTR_INTSTAT_NAK_S 4
  169. #define AM_REG_IOMSTR_INTSTAT_NAK_M 0x00000010
  170. #define AM_REG_IOMSTR_INTSTAT_NAK(n) (((uint32_t)(n) << 4) & 0x00000010)
  171. // This is the Write FIFO Overflow interrupt. An attempt was made to write the
  172. // FIFO while it was full (i.e. while FIFOSIZ > 124).
  173. #define AM_REG_IOMSTR_INTSTAT_FOVFL_S 3
  174. #define AM_REG_IOMSTR_INTSTAT_FOVFL_M 0x00000008
  175. #define AM_REG_IOMSTR_INTSTAT_FOVFL(n) (((uint32_t)(n) << 3) & 0x00000008)
  176. // This is the Read FIFO Underflow interrupt. An attempt was made to read FIFO
  177. // when empty (i.e. while FIFOSIZ less than 4).
  178. #define AM_REG_IOMSTR_INTSTAT_FUNDFL_S 2
  179. #define AM_REG_IOMSTR_INTSTAT_FUNDFL_M 0x00000004
  180. #define AM_REG_IOMSTR_INTSTAT_FUNDFL(n) (((uint32_t)(n) << 2) & 0x00000004)
  181. // This is the FIFO Threshold interrupt.
  182. #define AM_REG_IOMSTR_INTSTAT_THR_S 1
  183. #define AM_REG_IOMSTR_INTSTAT_THR_M 0x00000002
  184. #define AM_REG_IOMSTR_INTSTAT_THR(n) (((uint32_t)(n) << 1) & 0x00000002)
  185. // This is the Command Complete interrupt.
  186. #define AM_REG_IOMSTR_INTSTAT_CMDCMP_S 0
  187. #define AM_REG_IOMSTR_INTSTAT_CMDCMP_M 0x00000001
  188. #define AM_REG_IOMSTR_INTSTAT_CMDCMP(n) (((uint32_t)(n) << 0) & 0x00000001)
  189. //*****************************************************************************
  190. //
  191. // IOMSTR_INTCLR - IO Master Interrupts: Clear
  192. //
  193. //*****************************************************************************
  194. // This is the arbitration loss interrupt. This error occurs if another master
  195. // collides with an IO Master transfer. Generally, the IOM started an operation
  196. // but found SDA already low.
  197. #define AM_REG_IOMSTR_INTCLR_ARB_S 10
  198. #define AM_REG_IOMSTR_INTCLR_ARB_M 0x00000400
  199. #define AM_REG_IOMSTR_INTCLR_ARB(n) (((uint32_t)(n) << 10) & 0x00000400)
  200. // This is the STOP command interrupt. A STOP bit was detected by the IOM.
  201. #define AM_REG_IOMSTR_INTCLR_STOP_S 9
  202. #define AM_REG_IOMSTR_INTCLR_STOP_M 0x00000200
  203. #define AM_REG_IOMSTR_INTCLR_STOP(n) (((uint32_t)(n) << 9) & 0x00000200)
  204. // This is the START command interrupt. A START from another master was
  205. // detected. Software must wait for a STOP before proceeding.
  206. #define AM_REG_IOMSTR_INTCLR_START_S 8
  207. #define AM_REG_IOMSTR_INTCLR_START_M 0x00000100
  208. #define AM_REG_IOMSTR_INTCLR_START(n) (((uint32_t)(n) << 8) & 0x00000100)
  209. // This is the illegal command interrupt. Software attempted to issue a CMD
  210. // while another CMD was already in progress. Or an attempt was made to issue a
  211. // non-zero-length write CMD with an empty FIFO.
  212. #define AM_REG_IOMSTR_INTCLR_ICMD_S 7
  213. #define AM_REG_IOMSTR_INTCLR_ICMD_M 0x00000080
  214. #define AM_REG_IOMSTR_INTCLR_ICMD(n) (((uint32_t)(n) << 7) & 0x00000080)
  215. // This is the illegal FIFO access interrupt. An attempt was made to read the
  216. // FIFO during a write CMD. Or an attempt was made to write the FIFO on a read
  217. // CMD.
  218. #define AM_REG_IOMSTR_INTCLR_IACC_S 6
  219. #define AM_REG_IOMSTR_INTCLR_IACC_M 0x00000040
  220. #define AM_REG_IOMSTR_INTCLR_IACC(n) (((uint32_t)(n) << 6) & 0x00000040)
  221. // This is the WTLEN interrupt.
  222. #define AM_REG_IOMSTR_INTCLR_WTLEN_S 5
  223. #define AM_REG_IOMSTR_INTCLR_WTLEN_M 0x00000020
  224. #define AM_REG_IOMSTR_INTCLR_WTLEN(n) (((uint32_t)(n) << 5) & 0x00000020)
  225. // This is the I2C NAK interrupt. The expected ACK from the slave was not
  226. // received by the IOM.
  227. #define AM_REG_IOMSTR_INTCLR_NAK_S 4
  228. #define AM_REG_IOMSTR_INTCLR_NAK_M 0x00000010
  229. #define AM_REG_IOMSTR_INTCLR_NAK(n) (((uint32_t)(n) << 4) & 0x00000010)
  230. // This is the Write FIFO Overflow interrupt. An attempt was made to write the
  231. // FIFO while it was full (i.e. while FIFOSIZ > 124).
  232. #define AM_REG_IOMSTR_INTCLR_FOVFL_S 3
  233. #define AM_REG_IOMSTR_INTCLR_FOVFL_M 0x00000008
  234. #define AM_REG_IOMSTR_INTCLR_FOVFL(n) (((uint32_t)(n) << 3) & 0x00000008)
  235. // This is the Read FIFO Underflow interrupt. An attempt was made to read FIFO
  236. // when empty (i.e. while FIFOSIZ less than 4).
  237. #define AM_REG_IOMSTR_INTCLR_FUNDFL_S 2
  238. #define AM_REG_IOMSTR_INTCLR_FUNDFL_M 0x00000004
  239. #define AM_REG_IOMSTR_INTCLR_FUNDFL(n) (((uint32_t)(n) << 2) & 0x00000004)
  240. // This is the FIFO Threshold interrupt.
  241. #define AM_REG_IOMSTR_INTCLR_THR_S 1
  242. #define AM_REG_IOMSTR_INTCLR_THR_M 0x00000002
  243. #define AM_REG_IOMSTR_INTCLR_THR(n) (((uint32_t)(n) << 1) & 0x00000002)
  244. // This is the Command Complete interrupt.
  245. #define AM_REG_IOMSTR_INTCLR_CMDCMP_S 0
  246. #define AM_REG_IOMSTR_INTCLR_CMDCMP_M 0x00000001
  247. #define AM_REG_IOMSTR_INTCLR_CMDCMP(n) (((uint32_t)(n) << 0) & 0x00000001)
  248. //*****************************************************************************
  249. //
  250. // IOMSTR_INTSET - IO Master Interrupts: Set
  251. //
  252. //*****************************************************************************
  253. // This is the arbitration loss interrupt. This error occurs if another master
  254. // collides with an IO Master transfer. Generally, the IOM started an operation
  255. // but found SDA already low.
  256. #define AM_REG_IOMSTR_INTSET_ARB_S 10
  257. #define AM_REG_IOMSTR_INTSET_ARB_M 0x00000400
  258. #define AM_REG_IOMSTR_INTSET_ARB(n) (((uint32_t)(n) << 10) & 0x00000400)
  259. // This is the STOP command interrupt. A STOP bit was detected by the IOM.
  260. #define AM_REG_IOMSTR_INTSET_STOP_S 9
  261. #define AM_REG_IOMSTR_INTSET_STOP_M 0x00000200
  262. #define AM_REG_IOMSTR_INTSET_STOP(n) (((uint32_t)(n) << 9) & 0x00000200)
  263. // This is the START command interrupt. A START from another master was
  264. // detected. Software must wait for a STOP before proceeding.
  265. #define AM_REG_IOMSTR_INTSET_START_S 8
  266. #define AM_REG_IOMSTR_INTSET_START_M 0x00000100
  267. #define AM_REG_IOMSTR_INTSET_START(n) (((uint32_t)(n) << 8) & 0x00000100)
  268. // This is the illegal command interrupt. Software attempted to issue a CMD
  269. // while another CMD was already in progress. Or an attempt was made to issue a
  270. // non-zero-length write CMD with an empty FIFO.
  271. #define AM_REG_IOMSTR_INTSET_ICMD_S 7
  272. #define AM_REG_IOMSTR_INTSET_ICMD_M 0x00000080
  273. #define AM_REG_IOMSTR_INTSET_ICMD(n) (((uint32_t)(n) << 7) & 0x00000080)
  274. // This is the illegal FIFO access interrupt. An attempt was made to read the
  275. // FIFO during a write CMD. Or an attempt was made to write the FIFO on a read
  276. // CMD.
  277. #define AM_REG_IOMSTR_INTSET_IACC_S 6
  278. #define AM_REG_IOMSTR_INTSET_IACC_M 0x00000040
  279. #define AM_REG_IOMSTR_INTSET_IACC(n) (((uint32_t)(n) << 6) & 0x00000040)
  280. // This is the WTLEN interrupt.
  281. #define AM_REG_IOMSTR_INTSET_WTLEN_S 5
  282. #define AM_REG_IOMSTR_INTSET_WTLEN_M 0x00000020
  283. #define AM_REG_IOMSTR_INTSET_WTLEN(n) (((uint32_t)(n) << 5) & 0x00000020)
  284. // This is the I2C NAK interrupt. The expected ACK from the slave was not
  285. // received by the IOM.
  286. #define AM_REG_IOMSTR_INTSET_NAK_S 4
  287. #define AM_REG_IOMSTR_INTSET_NAK_M 0x00000010
  288. #define AM_REG_IOMSTR_INTSET_NAK(n) (((uint32_t)(n) << 4) & 0x00000010)
  289. // This is the Write FIFO Overflow interrupt. An attempt was made to write the
  290. // FIFO while it was full (i.e. while FIFOSIZ > 124).
  291. #define AM_REG_IOMSTR_INTSET_FOVFL_S 3
  292. #define AM_REG_IOMSTR_INTSET_FOVFL_M 0x00000008
  293. #define AM_REG_IOMSTR_INTSET_FOVFL(n) (((uint32_t)(n) << 3) & 0x00000008)
  294. // This is the Read FIFO Underflow interrupt. An attempt was made to read FIFO
  295. // when empty (i.e. while FIFOSIZ less than 4).
  296. #define AM_REG_IOMSTR_INTSET_FUNDFL_S 2
  297. #define AM_REG_IOMSTR_INTSET_FUNDFL_M 0x00000004
  298. #define AM_REG_IOMSTR_INTSET_FUNDFL(n) (((uint32_t)(n) << 2) & 0x00000004)
  299. // This is the FIFO Threshold interrupt.
  300. #define AM_REG_IOMSTR_INTSET_THR_S 1
  301. #define AM_REG_IOMSTR_INTSET_THR_M 0x00000002
  302. #define AM_REG_IOMSTR_INTSET_THR(n) (((uint32_t)(n) << 1) & 0x00000002)
  303. // This is the Command Complete interrupt.
  304. #define AM_REG_IOMSTR_INTSET_CMDCMP_S 0
  305. #define AM_REG_IOMSTR_INTSET_CMDCMP_M 0x00000001
  306. #define AM_REG_IOMSTR_INTSET_CMDCMP(n) (((uint32_t)(n) << 0) & 0x00000001)
  307. //*****************************************************************************
  308. //
  309. // IOMSTR_FIFO - FIFO Access Port
  310. //
  311. //*****************************************************************************
  312. // FIFO access port.
  313. #define AM_REG_IOMSTR_FIFO_FIFO_S 0
  314. #define AM_REG_IOMSTR_FIFO_FIFO_M 0xFFFFFFFF
  315. #define AM_REG_IOMSTR_FIFO_FIFO(n) (((uint32_t)(n) << 0) & 0xFFFFFFFF)
  316. //*****************************************************************************
  317. //
  318. // IOMSTR_FIFOPTR - Current FIFO Pointers
  319. //
  320. //*****************************************************************************
  321. // The number of bytes remaining in the FIFO (i.e. 128-FIFOSIZ if FULLDUP = 0 or
  322. // 64-FIFOSIZ if FULLDUP = 1)).
  323. #define AM_REG_IOMSTR_FIFOPTR_FIFOREM_S 16
  324. #define AM_REG_IOMSTR_FIFOPTR_FIFOREM_M 0x00FF0000
  325. #define AM_REG_IOMSTR_FIFOPTR_FIFOREM(n) (((uint32_t)(n) << 16) & 0x00FF0000)
  326. // The number of bytes currently in the FIFO.
  327. #define AM_REG_IOMSTR_FIFOPTR_FIFOSIZ_S 0
  328. #define AM_REG_IOMSTR_FIFOPTR_FIFOSIZ_M 0x000000FF
  329. #define AM_REG_IOMSTR_FIFOPTR_FIFOSIZ(n) (((uint32_t)(n) << 0) & 0x000000FF)
  330. //*****************************************************************************
  331. //
  332. // IOMSTR_TLNGTH - Transfer Length
  333. //
  334. //*****************************************************************************
  335. // Remaining transfer length.
  336. #define AM_REG_IOMSTR_TLNGTH_TLNGTH_S 0
  337. #define AM_REG_IOMSTR_TLNGTH_TLNGTH_M 0x00000FFF
  338. #define AM_REG_IOMSTR_TLNGTH_TLNGTH(n) (((uint32_t)(n) << 0) & 0x00000FFF)
  339. //*****************************************************************************
  340. //
  341. // IOMSTR_FIFOTHR - FIFO Threshold Configuration
  342. //
  343. //*****************************************************************************
  344. // FIFO write threshold.
  345. #define AM_REG_IOMSTR_FIFOTHR_FIFOWTHR_S 8
  346. #define AM_REG_IOMSTR_FIFOTHR_FIFOWTHR_M 0x00007F00
  347. #define AM_REG_IOMSTR_FIFOTHR_FIFOWTHR(n) (((uint32_t)(n) << 8) & 0x00007F00)
  348. // FIFO read threshold.
  349. #define AM_REG_IOMSTR_FIFOTHR_FIFORTHR_S 0
  350. #define AM_REG_IOMSTR_FIFOTHR_FIFORTHR_M 0x0000007F
  351. #define AM_REG_IOMSTR_FIFOTHR_FIFORTHR(n) (((uint32_t)(n) << 0) & 0x0000007F)
  352. //*****************************************************************************
  353. //
  354. // IOMSTR_CLKCFG - I/O Clock Configuration
  355. //
  356. //*****************************************************************************
  357. // Clock total count minus 1.
  358. #define AM_REG_IOMSTR_CLKCFG_TOTPER_S 24
  359. #define AM_REG_IOMSTR_CLKCFG_TOTPER_M 0xFF000000
  360. #define AM_REG_IOMSTR_CLKCFG_TOTPER(n) (((uint32_t)(n) << 24) & 0xFF000000)
  361. // Clock low count minus 1.
  362. #define AM_REG_IOMSTR_CLKCFG_LOWPER_S 16
  363. #define AM_REG_IOMSTR_CLKCFG_LOWPER_M 0x00FF0000
  364. #define AM_REG_IOMSTR_CLKCFG_LOWPER(n) (((uint32_t)(n) << 16) & 0x00FF0000)
  365. // Enable clock division by TOTPER.
  366. #define AM_REG_IOMSTR_CLKCFG_DIVEN_S 12
  367. #define AM_REG_IOMSTR_CLKCFG_DIVEN_M 0x00001000
  368. #define AM_REG_IOMSTR_CLKCFG_DIVEN(n) (((uint32_t)(n) << 12) & 0x00001000)
  369. #define AM_REG_IOMSTR_CLKCFG_DIVEN_DIS 0x00000000
  370. #define AM_REG_IOMSTR_CLKCFG_DIVEN_EN 0x00001000
  371. // Enable divide by 3.
  372. #define AM_REG_IOMSTR_CLKCFG_DIV3_S 11
  373. #define AM_REG_IOMSTR_CLKCFG_DIV3_M 0x00000800
  374. #define AM_REG_IOMSTR_CLKCFG_DIV3(n) (((uint32_t)(n) << 11) & 0x00000800)
  375. #define AM_REG_IOMSTR_CLKCFG_DIV3_DIS 0x00000000
  376. #define AM_REG_IOMSTR_CLKCFG_DIV3_EN 0x00000800
  377. // Select the input clock frequency.
  378. #define AM_REG_IOMSTR_CLKCFG_FSEL_S 8
  379. #define AM_REG_IOMSTR_CLKCFG_FSEL_M 0x00000700
  380. #define AM_REG_IOMSTR_CLKCFG_FSEL(n) (((uint32_t)(n) << 8) & 0x00000700)
  381. #define AM_REG_IOMSTR_CLKCFG_FSEL_MIN_PWR 0x00000000
  382. #define AM_REG_IOMSTR_CLKCFG_FSEL_HFRC 0x00000100
  383. #define AM_REG_IOMSTR_CLKCFG_FSEL_HFRC_DIV2 0x00000200
  384. #define AM_REG_IOMSTR_CLKCFG_FSEL_HFRC_DIV4 0x00000300
  385. #define AM_REG_IOMSTR_CLKCFG_FSEL_HFRC_DIV8 0x00000400
  386. #define AM_REG_IOMSTR_CLKCFG_FSEL_HFRC_DIV16 0x00000500
  387. #define AM_REG_IOMSTR_CLKCFG_FSEL_HFRC_DIV32 0x00000600
  388. #define AM_REG_IOMSTR_CLKCFG_FSEL_HFRC_DIV64 0x00000700
  389. //*****************************************************************************
  390. //
  391. // IOMSTR_CMD - Command Register
  392. //
  393. //*****************************************************************************
  394. // This register holds the I/O Command
  395. #define AM_REG_IOMSTR_CMD_CMD_S 0
  396. #define AM_REG_IOMSTR_CMD_CMD_M 0xFFFFFFFF
  397. #define AM_REG_IOMSTR_CMD_CMD(n) (((uint32_t)(n) << 0) & 0xFFFFFFFF)
  398. //*****************************************************************************
  399. //
  400. // IOMSTR_CMDRPT - Command Repeat Register
  401. //
  402. //*****************************************************************************
  403. // These bits hold the Command repeat count.
  404. #define AM_REG_IOMSTR_CMDRPT_CMDRPT_S 0
  405. #define AM_REG_IOMSTR_CMDRPT_CMDRPT_M 0x0000001F
  406. #define AM_REG_IOMSTR_CMDRPT_CMDRPT(n) (((uint32_t)(n) << 0) & 0x0000001F)
  407. //*****************************************************************************
  408. //
  409. // IOMSTR_STATUS - Status Register
  410. //
  411. //*****************************************************************************
  412. // This bit indicates if the I/O state machine is IDLE.
  413. #define AM_REG_IOMSTR_STATUS_IDLEST_S 2
  414. #define AM_REG_IOMSTR_STATUS_IDLEST_M 0x00000004
  415. #define AM_REG_IOMSTR_STATUS_IDLEST(n) (((uint32_t)(n) << 2) & 0x00000004)
  416. #define AM_REG_IOMSTR_STATUS_IDLEST_IDLE 0x00000004
  417. // This bit indicates if the I/O Command is active.
  418. #define AM_REG_IOMSTR_STATUS_CMDACT_S 1
  419. #define AM_REG_IOMSTR_STATUS_CMDACT_M 0x00000002
  420. #define AM_REG_IOMSTR_STATUS_CMDACT(n) (((uint32_t)(n) << 1) & 0x00000002)
  421. #define AM_REG_IOMSTR_STATUS_CMDACT_ACTIVE 0x00000002
  422. // This bit indicates if an error interrupt has occurred.
  423. #define AM_REG_IOMSTR_STATUS_ERR_S 0
  424. #define AM_REG_IOMSTR_STATUS_ERR_M 0x00000001
  425. #define AM_REG_IOMSTR_STATUS_ERR(n) (((uint32_t)(n) << 0) & 0x00000001)
  426. #define AM_REG_IOMSTR_STATUS_ERR_ERROR 0x00000001
  427. //*****************************************************************************
  428. //
  429. // IOMSTR_CFG - I/O Master Configuration
  430. //
  431. //*****************************************************************************
  432. // This bit enables the IO Master.
  433. #define AM_REG_IOMSTR_CFG_IFCEN_S 31
  434. #define AM_REG_IOMSTR_CFG_IFCEN_M 0x80000000
  435. #define AM_REG_IOMSTR_CFG_IFCEN(n) (((uint32_t)(n) << 31) & 0x80000000)
  436. #define AM_REG_IOMSTR_CFG_IFCEN_DIS 0x00000000
  437. #define AM_REG_IOMSTR_CFG_IFCEN_EN 0x80000000
  438. // This bit selects the read flow control signal polarity.
  439. #define AM_REG_IOMSTR_CFG_RDFCPOL_S 14
  440. #define AM_REG_IOMSTR_CFG_RDFCPOL_M 0x00004000
  441. #define AM_REG_IOMSTR_CFG_RDFCPOL(n) (((uint32_t)(n) << 14) & 0x00004000)
  442. #define AM_REG_IOMSTR_CFG_RDFCPOL_HIGH 0x00000000
  443. #define AM_REG_IOMSTR_CFG_RDFCPOL_LOW 0x00004000
  444. // This bit selects the write flow control signal polarity.
  445. #define AM_REG_IOMSTR_CFG_WTFCPOL_S 13
  446. #define AM_REG_IOMSTR_CFG_WTFCPOL_M 0x00002000
  447. #define AM_REG_IOMSTR_CFG_WTFCPOL(n) (((uint32_t)(n) << 13) & 0x00002000)
  448. #define AM_REG_IOMSTR_CFG_WTFCPOL_HIGH 0x00000000
  449. #define AM_REG_IOMSTR_CFG_WTFCPOL_LOW 0x00002000
  450. // This bit selects the write mode flow control signal.
  451. #define AM_REG_IOMSTR_CFG_WTFCIRQ_S 12
  452. #define AM_REG_IOMSTR_CFG_WTFCIRQ_M 0x00001000
  453. #define AM_REG_IOMSTR_CFG_WTFCIRQ(n) (((uint32_t)(n) << 12) & 0x00001000)
  454. #define AM_REG_IOMSTR_CFG_WTFCIRQ_MISO 0x00000000
  455. #define AM_REG_IOMSTR_CFG_WTFCIRQ_IRQ 0x00001000
  456. // This bit must be left at the default value of 0.
  457. #define AM_REG_IOMSTR_CFG_FCDEL_S 11
  458. #define AM_REG_IOMSTR_CFG_FCDEL_M 0x00000800
  459. #define AM_REG_IOMSTR_CFG_FCDEL(n) (((uint32_t)(n) << 11) & 0x00000800)
  460. // This bit invewrts MOSI when flow control is enabled.
  461. #define AM_REG_IOMSTR_CFG_MOSIINV_S 10
  462. #define AM_REG_IOMSTR_CFG_MOSIINV_M 0x00000400
  463. #define AM_REG_IOMSTR_CFG_MOSIINV(n) (((uint32_t)(n) << 10) & 0x00000400)
  464. #define AM_REG_IOMSTR_CFG_MOSIINV_NORMAL 0x00000000
  465. #define AM_REG_IOMSTR_CFG_MOSIINV_INVERT 0x00000400
  466. // This bit enables read mode flow control.
  467. #define AM_REG_IOMSTR_CFG_RDFC_S 9
  468. #define AM_REG_IOMSTR_CFG_RDFC_M 0x00000200
  469. #define AM_REG_IOMSTR_CFG_RDFC(n) (((uint32_t)(n) << 9) & 0x00000200)
  470. #define AM_REG_IOMSTR_CFG_RDFC_DIS 0x00000000
  471. #define AM_REG_IOMSTR_CFG_RDFC_EN 0x00000200
  472. // This bit enables write mode flow control.
  473. #define AM_REG_IOMSTR_CFG_WTFC_S 8
  474. #define AM_REG_IOMSTR_CFG_WTFC_M 0x00000100
  475. #define AM_REG_IOMSTR_CFG_WTFC(n) (((uint32_t)(n) << 8) & 0x00000100)
  476. #define AM_REG_IOMSTR_CFG_WTFC_DIS 0x00000000
  477. #define AM_REG_IOMSTR_CFG_WTFC_EN 0x00000100
  478. // This bit selects the preread timing.
  479. #define AM_REG_IOMSTR_CFG_STARTRD_S 4
  480. #define AM_REG_IOMSTR_CFG_STARTRD_M 0x00000030
  481. #define AM_REG_IOMSTR_CFG_STARTRD(n) (((uint32_t)(n) << 4) & 0x00000030)
  482. #define AM_REG_IOMSTR_CFG_STARTRD_PRERD0 0x00000000
  483. #define AM_REG_IOMSTR_CFG_STARTRD_PRERD1 0x00000010
  484. #define AM_REG_IOMSTR_CFG_STARTRD_PRERD2 0x00000020
  485. #define AM_REG_IOMSTR_CFG_STARTRD_PRERD3 0x00000030
  486. // This bit selects full duplex mode.
  487. #define AM_REG_IOMSTR_CFG_FULLDUP_S 3
  488. #define AM_REG_IOMSTR_CFG_FULLDUP_M 0x00000008
  489. #define AM_REG_IOMSTR_CFG_FULLDUP(n) (((uint32_t)(n) << 3) & 0x00000008)
  490. #define AM_REG_IOMSTR_CFG_FULLDUP_NORMAL 0x00000000
  491. #define AM_REG_IOMSTR_CFG_FULLDUP_FULLDUP 0x00000008
  492. // This bit selects SPI phase.
  493. #define AM_REG_IOMSTR_CFG_SPHA_S 2
  494. #define AM_REG_IOMSTR_CFG_SPHA_M 0x00000004
  495. #define AM_REG_IOMSTR_CFG_SPHA(n) (((uint32_t)(n) << 2) & 0x00000004)
  496. #define AM_REG_IOMSTR_CFG_SPHA_SAMPLE_LEADING_EDGE 0x00000000
  497. #define AM_REG_IOMSTR_CFG_SPHA_SAMPLE_TRAILING_EDGE 0x00000004
  498. // This bit selects SPI polarity.
  499. #define AM_REG_IOMSTR_CFG_SPOL_S 1
  500. #define AM_REG_IOMSTR_CFG_SPOL_M 0x00000002
  501. #define AM_REG_IOMSTR_CFG_SPOL(n) (((uint32_t)(n) << 1) & 0x00000002)
  502. #define AM_REG_IOMSTR_CFG_SPOL_CLK_BASE_0 0x00000000
  503. #define AM_REG_IOMSTR_CFG_SPOL_CLK_BASE_1 0x00000002
  504. // This bit selects the I/O interface.
  505. #define AM_REG_IOMSTR_CFG_IFCSEL_S 0
  506. #define AM_REG_IOMSTR_CFG_IFCSEL_M 0x00000001
  507. #define AM_REG_IOMSTR_CFG_IFCSEL(n) (((uint32_t)(n) << 0) & 0x00000001)
  508. #define AM_REG_IOMSTR_CFG_IFCSEL_I2C 0x00000000
  509. #define AM_REG_IOMSTR_CFG_IFCSEL_SPI 0x00000001
  510. #endif // AM_REG_IOMSTR_H