hw_uart.h 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. /** ============================================================================
  2. * \file hw_uart.h
  3. *
  4. * \brief This file contains the Register Descriptions for UART
  5. *
  6. * ============================================================================
  7. */
  8. /*
  9. * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
  10. */
  11. /*
  12. * Redistribution and use in source and binary forms, with or without
  13. * modification, are permitted provided that the following conditions
  14. * are met:
  15. *
  16. * Redistributions of source code must retain the above copyright
  17. * notice, this list of conditions and the following disclaimer.
  18. *
  19. * Redistributions in binary form must reproduce the above copyright
  20. * notice, this list of conditions and the following disclaimer in the
  21. * documentation and/or other materials provided with the
  22. * distribution.
  23. *
  24. * Neither the name of Texas Instruments Incorporated nor the names of
  25. * its contributors may be used to endorse or promote products derived
  26. * from this software without specific prior written permission.
  27. *
  28. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  29. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  30. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  31. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  32. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  33. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  34. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  35. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  36. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  37. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  38. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  39. *
  40. */
  41. #ifndef _HW_UART_H_
  42. #define _HW_UART_H_
  43. #ifdef __cplusplus
  44. extern "C" {
  45. #endif
  46. #define UART_RBR (0x0)
  47. #define UART_THR (0x0)
  48. #define UART_IER (0x4)
  49. #define UART_IIR (0x8)
  50. #define UART_FCR (0x8)
  51. #define UART_LCR (0xC)
  52. #define UART_MCR (0x10)
  53. #define UART_LSR (0x14)
  54. #define UART_MSR (0x18)
  55. #define UART_SCR (0x1C)
  56. #define UART_DLL (0x20)
  57. #define UART_DLH (0x24)
  58. #define UART_REVID1 (0x28)
  59. #define UART_REVID2 (0x2C)
  60. #define UART_PWREMU_MGMT (0x30)
  61. #define UART_MDR (0x34)
  62. /**************************************************************************\
  63. * Field Definition Macros
  64. \**************************************************************************/
  65. /* RBR */
  66. #define UART_RBR_DATA (0x000000FFu)
  67. #define UART_RBR_DATA_SHIFT (0x00000000u)
  68. /* THR */
  69. #define UART_THR_DATA (0x000000FFu)
  70. #define UART_THR_DATA_SHIFT (0x00000000u)
  71. /* IER */
  72. #define UART_IER_EDSSI (0x00000008u)
  73. #define UART_IER_EDSSI_SHIFT (0x00000003u)
  74. #define UART_IER_ELSI (0x00000004u)
  75. #define UART_IER_ELSI_SHIFT (0x00000002u)
  76. #define UART_IER_ETBEI (0x00000002u)
  77. #define UART_IER_ETBEI_SHIFT (0x00000001u)
  78. #define UART_IER_ERBI (0x00000001u)
  79. #define UART_IER_ERBI_SHIFT (0x00000000u)
  80. /* IIR */
  81. #define UART_IIR_FIFOEN (0x000000C0u)
  82. #define UART_IIR_FIFOEN_SHIFT (0x00000006u)
  83. #define UART_IIR_INTID (0x0000000Eu)
  84. #define UART_IIR_INTID_SHIFT (0x00000001u)
  85. /*----INTID Tokens----*/
  86. #define UART_IIR_INTID_MODSTAT (0x00000000u)
  87. #define UART_IIR_INTID_THRE (0x00000001u)
  88. #define UART_IIR_INTID_RDA (0x00000002u)
  89. #define UART_IIR_INTID_RLS (0x00000003u)
  90. #define UART_IIR_INTID_CTI (0x00000006u)
  91. #define UART_IIR_IPEND (0x00000001u)
  92. #define UART_IIR_IPEND_SHIFT (0x00000000u)
  93. /* FCR */
  94. #define UART_FCR_RXFIFTL (0x000000C0u)
  95. #define UART_FCR_RXFIFTL_SHIFT (0x00000006u)
  96. /*----RXFIFTL Tokens----*/
  97. #define UART_FCR_RXFIFTL_CHAR1 (0x00000000u)
  98. #define UART_FCR_RXFIFTL_CHAR4 (0x00000001u)
  99. #define UART_FCR_RXFIFTL_CHAR8 (0x00000002u)
  100. #define UART_FCR_RXFIFTL_CHAR14 (0x00000003u)
  101. #define UART_FCR_DMAMODE1 (0x00000008u)
  102. #define UART_FCR_DMAMODE1_SHIFT (0x00000003u)
  103. #define UART_FCR_TXCLR (0x00000004u)
  104. #define UART_FCR_TXCLR_SHIFT (0x00000002u)
  105. #define UART_FCR_RXCLR (0x00000002u)
  106. #define UART_FCR_RXCLR_SHIFT (0x00000001u)
  107. #define UART_FCR_FIFOEN (0x00000001u)
  108. #define UART_FCR_FIFOEN_SHIFT (0x00000000u)
  109. /* LCR */
  110. #define UART_LCR_DLAB (0x00000080u)
  111. #define UART_LCR_DLAB_SHIFT (0x00000007u)
  112. #define UART_LCR_BC (0x00000040u)
  113. #define UART_LCR_BC_SHIFT (0x00000006u)
  114. #define UART_LCR_SP (0x00000020u)
  115. #define UART_LCR_SP_SHIFT (0x00000005u)
  116. #define UART_LCR_EPS (0x00000010u)
  117. #define UART_LCR_EPS_SHIFT (0x00000004u)
  118. /*----EPS Tokens----*/
  119. #define UART_LCR_EPS_ODD (0x00000000u)
  120. #define UART_LCR_EPS_EVEN (0x00000001u)
  121. #define UART_LCR_PEN (0x00000008u)
  122. #define UART_LCR_PEN_SHIFT (0x00000003u)
  123. #define UART_LCR_STB (0x00000004u)
  124. #define UART_LCR_STB_SHIFT (0x00000002u)
  125. #define UART_LCR_WLS (0x00000003u)
  126. #define UART_LCR_WLS_SHIFT (0x00000000u)
  127. /*----WLS Tokens----*/
  128. #define UART_LCR_WLS_5BITS (0x00000000u)
  129. #define UART_LCR_WLS_6BITS (0x00000001u)
  130. #define UART_LCR_WLS_7BITS (0x00000002u)
  131. #define UART_LCR_WLS_8BITS (0x00000003u)
  132. /* MCR */
  133. #define UART_MCR_AFE (0x00000020u)
  134. #define UART_MCR_AFE_SHIFT (0x00000005u)
  135. #define UART_MCR_LOOP (0x00000010u)
  136. #define UART_MCR_LOOP_SHIFT (0x00000004u)
  137. #define UART_MCR_OUT2 (0x00000008u)
  138. #define UART_MCR_OUT2_SHIFT (0x00000003u)
  139. #define UART_MCR_OUT1 (0x00000004u)
  140. #define UART_MCR_OUT1_SHIFT (0x00000002u)
  141. #define UART_MCR_RTS (0x00000002u)
  142. #define UART_MCR_RTS_SHIFT (0x00000001u)
  143. #define UART_MCR_DTR (0x00000001u)
  144. #define UART_MCR_DTR_SHIFT (0x00000000u)
  145. /* LSR */
  146. #define UART_LSR_RXFIFOE (0x00000080u)
  147. #define UART_LSR_RXFIFOE_SHIFT (0x00000007u)
  148. #define UART_LSR_TEMT (0x00000040u)
  149. #define UART_LSR_TEMT_SHIFT (0x00000006u)
  150. #define UART_LSR_THRE (0x00000020u)
  151. #define UART_LSR_THRE_SHIFT (0x00000005u)
  152. #define UART_LSR_BI (0x00000010u)
  153. #define UART_LSR_BI_SHIFT (0x00000004u)
  154. #define UART_LSR_FE (0x00000008u)
  155. #define UART_LSR_FE_SHIFT (0x00000003u)
  156. #define UART_LSR_PE (0x00000004u)
  157. #define UART_LSR_PE_SHIFT (0x00000002u)
  158. #define UART_LSR_OE (0x00000002u)
  159. #define UART_LSR_OE_SHIFT (0x00000001u)
  160. #define UART_LSR_DR (0x00000001u)
  161. #define UART_LSR_DR_SHIFT (0x00000000u)
  162. /* MSR */
  163. #define UART_MSR_CD (0x00000080u)
  164. #define UART_MSR_CD_SHIFT (0x00000007u)
  165. #define UART_MSR_RI (0x00000040u)
  166. #define UART_MSR_RI_SHIFT (0x00000006u)
  167. #define UART_MSR_DSR (0x00000020u)
  168. #define UART_MSR_DSR_SHIFT (0x00000005u)
  169. #define UART_MSR_CTS (0x00000010u)
  170. #define UART_MSR_CTS_SHIFT (0x00000004u)
  171. #define UART_MSR_DCD (0x00000008u)
  172. #define UART_MSR_DCD_SHIFT (0x00000003u)
  173. #define UART_MSR_TERI (0x00000004u)
  174. #define UART_MSR_TERI_SHIFT (0x00000002u)
  175. #define UART_MSR_DDSR (0x00000002u)
  176. #define UART_MSR_DDSR_SHIFT (0x00000001u)
  177. #define UART_MSR_DCTS (0x00000001u)
  178. #define UART_MSR_DCTS_SHIFT (0x00000000u)
  179. /* SCR */
  180. #define UART_SCR_SCR (0x000000FFu)
  181. #define UART_SCR_SCR_SHIFT (0x00000000u)
  182. /* DLL */
  183. #define UART_DLL_DLL (0x000000FFu)
  184. #define UART_DLL_DLL_SHIFT (0x00000000u)
  185. /* DLH */
  186. #define UART_DLH_DLH (0x000000FFu)
  187. #define UART_DLH_DLH_SHIFT (0x00000000u)
  188. /* PID1 */
  189. #define UART_REVID1_REV (0xFFFFFFFFu)
  190. #define UART_REVID1_REV_SHIFT (0x00000000u)
  191. /* PID2 */
  192. #define UART_REVID2_REV (0xFFFFFFFFu)
  193. #define UART_REVID2_REV_SHIFT (0x00000000u)
  194. /* PWREMU_MGMT */
  195. #define UART_PWREMU_MGMT_UTRST (0x00004000u)
  196. #define UART_PWREMU_MGMT_UTRST_SHIFT (0x0000000Eu)
  197. #define UART_PWREMU_MGMT_URRST (0x00002000u)
  198. #define UART_PWREMU_MGMT_URRST_SHIFT (0x0000000Du)
  199. #define UART_PWREMU_MGMT_FREE (0x00000001u)
  200. #define UART_PWREMU_MGMT_FREE_SHIFT (0x00000000u)
  201. /* MDR */
  202. #define UART_MDR_OSM_SEL (0x00000001u)
  203. #define UART_MDR_OSM_SEL_SHIFT (0x00000000u)
  204. #ifdef __cplusplus
  205. }
  206. #endif
  207. #endif