am_reg_uart.h 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612
  1. //*****************************************************************************
  2. //
  3. // am_reg_uart.h
  4. //! @file
  5. //!
  6. //! @brief Register macros for the UART 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_UART_H
  44. #define AM_REG_UART_H
  45. //*****************************************************************************
  46. //
  47. // Instance finder. (2 instance(s) available)
  48. //
  49. //*****************************************************************************
  50. #define AM_REG_UART_NUM_MODULES 2
  51. #define AM_REG_UARTn(n) \
  52. (REG_UART_BASEADDR + 0x00001000 * n)
  53. //*****************************************************************************
  54. //
  55. // Register offsets.
  56. //
  57. //*****************************************************************************
  58. #define AM_REG_UART_DR_O 0x00000000
  59. #define AM_REG_UART_RSR_O 0x00000004
  60. #define AM_REG_UART_FR_O 0x00000018
  61. #define AM_REG_UART_ILPR_O 0x00000020
  62. #define AM_REG_UART_IBRD_O 0x00000024
  63. #define AM_REG_UART_FBRD_O 0x00000028
  64. #define AM_REG_UART_LCRH_O 0x0000002C
  65. #define AM_REG_UART_CR_O 0x00000030
  66. #define AM_REG_UART_IFLS_O 0x00000034
  67. #define AM_REG_UART_IER_O 0x00000038
  68. #define AM_REG_UART_IES_O 0x0000003C
  69. #define AM_REG_UART_MIS_O 0x00000040
  70. #define AM_REG_UART_IEC_O 0x00000044
  71. //*****************************************************************************
  72. //
  73. // UART_DR - UART Data Register
  74. //
  75. //*****************************************************************************
  76. // This is the overrun error indicator.
  77. #define AM_REG_UART_DR_OEDATA_S 11
  78. #define AM_REG_UART_DR_OEDATA_M 0x00000800
  79. #define AM_REG_UART_DR_OEDATA(n) (((uint32_t)(n) << 11) & 0x00000800)
  80. #define AM_REG_UART_DR_OEDATA_NOERR 0x00000000
  81. #define AM_REG_UART_DR_OEDATA_ERR 0x00000800
  82. // This is the break error indicator.
  83. #define AM_REG_UART_DR_BEDATA_S 10
  84. #define AM_REG_UART_DR_BEDATA_M 0x00000400
  85. #define AM_REG_UART_DR_BEDATA(n) (((uint32_t)(n) << 10) & 0x00000400)
  86. #define AM_REG_UART_DR_BEDATA_NOERR 0x00000000
  87. #define AM_REG_UART_DR_BEDATA_ERR 0x00000400
  88. // This is the parity error indicator.
  89. #define AM_REG_UART_DR_PEDATA_S 9
  90. #define AM_REG_UART_DR_PEDATA_M 0x00000200
  91. #define AM_REG_UART_DR_PEDATA(n) (((uint32_t)(n) << 9) & 0x00000200)
  92. #define AM_REG_UART_DR_PEDATA_NOERR 0x00000000
  93. #define AM_REG_UART_DR_PEDATA_ERR 0x00000200
  94. // This is the framing error indicator.
  95. #define AM_REG_UART_DR_FEDATA_S 8
  96. #define AM_REG_UART_DR_FEDATA_M 0x00000100
  97. #define AM_REG_UART_DR_FEDATA(n) (((uint32_t)(n) << 8) & 0x00000100)
  98. #define AM_REG_UART_DR_FEDATA_NOERR 0x00000000
  99. #define AM_REG_UART_DR_FEDATA_ERR 0x00000100
  100. // This is the UART data port.
  101. #define AM_REG_UART_DR_DATA_S 0
  102. #define AM_REG_UART_DR_DATA_M 0x000000FF
  103. #define AM_REG_UART_DR_DATA(n) (((uint32_t)(n) << 0) & 0x000000FF)
  104. //*****************************************************************************
  105. //
  106. // UART_RSR - UART Status Register
  107. //
  108. //*****************************************************************************
  109. // This is the overrun error indicator.
  110. #define AM_REG_UART_RSR_OESTAT_S 3
  111. #define AM_REG_UART_RSR_OESTAT_M 0x00000008
  112. #define AM_REG_UART_RSR_OESTAT(n) (((uint32_t)(n) << 3) & 0x00000008)
  113. #define AM_REG_UART_RSR_OESTAT_NOERR 0x00000000
  114. #define AM_REG_UART_RSR_OESTAT_ERR 0x00000008
  115. // This is the break error indicator.
  116. #define AM_REG_UART_RSR_BESTAT_S 2
  117. #define AM_REG_UART_RSR_BESTAT_M 0x00000004
  118. #define AM_REG_UART_RSR_BESTAT(n) (((uint32_t)(n) << 2) & 0x00000004)
  119. #define AM_REG_UART_RSR_BESTAT_NOERR 0x00000000
  120. #define AM_REG_UART_RSR_BESTAT_ERR 0x00000004
  121. // This is the parity error indicator.
  122. #define AM_REG_UART_RSR_PESTAT_S 1
  123. #define AM_REG_UART_RSR_PESTAT_M 0x00000002
  124. #define AM_REG_UART_RSR_PESTAT(n) (((uint32_t)(n) << 1) & 0x00000002)
  125. #define AM_REG_UART_RSR_PESTAT_NOERR 0x00000000
  126. #define AM_REG_UART_RSR_PESTAT_ERR 0x00000002
  127. // This is the framing error indicator.
  128. #define AM_REG_UART_RSR_FESTAT_S 0
  129. #define AM_REG_UART_RSR_FESTAT_M 0x00000001
  130. #define AM_REG_UART_RSR_FESTAT(n) (((uint32_t)(n) << 0) & 0x00000001)
  131. #define AM_REG_UART_RSR_FESTAT_NOERR 0x00000000
  132. #define AM_REG_UART_RSR_FESTAT_ERR 0x00000001
  133. //*****************************************************************************
  134. //
  135. // UART_FR - Flag Register
  136. //
  137. //*****************************************************************************
  138. // This bit holds the transmit BUSY indicator.
  139. #define AM_REG_UART_FR_TXBUSY_S 8
  140. #define AM_REG_UART_FR_TXBUSY_M 0x00000100
  141. #define AM_REG_UART_FR_TXBUSY(n) (((uint32_t)(n) << 8) & 0x00000100)
  142. // This bit holds the transmit FIFO empty indicator.
  143. #define AM_REG_UART_FR_TXFE_S 7
  144. #define AM_REG_UART_FR_TXFE_M 0x00000080
  145. #define AM_REG_UART_FR_TXFE(n) (((uint32_t)(n) << 7) & 0x00000080)
  146. #define AM_REG_UART_FR_TXFE_XMTFIFO_EMPTY 0x00000080
  147. // This bit holds the receive FIFO full indicator.
  148. #define AM_REG_UART_FR_RXFF_S 6
  149. #define AM_REG_UART_FR_RXFF_M 0x00000040
  150. #define AM_REG_UART_FR_RXFF(n) (((uint32_t)(n) << 6) & 0x00000040)
  151. #define AM_REG_UART_FR_RXFF_RCVFIFO_FULL 0x00000040
  152. // This bit holds the transmit FIFO full indicator.
  153. #define AM_REG_UART_FR_TXFF_S 5
  154. #define AM_REG_UART_FR_TXFF_M 0x00000020
  155. #define AM_REG_UART_FR_TXFF(n) (((uint32_t)(n) << 5) & 0x00000020)
  156. #define AM_REG_UART_FR_TXFF_XMTFIFO_FULL 0x00000020
  157. // This bit holds the receive FIFO empty indicator.
  158. #define AM_REG_UART_FR_RXFE_S 4
  159. #define AM_REG_UART_FR_RXFE_M 0x00000010
  160. #define AM_REG_UART_FR_RXFE(n) (((uint32_t)(n) << 4) & 0x00000010)
  161. #define AM_REG_UART_FR_RXFE_RCVFIFO_EMPTY 0x00000010
  162. // This bit holds the busy indicator.
  163. #define AM_REG_UART_FR_BUSY_S 3
  164. #define AM_REG_UART_FR_BUSY_M 0x00000008
  165. #define AM_REG_UART_FR_BUSY(n) (((uint32_t)(n) << 3) & 0x00000008)
  166. #define AM_REG_UART_FR_BUSY_BUSY 0x00000008
  167. // This bit holds the data carrier detect indicator.
  168. #define AM_REG_UART_FR_DCD_S 2
  169. #define AM_REG_UART_FR_DCD_M 0x00000004
  170. #define AM_REG_UART_FR_DCD(n) (((uint32_t)(n) << 2) & 0x00000004)
  171. #define AM_REG_UART_FR_DCD_DETECTED 0x00000004
  172. // This bit holds the data set ready indicator.
  173. #define AM_REG_UART_FR_DSR_S 1
  174. #define AM_REG_UART_FR_DSR_M 0x00000002
  175. #define AM_REG_UART_FR_DSR(n) (((uint32_t)(n) << 1) & 0x00000002)
  176. #define AM_REG_UART_FR_DSR_READY 0x00000002
  177. // This bit holds the clear to send indicator.
  178. #define AM_REG_UART_FR_CTS_S 0
  179. #define AM_REG_UART_FR_CTS_M 0x00000001
  180. #define AM_REG_UART_FR_CTS(n) (((uint32_t)(n) << 0) & 0x00000001)
  181. #define AM_REG_UART_FR_CTS_CLEARTOSEND 0x00000001
  182. //*****************************************************************************
  183. //
  184. // UART_ILPR - IrDA Counter
  185. //
  186. //*****************************************************************************
  187. // These bits hold the IrDA counter divisor.
  188. #define AM_REG_UART_ILPR_ILPDVSR_S 0
  189. #define AM_REG_UART_ILPR_ILPDVSR_M 0x000000FF
  190. #define AM_REG_UART_ILPR_ILPDVSR(n) (((uint32_t)(n) << 0) & 0x000000FF)
  191. //*****************************************************************************
  192. //
  193. // UART_IBRD - Integer Baud Rate Divisor
  194. //
  195. //*****************************************************************************
  196. // These bits hold the baud integer divisor.
  197. #define AM_REG_UART_IBRD_DIVINT_S 0
  198. #define AM_REG_UART_IBRD_DIVINT_M 0x0000FFFF
  199. #define AM_REG_UART_IBRD_DIVINT(n) (((uint32_t)(n) << 0) & 0x0000FFFF)
  200. //*****************************************************************************
  201. //
  202. // UART_FBRD - Fractional Baud Rate Divisor
  203. //
  204. //*****************************************************************************
  205. // These bits hold the baud fractional divisor.
  206. #define AM_REG_UART_FBRD_DIVFRAC_S 0
  207. #define AM_REG_UART_FBRD_DIVFRAC_M 0x0000003F
  208. #define AM_REG_UART_FBRD_DIVFRAC(n) (((uint32_t)(n) << 0) & 0x0000003F)
  209. //*****************************************************************************
  210. //
  211. // UART_LCRH - Line Control High
  212. //
  213. //*****************************************************************************
  214. // This bit holds the stick parity select.
  215. #define AM_REG_UART_LCRH_SPS_S 7
  216. #define AM_REG_UART_LCRH_SPS_M 0x00000080
  217. #define AM_REG_UART_LCRH_SPS(n) (((uint32_t)(n) << 7) & 0x00000080)
  218. // These bits hold the write length.
  219. #define AM_REG_UART_LCRH_WLEN_S 5
  220. #define AM_REG_UART_LCRH_WLEN_M 0x00000060
  221. #define AM_REG_UART_LCRH_WLEN(n) (((uint32_t)(n) << 5) & 0x00000060)
  222. // This bit holds the FIFO enable.
  223. #define AM_REG_UART_LCRH_FEN_S 4
  224. #define AM_REG_UART_LCRH_FEN_M 0x00000010
  225. #define AM_REG_UART_LCRH_FEN(n) (((uint32_t)(n) << 4) & 0x00000010)
  226. // This bit holds the two stop bits select.
  227. #define AM_REG_UART_LCRH_STP2_S 3
  228. #define AM_REG_UART_LCRH_STP2_M 0x00000008
  229. #define AM_REG_UART_LCRH_STP2(n) (((uint32_t)(n) << 3) & 0x00000008)
  230. // This bit holds the even parity select.
  231. #define AM_REG_UART_LCRH_EPS_S 2
  232. #define AM_REG_UART_LCRH_EPS_M 0x00000004
  233. #define AM_REG_UART_LCRH_EPS(n) (((uint32_t)(n) << 2) & 0x00000004)
  234. // This bit holds the parity enable.
  235. #define AM_REG_UART_LCRH_PEN_S 1
  236. #define AM_REG_UART_LCRH_PEN_M 0x00000002
  237. #define AM_REG_UART_LCRH_PEN(n) (((uint32_t)(n) << 1) & 0x00000002)
  238. // This bit holds the break set.
  239. #define AM_REG_UART_LCRH_BRK_S 0
  240. #define AM_REG_UART_LCRH_BRK_M 0x00000001
  241. #define AM_REG_UART_LCRH_BRK(n) (((uint32_t)(n) << 0) & 0x00000001)
  242. //*****************************************************************************
  243. //
  244. // UART_CR - Control Register
  245. //
  246. //*****************************************************************************
  247. // This bit enables CTS hardware flow control.
  248. #define AM_REG_UART_CR_CTSEN_S 15
  249. #define AM_REG_UART_CR_CTSEN_M 0x00008000
  250. #define AM_REG_UART_CR_CTSEN(n) (((uint32_t)(n) << 15) & 0x00008000)
  251. // This bit enables RTS hardware flow control.
  252. #define AM_REG_UART_CR_RTSEN_S 14
  253. #define AM_REG_UART_CR_RTSEN_M 0x00004000
  254. #define AM_REG_UART_CR_RTSEN(n) (((uint32_t)(n) << 14) & 0x00004000)
  255. // This bit holds modem Out2.
  256. #define AM_REG_UART_CR_OUT2_S 13
  257. #define AM_REG_UART_CR_OUT2_M 0x00002000
  258. #define AM_REG_UART_CR_OUT2(n) (((uint32_t)(n) << 13) & 0x00002000)
  259. // This bit holds modem Out1.
  260. #define AM_REG_UART_CR_OUT1_S 12
  261. #define AM_REG_UART_CR_OUT1_M 0x00001000
  262. #define AM_REG_UART_CR_OUT1(n) (((uint32_t)(n) << 12) & 0x00001000)
  263. // This bit enables request to send.
  264. #define AM_REG_UART_CR_RTS_S 11
  265. #define AM_REG_UART_CR_RTS_M 0x00000800
  266. #define AM_REG_UART_CR_RTS(n) (((uint32_t)(n) << 11) & 0x00000800)
  267. // This bit enables data transmit ready.
  268. #define AM_REG_UART_CR_DTR_S 10
  269. #define AM_REG_UART_CR_DTR_M 0x00000400
  270. #define AM_REG_UART_CR_DTR(n) (((uint32_t)(n) << 10) & 0x00000400)
  271. // This bit is the receive enable.
  272. #define AM_REG_UART_CR_RXE_S 9
  273. #define AM_REG_UART_CR_RXE_M 0x00000200
  274. #define AM_REG_UART_CR_RXE(n) (((uint32_t)(n) << 9) & 0x00000200)
  275. // This bit is the transmit enable.
  276. #define AM_REG_UART_CR_TXE_S 8
  277. #define AM_REG_UART_CR_TXE_M 0x00000100
  278. #define AM_REG_UART_CR_TXE(n) (((uint32_t)(n) << 8) & 0x00000100)
  279. // This bit is the loopback enable.
  280. #define AM_REG_UART_CR_LBE_S 7
  281. #define AM_REG_UART_CR_LBE_M 0x00000080
  282. #define AM_REG_UART_CR_LBE(n) (((uint32_t)(n) << 7) & 0x00000080)
  283. // This bitfield is the UART clock select.
  284. #define AM_REG_UART_CR_CLKSEL_S 4
  285. #define AM_REG_UART_CR_CLKSEL_M 0x00000070
  286. #define AM_REG_UART_CR_CLKSEL(n) (((uint32_t)(n) << 4) & 0x00000070)
  287. #define AM_REG_UART_CR_CLKSEL_NOCLK 0x00000000
  288. #define AM_REG_UART_CR_CLKSEL_24MHZ 0x00000010
  289. #define AM_REG_UART_CR_CLKSEL_12MHZ 0x00000020
  290. #define AM_REG_UART_CR_CLKSEL_6MHZ 0x00000030
  291. #define AM_REG_UART_CR_CLKSEL_3MHZ 0x00000040
  292. #define AM_REG_UART_CR_CLKSEL_RSVD5 0x00000050
  293. #define AM_REG_UART_CR_CLKSEL_RSVD6 0x00000060
  294. #define AM_REG_UART_CR_CLKSEL_RSVD7 0x00000070
  295. // This bit is the UART clock enable.
  296. #define AM_REG_UART_CR_CLKEN_S 3
  297. #define AM_REG_UART_CR_CLKEN_M 0x00000008
  298. #define AM_REG_UART_CR_CLKEN(n) (((uint32_t)(n) << 3) & 0x00000008)
  299. // This bit is the SIR low power select.
  300. #define AM_REG_UART_CR_SIRLP_S 2
  301. #define AM_REG_UART_CR_SIRLP_M 0x00000004
  302. #define AM_REG_UART_CR_SIRLP(n) (((uint32_t)(n) << 2) & 0x00000004)
  303. // This bit is the SIR ENDEC enable.
  304. #define AM_REG_UART_CR_SIREN_S 1
  305. #define AM_REG_UART_CR_SIREN_M 0x00000002
  306. #define AM_REG_UART_CR_SIREN(n) (((uint32_t)(n) << 1) & 0x00000002)
  307. // This bit is the UART enable.
  308. #define AM_REG_UART_CR_UARTEN_S 0
  309. #define AM_REG_UART_CR_UARTEN_M 0x00000001
  310. #define AM_REG_UART_CR_UARTEN(n) (((uint32_t)(n) << 0) & 0x00000001)
  311. //*****************************************************************************
  312. //
  313. // UART_IFLS - FIFO Interrupt Level Select
  314. //
  315. //*****************************************************************************
  316. // These bits hold the receive FIFO interrupt level.
  317. #define AM_REG_UART_IFLS_RXIFLSEL_S 3
  318. #define AM_REG_UART_IFLS_RXIFLSEL_M 0x00000038
  319. #define AM_REG_UART_IFLS_RXIFLSEL(n) (((uint32_t)(n) << 3) & 0x00000038)
  320. // These bits hold the transmit FIFO interrupt level.
  321. #define AM_REG_UART_IFLS_TXIFLSEL_S 0
  322. #define AM_REG_UART_IFLS_TXIFLSEL_M 0x00000007
  323. #define AM_REG_UART_IFLS_TXIFLSEL(n) (((uint32_t)(n) << 0) & 0x00000007)
  324. //*****************************************************************************
  325. //
  326. // UART_IER - Interrupt Enable
  327. //
  328. //*****************************************************************************
  329. // This bit holds the overflow interrupt enable.
  330. #define AM_REG_UART_IER_OEIM_S 10
  331. #define AM_REG_UART_IER_OEIM_M 0x00000400
  332. #define AM_REG_UART_IER_OEIM(n) (((uint32_t)(n) << 10) & 0x00000400)
  333. // This bit holds the break error interrupt enable.
  334. #define AM_REG_UART_IER_BEIM_S 9
  335. #define AM_REG_UART_IER_BEIM_M 0x00000200
  336. #define AM_REG_UART_IER_BEIM(n) (((uint32_t)(n) << 9) & 0x00000200)
  337. // This bit holds the parity error interrupt enable.
  338. #define AM_REG_UART_IER_PEIM_S 8
  339. #define AM_REG_UART_IER_PEIM_M 0x00000100
  340. #define AM_REG_UART_IER_PEIM(n) (((uint32_t)(n) << 8) & 0x00000100)
  341. // This bit holds the framing error interrupt enable.
  342. #define AM_REG_UART_IER_FEIM_S 7
  343. #define AM_REG_UART_IER_FEIM_M 0x00000080
  344. #define AM_REG_UART_IER_FEIM(n) (((uint32_t)(n) << 7) & 0x00000080)
  345. // This bit holds the receive timeout interrupt enable.
  346. #define AM_REG_UART_IER_RTIM_S 6
  347. #define AM_REG_UART_IER_RTIM_M 0x00000040
  348. #define AM_REG_UART_IER_RTIM(n) (((uint32_t)(n) << 6) & 0x00000040)
  349. // This bit holds the transmit interrupt enable.
  350. #define AM_REG_UART_IER_TXIM_S 5
  351. #define AM_REG_UART_IER_TXIM_M 0x00000020
  352. #define AM_REG_UART_IER_TXIM(n) (((uint32_t)(n) << 5) & 0x00000020)
  353. // This bit holds the receive interrupt enable.
  354. #define AM_REG_UART_IER_RXIM_S 4
  355. #define AM_REG_UART_IER_RXIM_M 0x00000010
  356. #define AM_REG_UART_IER_RXIM(n) (((uint32_t)(n) << 4) & 0x00000010)
  357. // This bit holds the modem DSR interrupt enable.
  358. #define AM_REG_UART_IER_DSRMIM_S 3
  359. #define AM_REG_UART_IER_DSRMIM_M 0x00000008
  360. #define AM_REG_UART_IER_DSRMIM(n) (((uint32_t)(n) << 3) & 0x00000008)
  361. // This bit holds the modem DCD interrupt enable.
  362. #define AM_REG_UART_IER_DCDMIM_S 2
  363. #define AM_REG_UART_IER_DCDMIM_M 0x00000004
  364. #define AM_REG_UART_IER_DCDMIM(n) (((uint32_t)(n) << 2) & 0x00000004)
  365. // This bit holds the modem CTS interrupt enable.
  366. #define AM_REG_UART_IER_CTSMIM_S 1
  367. #define AM_REG_UART_IER_CTSMIM_M 0x00000002
  368. #define AM_REG_UART_IER_CTSMIM(n) (((uint32_t)(n) << 1) & 0x00000002)
  369. // This bit holds the modem TXCMP interrupt enable.
  370. #define AM_REG_UART_IER_TXCMPMIM_S 0
  371. #define AM_REG_UART_IER_TXCMPMIM_M 0x00000001
  372. #define AM_REG_UART_IER_TXCMPMIM(n) (((uint32_t)(n) << 0) & 0x00000001)
  373. //*****************************************************************************
  374. //
  375. // UART_IES - Interrupt Status
  376. //
  377. //*****************************************************************************
  378. // This bit holds the overflow interrupt status.
  379. #define AM_REG_UART_IES_OERIS_S 10
  380. #define AM_REG_UART_IES_OERIS_M 0x00000400
  381. #define AM_REG_UART_IES_OERIS(n) (((uint32_t)(n) << 10) & 0x00000400)
  382. // This bit holds the break error interrupt status.
  383. #define AM_REG_UART_IES_BERIS_S 9
  384. #define AM_REG_UART_IES_BERIS_M 0x00000200
  385. #define AM_REG_UART_IES_BERIS(n) (((uint32_t)(n) << 9) & 0x00000200)
  386. // This bit holds the parity error interrupt status.
  387. #define AM_REG_UART_IES_PERIS_S 8
  388. #define AM_REG_UART_IES_PERIS_M 0x00000100
  389. #define AM_REG_UART_IES_PERIS(n) (((uint32_t)(n) << 8) & 0x00000100)
  390. // This bit holds the framing error interrupt status.
  391. #define AM_REG_UART_IES_FERIS_S 7
  392. #define AM_REG_UART_IES_FERIS_M 0x00000080
  393. #define AM_REG_UART_IES_FERIS(n) (((uint32_t)(n) << 7) & 0x00000080)
  394. // This bit holds the receive timeout interrupt status.
  395. #define AM_REG_UART_IES_RTRIS_S 6
  396. #define AM_REG_UART_IES_RTRIS_M 0x00000040
  397. #define AM_REG_UART_IES_RTRIS(n) (((uint32_t)(n) << 6) & 0x00000040)
  398. // This bit holds the transmit interrupt status.
  399. #define AM_REG_UART_IES_TXRIS_S 5
  400. #define AM_REG_UART_IES_TXRIS_M 0x00000020
  401. #define AM_REG_UART_IES_TXRIS(n) (((uint32_t)(n) << 5) & 0x00000020)
  402. // This bit holds the receive interrupt status.
  403. #define AM_REG_UART_IES_RXRIS_S 4
  404. #define AM_REG_UART_IES_RXRIS_M 0x00000010
  405. #define AM_REG_UART_IES_RXRIS(n) (((uint32_t)(n) << 4) & 0x00000010)
  406. // This bit holds the modem DSR interrupt status.
  407. #define AM_REG_UART_IES_DSRMRIS_S 3
  408. #define AM_REG_UART_IES_DSRMRIS_M 0x00000008
  409. #define AM_REG_UART_IES_DSRMRIS(n) (((uint32_t)(n) << 3) & 0x00000008)
  410. // This bit holds the modem DCD interrupt status.
  411. #define AM_REG_UART_IES_DCDMRIS_S 2
  412. #define AM_REG_UART_IES_DCDMRIS_M 0x00000004
  413. #define AM_REG_UART_IES_DCDMRIS(n) (((uint32_t)(n) << 2) & 0x00000004)
  414. // This bit holds the modem CTS interrupt status.
  415. #define AM_REG_UART_IES_CTSMRIS_S 1
  416. #define AM_REG_UART_IES_CTSMRIS_M 0x00000002
  417. #define AM_REG_UART_IES_CTSMRIS(n) (((uint32_t)(n) << 1) & 0x00000002)
  418. // This bit holds the modem TXCMP interrupt status.
  419. #define AM_REG_UART_IES_TXCMPMRIS_S 0
  420. #define AM_REG_UART_IES_TXCMPMRIS_M 0x00000001
  421. #define AM_REG_UART_IES_TXCMPMRIS(n) (((uint32_t)(n) << 0) & 0x00000001)
  422. //*****************************************************************************
  423. //
  424. // UART_MIS - Masked Interrupt Status
  425. //
  426. //*****************************************************************************
  427. // This bit holds the overflow interrupt status masked.
  428. #define AM_REG_UART_MIS_OEMIS_S 10
  429. #define AM_REG_UART_MIS_OEMIS_M 0x00000400
  430. #define AM_REG_UART_MIS_OEMIS(n) (((uint32_t)(n) << 10) & 0x00000400)
  431. // This bit holds the break error interrupt status masked.
  432. #define AM_REG_UART_MIS_BEMIS_S 9
  433. #define AM_REG_UART_MIS_BEMIS_M 0x00000200
  434. #define AM_REG_UART_MIS_BEMIS(n) (((uint32_t)(n) << 9) & 0x00000200)
  435. // This bit holds the parity error interrupt status masked.
  436. #define AM_REG_UART_MIS_PEMIS_S 8
  437. #define AM_REG_UART_MIS_PEMIS_M 0x00000100
  438. #define AM_REG_UART_MIS_PEMIS(n) (((uint32_t)(n) << 8) & 0x00000100)
  439. // This bit holds the framing error interrupt status masked.
  440. #define AM_REG_UART_MIS_FEMIS_S 7
  441. #define AM_REG_UART_MIS_FEMIS_M 0x00000080
  442. #define AM_REG_UART_MIS_FEMIS(n) (((uint32_t)(n) << 7) & 0x00000080)
  443. // This bit holds the receive timeout interrupt status masked.
  444. #define AM_REG_UART_MIS_RTMIS_S 6
  445. #define AM_REG_UART_MIS_RTMIS_M 0x00000040
  446. #define AM_REG_UART_MIS_RTMIS(n) (((uint32_t)(n) << 6) & 0x00000040)
  447. // This bit holds the transmit interrupt status masked.
  448. #define AM_REG_UART_MIS_TXMIS_S 5
  449. #define AM_REG_UART_MIS_TXMIS_M 0x00000020
  450. #define AM_REG_UART_MIS_TXMIS(n) (((uint32_t)(n) << 5) & 0x00000020)
  451. // This bit holds the receive interrupt status masked.
  452. #define AM_REG_UART_MIS_RXMIS_S 4
  453. #define AM_REG_UART_MIS_RXMIS_M 0x00000010
  454. #define AM_REG_UART_MIS_RXMIS(n) (((uint32_t)(n) << 4) & 0x00000010)
  455. // This bit holds the modem DSR interrupt status masked.
  456. #define AM_REG_UART_MIS_DSRMMIS_S 3
  457. #define AM_REG_UART_MIS_DSRMMIS_M 0x00000008
  458. #define AM_REG_UART_MIS_DSRMMIS(n) (((uint32_t)(n) << 3) & 0x00000008)
  459. // This bit holds the modem DCD interrupt status masked.
  460. #define AM_REG_UART_MIS_DCDMMIS_S 2
  461. #define AM_REG_UART_MIS_DCDMMIS_M 0x00000004
  462. #define AM_REG_UART_MIS_DCDMMIS(n) (((uint32_t)(n) << 2) & 0x00000004)
  463. // This bit holds the modem CTS interrupt status masked.
  464. #define AM_REG_UART_MIS_CTSMMIS_S 1
  465. #define AM_REG_UART_MIS_CTSMMIS_M 0x00000002
  466. #define AM_REG_UART_MIS_CTSMMIS(n) (((uint32_t)(n) << 1) & 0x00000002)
  467. // This bit holds the modem TXCMP interrupt status masked.
  468. #define AM_REG_UART_MIS_TXCMPMMIS_S 0
  469. #define AM_REG_UART_MIS_TXCMPMMIS_M 0x00000001
  470. #define AM_REG_UART_MIS_TXCMPMMIS(n) (((uint32_t)(n) << 0) & 0x00000001)
  471. //*****************************************************************************
  472. //
  473. // UART_IEC - Interrupt Clear
  474. //
  475. //*****************************************************************************
  476. // This bit holds the overflow interrupt clear.
  477. #define AM_REG_UART_IEC_OEIC_S 10
  478. #define AM_REG_UART_IEC_OEIC_M 0x00000400
  479. #define AM_REG_UART_IEC_OEIC(n) (((uint32_t)(n) << 10) & 0x00000400)
  480. // This bit holds the break error interrupt clear.
  481. #define AM_REG_UART_IEC_BEIC_S 9
  482. #define AM_REG_UART_IEC_BEIC_M 0x00000200
  483. #define AM_REG_UART_IEC_BEIC(n) (((uint32_t)(n) << 9) & 0x00000200)
  484. // This bit holds the parity error interrupt clear.
  485. #define AM_REG_UART_IEC_PEIC_S 8
  486. #define AM_REG_UART_IEC_PEIC_M 0x00000100
  487. #define AM_REG_UART_IEC_PEIC(n) (((uint32_t)(n) << 8) & 0x00000100)
  488. // This bit holds the framing error interrupt clear.
  489. #define AM_REG_UART_IEC_FEIC_S 7
  490. #define AM_REG_UART_IEC_FEIC_M 0x00000080
  491. #define AM_REG_UART_IEC_FEIC(n) (((uint32_t)(n) << 7) & 0x00000080)
  492. // This bit holds the receive timeout interrupt clear.
  493. #define AM_REG_UART_IEC_RTIC_S 6
  494. #define AM_REG_UART_IEC_RTIC_M 0x00000040
  495. #define AM_REG_UART_IEC_RTIC(n) (((uint32_t)(n) << 6) & 0x00000040)
  496. // This bit holds the transmit interrupt clear.
  497. #define AM_REG_UART_IEC_TXIC_S 5
  498. #define AM_REG_UART_IEC_TXIC_M 0x00000020
  499. #define AM_REG_UART_IEC_TXIC(n) (((uint32_t)(n) << 5) & 0x00000020)
  500. // This bit holds the receive interrupt clear.
  501. #define AM_REG_UART_IEC_RXIC_S 4
  502. #define AM_REG_UART_IEC_RXIC_M 0x00000010
  503. #define AM_REG_UART_IEC_RXIC(n) (((uint32_t)(n) << 4) & 0x00000010)
  504. // This bit holds the modem DSR interrupt clear.
  505. #define AM_REG_UART_IEC_DSRMIC_S 3
  506. #define AM_REG_UART_IEC_DSRMIC_M 0x00000008
  507. #define AM_REG_UART_IEC_DSRMIC(n) (((uint32_t)(n) << 3) & 0x00000008)
  508. // This bit holds the modem DCD interrupt clear.
  509. #define AM_REG_UART_IEC_DCDMIC_S 2
  510. #define AM_REG_UART_IEC_DCDMIC_M 0x00000004
  511. #define AM_REG_UART_IEC_DCDMIC(n) (((uint32_t)(n) << 2) & 0x00000004)
  512. // This bit holds the modem CTS interrupt clear.
  513. #define AM_REG_UART_IEC_CTSMIC_S 1
  514. #define AM_REG_UART_IEC_CTSMIC_M 0x00000002
  515. #define AM_REG_UART_IEC_CTSMIC(n) (((uint32_t)(n) << 1) & 0x00000002)
  516. // This bit holds the modem TXCMP interrupt clear.
  517. #define AM_REG_UART_IEC_TXCMPMIC_S 0
  518. #define AM_REG_UART_IEC_TXCMPMIC_M 0x00000001
  519. #define AM_REG_UART_IEC_TXCMPMIC(n) (((uint32_t)(n) << 0) & 0x00000001)
  520. #endif // AM_REG_UART_H