uart_struct.h 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365
  1. // Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. // http://www.apache.org/licenses/LICENSE-2.0
  7. //
  8. // Unless required by applicable law or agreed to in writing, software
  9. // distributed under the License is distributed on an "AS IS" BASIS,
  10. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. // See the License for the specific language governing permissions and
  12. // limitations under the License.
  13. #ifndef _SOC_UART_STRUCT_H_
  14. #define _SOC_UART_STRUCT_H_
  15. typedef volatile struct {
  16. union {
  17. struct {
  18. uint8_t rw_byte; /*This register stores one byte data read by rx fifo.*/
  19. uint8_t reserved[3];
  20. };
  21. uint32_t val;
  22. } fifo;
  23. union {
  24. struct {
  25. uint32_t rxfifo_full: 1; /*This interrupt raw bit turns to high level when receiver receives more data than (rx_flow_thrhd_h3 rx_flow_thrhd).*/
  26. uint32_t txfifo_empty: 1; /*This interrupt raw bit turns to high level when the amount of data in transmitter's fifo is less than ((tx_mem_cnttxfifo_cnt) .*/
  27. uint32_t parity_err: 1; /*This interrupt raw bit turns to high level when receiver detects the parity error of data.*/
  28. uint32_t frm_err: 1; /*This interrupt raw bit turns to high level when receiver detects data's frame error .*/
  29. uint32_t rxfifo_ovf: 1; /*This interrupt raw bit turns to high level when receiver receives more data than the fifo can store.*/
  30. uint32_t dsr_chg: 1; /*This interrupt raw bit turns to high level when receiver detects the edge change of dsrn signal.*/
  31. uint32_t cts_chg: 1; /*This interrupt raw bit turns to high level when receiver detects the edge change of ctsn signal.*/
  32. uint32_t brk_det: 1; /*This interrupt raw bit turns to high level when receiver detects the 0 after the stop bit.*/
  33. uint32_t rxfifo_tout: 1; /*This interrupt raw bit turns to high level when receiver takes more time than rx_tout_thrhd to receive a byte.*/
  34. uint32_t sw_xon: 1; /*This interrupt raw bit turns to high level when receiver receives xoff char with uart_sw_flow_con_en is set to 1.*/
  35. uint32_t sw_xoff: 1; /*This interrupt raw bit turns to high level when receiver receives xon char with uart_sw_flow_con_en is set to 1.*/
  36. uint32_t glitch_det: 1; /*This interrupt raw bit turns to high level when receiver detects the start bit.*/
  37. uint32_t tx_brk_done: 1; /*This interrupt raw bit turns to high level when transmitter completes sending 0 after all the data in transmitter's fifo are send.*/
  38. uint32_t tx_brk_idle_done: 1; /*This interrupt raw bit turns to high level when transmitter has kept the shortest duration after the last data has been send.*/
  39. uint32_t tx_done: 1; /*This interrupt raw bit turns to high level when transmitter has send all the data in fifo.*/
  40. uint32_t rs485_parity_err: 1; /*This interrupt raw bit turns to high level when rs485 detects the parity error.*/
  41. uint32_t rs485_frm_err: 1; /*This interrupt raw bit turns to high level when rs485 detects the data frame error.*/
  42. uint32_t rs485_clash: 1; /*This interrupt raw bit turns to high level when rs485 detects the clash between transmitter and receiver.*/
  43. uint32_t at_cmd_char_det: 1; /*This interrupt raw bit turns to high level when receiver detects the configured at_cmd chars.*/
  44. uint32_t reserved19: 13;
  45. };
  46. uint32_t val;
  47. } int_raw;
  48. union {
  49. struct {
  50. uint32_t rxfifo_full: 1; /*This is the status bit for rxfifo_full_int_raw when rxfifo_full_int_ena is set to 1.*/
  51. uint32_t txfifo_empty: 1; /*This is the status bit for txfifo_empty_int_raw when txfifo_empty_int_ena is set to 1.*/
  52. uint32_t parity_err: 1; /*This is the status bit for parity_err_int_raw when parity_err_int_ena is set to 1.*/
  53. uint32_t frm_err: 1; /*This is the status bit for frm_err_int_raw when fm_err_int_ena is set to 1.*/
  54. uint32_t rxfifo_ovf: 1; /*This is the status bit for rxfifo_ovf_int_raw when rxfifo_ovf_int_ena is set to 1.*/
  55. uint32_t dsr_chg: 1; /*This is the status bit for dsr_chg_int_raw when dsr_chg_int_ena is set to 1.*/
  56. uint32_t cts_chg: 1; /*This is the status bit for cts_chg_int_raw when cts_chg_int_ena is set to 1.*/
  57. uint32_t brk_det: 1; /*This is the status bit for brk_det_int_raw when brk_det_int_ena is set to 1.*/
  58. uint32_t rxfifo_tout: 1; /*This is the status bit for rxfifo_tout_int_raw when rxfifo_tout_int_ena is set to 1.*/
  59. uint32_t sw_xon: 1; /*This is the status bit for sw_xon_int_raw when sw_xon_int_ena is set to 1.*/
  60. uint32_t sw_xoff: 1; /*This is the status bit for sw_xoff_int_raw when sw_xoff_int_ena is set to 1.*/
  61. uint32_t glitch_det: 1; /*This is the status bit for glitch_det_int_raw when glitch_det_int_ena is set to 1.*/
  62. uint32_t tx_brk_done: 1; /*This is the status bit for tx_brk_done_int_raw when tx_brk_done_int_ena is set to 1.*/
  63. uint32_t tx_brk_idle_done: 1; /*This is the status bit for tx_brk_idle_done_int_raw when tx_brk_idle_done_int_ena is set to 1.*/
  64. uint32_t tx_done: 1; /*This is the status bit for tx_done_int_raw when tx_done_int_ena is set to 1.*/
  65. uint32_t rs485_parity_err: 1; /*This is the status bit for rs485_parity_err_int_raw when rs485_parity_int_ena is set to 1.*/
  66. uint32_t rs485_frm_err: 1; /*This is the status bit for rs485_fm_err_int_raw when rs485_fm_err_int_ena is set to 1.*/
  67. uint32_t rs485_clash: 1; /*This is the status bit for rs485_clash_int_raw when rs485_clash_int_ena is set to 1.*/
  68. uint32_t at_cmd_char_det: 1; /*This is the status bit for at_cmd_det_int_raw when at_cmd_char_det_int_ena is set to 1.*/
  69. uint32_t reserved19: 13;
  70. };
  71. uint32_t val;
  72. } int_st;
  73. union {
  74. struct {
  75. uint32_t rxfifo_full: 1; /*This is the enable bit for rxfifo_full_int_st register.*/
  76. uint32_t txfifo_empty: 1; /*This is the enable bit for rxfifo_full_int_st register.*/
  77. uint32_t parity_err: 1; /*This is the enable bit for parity_err_int_st register.*/
  78. uint32_t frm_err: 1; /*This is the enable bit for frm_err_int_st register.*/
  79. uint32_t rxfifo_ovf: 1; /*This is the enable bit for rxfifo_ovf_int_st register.*/
  80. uint32_t dsr_chg: 1; /*This is the enable bit for dsr_chg_int_st register.*/
  81. uint32_t cts_chg: 1; /*This is the enable bit for cts_chg_int_st register.*/
  82. uint32_t brk_det: 1; /*This is the enable bit for brk_det_int_st register.*/
  83. uint32_t rxfifo_tout: 1; /*This is the enable bit for rxfifo_tout_int_st register.*/
  84. uint32_t sw_xon: 1; /*This is the enable bit for sw_xon_int_st register.*/
  85. uint32_t sw_xoff: 1; /*This is the enable bit for sw_xoff_int_st register.*/
  86. uint32_t glitch_det: 1; /*This is the enable bit for glitch_det_int_st register.*/
  87. uint32_t tx_brk_done: 1; /*This is the enable bit for tx_brk_done_int_st register.*/
  88. uint32_t tx_brk_idle_done: 1; /*This is the enable bit for tx_brk_idle_done_int_st register.*/
  89. uint32_t tx_done: 1; /*This is the enable bit for tx_done_int_st register.*/
  90. uint32_t rs485_parity_err: 1; /*This is the enable bit for rs485_parity_err_int_st register.*/
  91. uint32_t rs485_frm_err: 1; /*This is the enable bit for rs485_parity_err_int_st register.*/
  92. uint32_t rs485_clash: 1; /*This is the enable bit for rs485_clash_int_st register.*/
  93. uint32_t at_cmd_char_det: 1; /*This is the enable bit for at_cmd_char_det_int_st register.*/
  94. uint32_t reserved19: 13;
  95. };
  96. uint32_t val;
  97. } int_ena;
  98. union {
  99. struct {
  100. uint32_t rxfifo_full: 1; /*Set this bit to clear the rxfifo_full_int_raw interrupt.*/
  101. uint32_t txfifo_empty: 1; /*Set this bit to clear txfifo_empty_int_raw interrupt.*/
  102. uint32_t parity_err: 1; /*Set this bit to clear parity_err_int_raw interrupt.*/
  103. uint32_t frm_err: 1; /*Set this bit to clear frm_err_int_raw interrupt.*/
  104. uint32_t rxfifo_ovf: 1; /*Set this bit to clear rxfifo_ovf_int_raw interrupt.*/
  105. uint32_t dsr_chg: 1; /*Set this bit to clear the dsr_chg_int_raw interrupt.*/
  106. uint32_t cts_chg: 1; /*Set this bit to clear the cts_chg_int_raw interrupt.*/
  107. uint32_t brk_det: 1; /*Set this bit to clear the brk_det_int_raw interrupt.*/
  108. uint32_t rxfifo_tout: 1; /*Set this bit to clear the rxfifo_tout_int_raw interrupt.*/
  109. uint32_t sw_xon: 1; /*Set this bit to clear the sw_xon_int_raw interrupt.*/
  110. uint32_t sw_xoff: 1; /*Set this bit to clear the sw_xon_int_raw interrupt.*/
  111. uint32_t glitch_det: 1; /*Set this bit to clear the glitch_det_int_raw interrupt.*/
  112. uint32_t tx_brk_done: 1; /*Set this bit to clear the tx_brk_done_int_raw interrupt..*/
  113. uint32_t tx_brk_idle_done: 1; /*Set this bit to clear the tx_brk_idle_done_int_raw interrupt.*/
  114. uint32_t tx_done: 1; /*Set this bit to clear the tx_done_int_raw interrupt.*/
  115. uint32_t rs485_parity_err: 1; /*Set this bit to clear the rs485_parity_err_int_raw interrupt.*/
  116. uint32_t rs485_frm_err: 1; /*Set this bit to clear the rs485_frm_err_int_raw interrupt.*/
  117. uint32_t rs485_clash: 1; /*Set this bit to clear the rs485_clash_int_raw interrupt.*/
  118. uint32_t at_cmd_char_det: 1; /*Set this bit to clear the at_cmd_char_det_int_raw interrupt.*/
  119. uint32_t reserved19: 13;
  120. };
  121. uint32_t val;
  122. } int_clr;
  123. union {
  124. struct {
  125. uint32_t div_int: 20; /*The register value is the integer part of the frequency divider's factor.*/
  126. uint32_t div_frag: 4; /*The register value is the decimal part of the frequency divider's factor.*/
  127. uint32_t reserved24: 8;
  128. };
  129. uint32_t val;
  130. } clk_div;
  131. union {
  132. struct {
  133. uint32_t en: 1; /*This is the enable bit for detecting baudrate.*/
  134. uint32_t reserved1: 7;
  135. uint32_t glitch_filt: 8; /*when input pulse width is lower then this value ignore this pulse.this register is used in auto-baud detect process.*/
  136. uint32_t reserved16: 16;
  137. };
  138. uint32_t val;
  139. } auto_baud;
  140. union {
  141. struct {
  142. uint32_t rxfifo_cnt: 8; /*(rx_mem_cnt rxfifo_cnt) stores the byte number of valid data in receiver's fifo. rx_mem_cnt register stores the 3 most significant bits rxfifo_cnt stores the 8 least significant bits.*/
  143. uint32_t st_urx_out: 4; /*This register stores the value of receiver's finite state machine. 0:RX_IDLE 1:RX_STRT 2:RX_DAT0 3:RX_DAT1 4:RX_DAT2 5:RX_DAT3 6:RX_DAT4 7:RX_DAT5 8:RX_DAT6 9:RX_DAT7 10:RX_PRTY 11:RX_STP1 12:RX_STP2 13:RX_DL1*/
  144. uint32_t reserved12: 1;
  145. uint32_t dsrn: 1; /*This register stores the level value of the internal uart dsr signal.*/
  146. uint32_t ctsn: 1; /*This register stores the level value of the internal uart cts signal.*/
  147. uint32_t rxd: 1; /*This register stores the level value of the internal uart rxd signal.*/
  148. uint32_t txfifo_cnt: 8; /*(tx_mem_cnt txfifo_cnt) stores the byte number of valid data in transmitter's fifo.tx_mem_cnt stores the 3 most significant bits txfifo_cnt stores the 8 least significant bits.*/
  149. uint32_t st_utx_out: 4; /*This register stores the value of transmitter's finite state machine. 0:TX_IDLE 1:TX_STRT 2:TX_DAT0 3:TX_DAT1 4:TX_DAT2 5:TX_DAT3 6:TX_DAT4 7:TX_DAT5 8:TX_DAT6 9:TX_DAT7 10:TX_PRTY 11:TX_STP1 12:TX_STP2 13:TX_DL0 14:TX_DL1*/
  150. uint32_t reserved28: 1;
  151. uint32_t dtrn: 1; /*The register represent the level value of the internal uart dsr signal.*/
  152. uint32_t rtsn: 1; /*This register represent the level value of the internal uart cts signal.*/
  153. uint32_t txd: 1; /*This register represent the level value of the internal uart rxd signal.*/
  154. };
  155. uint32_t val;
  156. } status;
  157. union {
  158. struct {
  159. uint32_t parity: 1; /*This register is used to configure the parity check mode. 0:even 1:odd*/
  160. uint32_t parity_en: 1; /*Set this bit to enable uart parity check.*/
  161. uint32_t bit_num: 2; /*This register is used to set the length of data: 0:5bits 1:6bits 2:7bits 3:8bits*/
  162. uint32_t stop_bit_num: 2; /*This register is used to set the length of stop bit. 1:1bit 2:1.5bits 3:2bits*/
  163. uint32_t sw_rts: 1; /*This register is used to configure the software rts signal which is used in software flow control.*/
  164. uint32_t sw_dtr: 1; /*This register is used to configure the software dtr signal which is used in software flow control..*/
  165. uint32_t txd_brk: 1; /*Set this bit to enable transmitter to send 0 when the process of sending data is done.*/
  166. uint32_t irda_dplx: 1; /*Set this bit to enable irda loop-back mode.*/
  167. uint32_t irda_tx_en: 1; /*This is the start enable bit for irda transmitter.*/
  168. uint32_t irda_wctl: 1; /*1:the irda transmitter's 11th bit is the same to the 10th bit. 0:set irda transmitter's 11th bit to 0.*/
  169. uint32_t irda_tx_inv: 1; /*Set this bit to inverse the level value of irda transmitter's level.*/
  170. uint32_t irda_rx_inv: 1; /*Set this bit to inverse the level value of irda receiver's level.*/
  171. uint32_t loopback: 1; /*Set this bit to enable uart loop-back test mode.*/
  172. uint32_t tx_flow_en: 1; /*Set this bit to enable transmitter's flow control function.*/
  173. uint32_t irda_en: 1; /*Set this bit to enable irda protocol.*/
  174. uint32_t rxfifo_rst: 1; /*Set this bit to reset uart receiver's fifo.*/
  175. uint32_t txfifo_rst: 1; /*Set this bit to reset uart transmitter's fifo.*/
  176. uint32_t rxd_inv: 1; /*Set this bit to inverse the level value of uart rxd signal.*/
  177. uint32_t cts_inv: 1; /*Set this bit to inverse the level value of uart cts signal.*/
  178. uint32_t dsr_inv: 1; /*Set this bit to inverse the level value of uart dsr signal.*/
  179. uint32_t txd_inv: 1; /*Set this bit to inverse the level value of uart txd signal.*/
  180. uint32_t rts_inv: 1; /*Set this bit to inverse the level value of uart rts signal.*/
  181. uint32_t dtr_inv: 1; /*Set this bit to inverse the level value of uart dtr signal.*/
  182. uint32_t clk_en: 1; /*1:force clock on for registers:support clock only when write registers*/
  183. uint32_t err_wr_mask: 1; /*1:receiver stops storing data int fifo when data is wrong. 0:receiver stores the data even if the received data is wrong.*/
  184. uint32_t tick_ref_always_on: 1; /*This register is used to select the clock.1:apb clock:ref_tick*/
  185. uint32_t reserved28: 4;
  186. };
  187. uint32_t val;
  188. } conf0;
  189. union {
  190. struct {
  191. uint32_t rxfifo_full_thrhd: 7; /*When receiver receives more data than its threshold value,receiver will produce rxfifo_full_int_raw interrupt.the threshold value is (rx_flow_thrhd_h3 rxfifo_full_thrhd).*/
  192. uint32_t reserved7: 1;
  193. uint32_t txfifo_empty_thrhd: 7; /*when the data amount in transmitter fifo is less than its threshold value, it will produce txfifo_empty_int_raw interrupt. the threshold value is (tx_mem_empty_thrhd txfifo_empty_thrhd)*/
  194. uint32_t reserved15: 1;
  195. uint32_t rx_flow_thrhd: 7; /*when receiver receives more data than its threshold value, receiver produce signal to tell the transmitter stop transferring data. the threshold value is (rx_flow_thrhd_h3 rx_flow_thrhd).*/
  196. uint32_t rx_flow_en: 1; /*This is the flow enable bit for uart receiver. 1:choose software flow control with configuring sw_rts signal*/
  197. uint32_t rx_tout_thrhd: 7; /*This register is used to configure the timeout value for uart receiver receiving a byte.*/
  198. uint32_t rx_tout_en: 1; /*This is the enable bit for uart receiver's timeout function.*/
  199. };
  200. uint32_t val;
  201. } conf1;
  202. union {
  203. struct {
  204. uint32_t min_cnt: 20; /*This register stores the value of the minimum duration time for the low level pulse, it is used in baudrate-detect process.*/
  205. uint32_t reserved20: 12;
  206. };
  207. uint32_t val;
  208. } lowpulse;
  209. union {
  210. struct {
  211. uint32_t min_cnt: 20; /*This register stores the value of the maximum duration time for the high level pulse, it is used in baudrate-detect process.*/
  212. uint32_t reserved20: 12;
  213. };
  214. uint32_t val;
  215. } highpulse;
  216. union {
  217. struct {
  218. uint32_t edge_cnt: 10; /*This register stores the count of rxd edge change, it is used in baudrate-detect process.*/
  219. uint32_t reserved10: 22;
  220. };
  221. uint32_t val;
  222. } rxd_cnt;
  223. union {
  224. struct {
  225. uint32_t sw_flow_con_en: 1; /*Set this bit to enable software flow control. it is used with register sw_xon or sw_xoff .*/
  226. uint32_t xonoff_del: 1; /*Set this bit to remove flow control char from the received data.*/
  227. uint32_t force_xon: 1; /*Set this bit to clear ctsn to stop the transmitter from sending data.*/
  228. uint32_t force_xoff: 1; /*Set this bit to set ctsn to enable the transmitter to go on sending data.*/
  229. uint32_t send_xon: 1; /*Set this bit to send xon char, it is cleared by hardware automatically.*/
  230. uint32_t send_xoff: 1; /*Set this bit to send xoff char, it is cleared by hardware automatically.*/
  231. uint32_t reserved6: 26;
  232. };
  233. uint32_t val;
  234. } flow_conf;
  235. union {
  236. struct {
  237. uint32_t active_threshold:10; /*When the input rxd edge changes more than this register value, the uart is active from light sleeping mode.*/
  238. uint32_t reserved10: 22;
  239. };
  240. uint32_t val;
  241. } sleep_conf;
  242. union {
  243. struct {
  244. uint32_t xon_threshold: 8; /*when the data amount in receiver's fifo is more than this register value, it will send a xoff char with uart_sw_flow_con_en set to 1.*/
  245. uint32_t xoff_threshold: 8; /*When the data amount in receiver's fifo is less than this register value, it will send a xon char with uart_sw_flow_con_en set to 1.*/
  246. uint32_t xon_char: 8; /*This register stores the xon flow control char.*/
  247. uint32_t xoff_char: 8; /*This register stores the xoff flow control char.*/
  248. };
  249. uint32_t val;
  250. } swfc_conf;
  251. union {
  252. struct {
  253. uint32_t rx_idle_thrhd:10; /*when receiver takes more time than this register value to receive a byte data, it will produce frame end signal for uhci to stop receiving data.*/
  254. uint32_t tx_idle_num: 10; /*This register is used to configure the duration time between transfers.*/
  255. uint32_t tx_brk_num: 8; /*This register is used to configure the number of 0 send after the process of sending data is done. it is active when txd_brk is set to 1.*/
  256. uint32_t reserved28: 4;
  257. };
  258. uint32_t val;
  259. } idle_conf;
  260. union {
  261. struct {
  262. uint32_t en: 1; /*Set this bit to choose rs485 mode.*/
  263. uint32_t dl0_en: 1; /*Set this bit to delay the stop bit by 1 bit.*/
  264. uint32_t dl1_en: 1; /*Set this bit to delay the stop bit by 1 bit.*/
  265. uint32_t tx_rx_en: 1; /*Set this bit to enable loop-back transmitter's output data signal to receiver's input data signal.*/
  266. uint32_t rx_busy_tx_en: 1; /*1: enable rs485's transmitter to send data when rs485's receiver is busy. 0:rs485's transmitter should not send data when its receiver is busy.*/
  267. uint32_t rx_dly_num: 1; /*This register is used to delay the receiver's internal data signal.*/
  268. uint32_t tx_dly_num: 4; /*This register is used to delay the transmitter's internal data signal.*/
  269. uint32_t reserved10: 22;
  270. };
  271. uint32_t val;
  272. } rs485_conf;
  273. union {
  274. struct {
  275. uint32_t pre_idle_num:24; /*This register is used to configure the idle duration time before the first at_cmd is received by receiver, when the the duration is less than this register value it will not take the next data received as at_cmd char.*/
  276. uint32_t reserved24: 8;
  277. };
  278. uint32_t val;
  279. } at_cmd_precnt;
  280. union {
  281. struct {
  282. uint32_t post_idle_num:24; /*This register is used to configure the duration time between the last at_cmd and the next data, when the duration is less than this register value it will not take the previous data as at_cmd char.*/
  283. uint32_t reserved24: 8;
  284. };
  285. uint32_t val;
  286. } at_cmd_postcnt;
  287. union {
  288. struct {
  289. uint32_t rx_gap_tout:24; /*This register is used to configure the duration time between the at_cmd chars, when the duration time is less than this register value it will not take the data as continous at_cmd chars.*/
  290. uint32_t reserved24: 8;
  291. };
  292. uint32_t val;
  293. } at_cmd_gaptout;
  294. union {
  295. struct {
  296. uint32_t data: 8; /*This register is used to configure the content of at_cmd char.*/
  297. uint32_t char_num: 8; /*This register is used to configure the number of continuous at_cmd chars received by receiver.*/
  298. uint32_t reserved16: 16;
  299. };
  300. uint32_t val;
  301. } at_cmd_char;
  302. union {
  303. struct {
  304. uint32_t mem_pd: 1; /*Set this bit to power down memory,when reg_mem_pd registers in the 3 uarts are all set to 1 memory will enter low power mode.*/
  305. uint32_t reserved1: 1;
  306. uint32_t reserved2: 1;
  307. uint32_t rx_size: 4; /*This register is used to configure the amount of mem allocated to receiver's fifo. the default byte num is 128.*/
  308. uint32_t tx_size: 4; /*This register is used to configure the amount of mem allocated to transmitter's fifo.the default byte num is 128.*/
  309. uint32_t reserved11: 4;
  310. uint32_t rx_flow_thrhd_h3: 3; /*refer to the rx_flow_thrhd's description.*/
  311. uint32_t rx_tout_thrhd_h3: 3; /*refer to the rx_tout_thrhd's description.*/
  312. uint32_t xon_threshold_h2: 2; /*refer to the uart_xon_threshold's description.*/
  313. uint32_t xoff_threshold_h2: 2; /*refer to the uart_xoff_threshold's description.*/
  314. uint32_t rx_mem_full_thrhd: 3; /*refer to the rxfifo_full_thrhd's description.*/
  315. uint32_t tx_mem_empty_thrhd: 3; /*refer to txfifo_empty_thrhd 's description.*/
  316. uint32_t reserved31: 1;
  317. };
  318. uint32_t val;
  319. } mem_conf;
  320. union {
  321. struct {
  322. uint32_t status:24;
  323. uint32_t reserved24: 8;
  324. };
  325. uint32_t val;
  326. } mem_tx_status;
  327. union {
  328. struct {
  329. uint32_t status:24;
  330. uint32_t reserved24: 8;
  331. };
  332. uint32_t val;
  333. } mem_rx_status;
  334. union {
  335. struct {
  336. uint32_t rx_cnt: 3; /*refer to the rxfifo_cnt's description.*/
  337. uint32_t tx_cnt: 3; /*refer to the txfifo_cnt's description.*/
  338. uint32_t reserved6: 26;
  339. };
  340. uint32_t val;
  341. } mem_cnt_status;
  342. union {
  343. struct {
  344. uint32_t min_cnt: 20; /*This register stores the count of rxd pos-edge edge, it is used in baudrate-detect process.*/
  345. uint32_t reserved20: 12;
  346. };
  347. uint32_t val;
  348. } pospulse;
  349. union {
  350. struct {
  351. uint32_t min_cnt: 20; /*This register stores the count of rxd neg-edge edge, it is used in baudrate-detect process.*/
  352. uint32_t reserved20: 12;
  353. };
  354. uint32_t val;
  355. } negpulse;
  356. uint32_t reserved_70;
  357. uint32_t reserved_74;
  358. uint32_t date; /**/
  359. uint32_t id; /**/
  360. } uart_dev_t;
  361. extern uart_dev_t UART0;
  362. extern uart_dev_t UART1;
  363. extern uart_dev_t UART2;
  364. #endif /* _SOC_UART_STRUCT_H_ */