HPM SDK
HPMicro Software Development Kit
hpm_uart_regs.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2021-2025 HPMicro
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  *
6  */
7 
8 
9 #ifndef HPM_UART_H
10 #define HPM_UART_H
11 
12 typedef struct {
13  __R uint8_t RESERVED0[4]; /* 0x0 - 0x3: Reserved */
14  __RW uint32_t IDLE_CFG; /* 0x4: Idle Configuration Register */
15  __RW uint32_t ADDR_CFG; /* 0x8: address match config register */
16  __RW uint32_t IIR2; /* 0xC: Interrupt Identification Register2 */
17  __RW uint32_t CFG; /* 0x10: Configuration Register */
18  __RW uint32_t OSCR; /* 0x14: Over Sample Control Register */
19  __RW uint32_t FCRR; /* 0x18: FIFO Control Register config */
20  __RW uint32_t MOTO_CFG; /* 0x1C: moto system control register */
21  union {
22  __R uint32_t RBR; /* 0x20: Receiver Buffer Register (when DLAB = 0) */
23  __W uint32_t THR; /* 0x20: Transmitter Holding Register (when DLAB = 0) */
24  __RW uint32_t DLL; /* 0x20: Divisor Latch LSB (when DLAB = 1) */
25  };
26  union {
27  __RW uint32_t IER; /* 0x24: Interrupt Enable Register (when DLAB = 0) */
28  __RW uint32_t DLM; /* 0x24: Divisor Latch MSB (when DLAB = 1) */
29  };
30  union {
31  __RW uint32_t IIR; /* 0x28: Interrupt Identification Register */
32  __W uint32_t FCR; /* 0x28: FIFO Control Register */
33  };
34  __RW uint32_t LCR; /* 0x2C: Line Control Register */
35  __RW uint32_t MCR; /* 0x30: Modem Control Register ( */
36  __R uint32_t LSR; /* 0x34: Line Status Register */
37  __R uint32_t MSR; /* 0x38: Modem Status Register */
38  __RW uint32_t GPR; /* 0x3C: GPR Register */
39 } UART_Type;
40 
41 
42 /* Bitfield definition for register: IDLE_CFG */
43 /*
44  * TX_IDLE_COND (RW)
45  *
46  * IDLE Detection Condition
47  * 0 - Treat as idle if TX pin is logic one
48  * 1 - Treat as idle if UART state machine state is idle
49  */
50 #define UART_IDLE_CFG_TX_IDLE_COND_MASK (0x2000000UL)
51 #define UART_IDLE_CFG_TX_IDLE_COND_SHIFT (25U)
52 #define UART_IDLE_CFG_TX_IDLE_COND_SET(x) (((uint32_t)(x) << UART_IDLE_CFG_TX_IDLE_COND_SHIFT) & UART_IDLE_CFG_TX_IDLE_COND_MASK)
53 #define UART_IDLE_CFG_TX_IDLE_COND_GET(x) (((uint32_t)(x) & UART_IDLE_CFG_TX_IDLE_COND_MASK) >> UART_IDLE_CFG_TX_IDLE_COND_SHIFT)
54 
55 /*
56  * TX_IDLE_EN (RW)
57  *
58  * UART TX Idle Detect Enable
59  * 0 - Disable
60  * 1 - Enable
61  */
62 #define UART_IDLE_CFG_TX_IDLE_EN_MASK (0x1000000UL)
63 #define UART_IDLE_CFG_TX_IDLE_EN_SHIFT (24U)
64 #define UART_IDLE_CFG_TX_IDLE_EN_SET(x) (((uint32_t)(x) << UART_IDLE_CFG_TX_IDLE_EN_SHIFT) & UART_IDLE_CFG_TX_IDLE_EN_MASK)
65 #define UART_IDLE_CFG_TX_IDLE_EN_GET(x) (((uint32_t)(x) & UART_IDLE_CFG_TX_IDLE_EN_MASK) >> UART_IDLE_CFG_TX_IDLE_EN_SHIFT)
66 
67 /*
68  * TX_IDLE_THR (RW)
69  *
70  * Threshold for UART transmit Idle detection (in terms of bits)
71  */
72 #define UART_IDLE_CFG_TX_IDLE_THR_MASK (0xFF0000UL)
73 #define UART_IDLE_CFG_TX_IDLE_THR_SHIFT (16U)
74 #define UART_IDLE_CFG_TX_IDLE_THR_SET(x) (((uint32_t)(x) << UART_IDLE_CFG_TX_IDLE_THR_SHIFT) & UART_IDLE_CFG_TX_IDLE_THR_MASK)
75 #define UART_IDLE_CFG_TX_IDLE_THR_GET(x) (((uint32_t)(x) & UART_IDLE_CFG_TX_IDLE_THR_MASK) >> UART_IDLE_CFG_TX_IDLE_THR_SHIFT)
76 
77 /*
78  * RXEN (RW)
79  *
80  * UART receive enable.
81  * 0 - hold RX input to high, avoide wrong data input when config pinmux
82  * 1 - bypass RX input from PIN
83  * software should set it after config pinmux
84  */
85 #define UART_IDLE_CFG_RXEN_MASK (0x800U)
86 #define UART_IDLE_CFG_RXEN_SHIFT (11U)
87 #define UART_IDLE_CFG_RXEN_SET(x) (((uint32_t)(x) << UART_IDLE_CFG_RXEN_SHIFT) & UART_IDLE_CFG_RXEN_MASK)
88 #define UART_IDLE_CFG_RXEN_GET(x) (((uint32_t)(x) & UART_IDLE_CFG_RXEN_MASK) >> UART_IDLE_CFG_RXEN_SHIFT)
89 
90 /*
91  * RX_IDLE_COND (RW)
92  *
93  * IDLE Detection Condition
94  * 0 - Treat as idle if RX pin is logic one
95  * 1 - Treat as idle if UART state machine state is idle
96  */
97 #define UART_IDLE_CFG_RX_IDLE_COND_MASK (0x200U)
98 #define UART_IDLE_CFG_RX_IDLE_COND_SHIFT (9U)
99 #define UART_IDLE_CFG_RX_IDLE_COND_SET(x) (((uint32_t)(x) << UART_IDLE_CFG_RX_IDLE_COND_SHIFT) & UART_IDLE_CFG_RX_IDLE_COND_MASK)
100 #define UART_IDLE_CFG_RX_IDLE_COND_GET(x) (((uint32_t)(x) & UART_IDLE_CFG_RX_IDLE_COND_MASK) >> UART_IDLE_CFG_RX_IDLE_COND_SHIFT)
101 
102 /*
103  * RX_IDLE_EN (RW)
104  *
105  * UART Idle Detect Enable
106  * 0 - Disable
107  * 1 - Enable
108  * it should be enabled if enable address match feature
109  */
110 #define UART_IDLE_CFG_RX_IDLE_EN_MASK (0x100U)
111 #define UART_IDLE_CFG_RX_IDLE_EN_SHIFT (8U)
112 #define UART_IDLE_CFG_RX_IDLE_EN_SET(x) (((uint32_t)(x) << UART_IDLE_CFG_RX_IDLE_EN_SHIFT) & UART_IDLE_CFG_RX_IDLE_EN_MASK)
113 #define UART_IDLE_CFG_RX_IDLE_EN_GET(x) (((uint32_t)(x) & UART_IDLE_CFG_RX_IDLE_EN_MASK) >> UART_IDLE_CFG_RX_IDLE_EN_SHIFT)
114 
115 /*
116  * RX_IDLE_THR (RW)
117  *
118  * Threshold for UART Receive Idle detection (in terms of bits)
119  */
120 #define UART_IDLE_CFG_RX_IDLE_THR_MASK (0xFFU)
121 #define UART_IDLE_CFG_RX_IDLE_THR_SHIFT (0U)
122 #define UART_IDLE_CFG_RX_IDLE_THR_SET(x) (((uint32_t)(x) << UART_IDLE_CFG_RX_IDLE_THR_SHIFT) & UART_IDLE_CFG_RX_IDLE_THR_MASK)
123 #define UART_IDLE_CFG_RX_IDLE_THR_GET(x) (((uint32_t)(x) & UART_IDLE_CFG_RX_IDLE_THR_MASK) >> UART_IDLE_CFG_RX_IDLE_THR_SHIFT)
124 
125 /* Bitfield definition for register: ADDR_CFG */
126 /*
127  * TXEN_9BIT (RW)
128  *
129  * set to use 9bit mode for transmitter,
130  * will set the MSB for the first character as address flag, keep 0 for others.
131  */
132 #define UART_ADDR_CFG_TXEN_9BIT_MASK (0x100000UL)
133 #define UART_ADDR_CFG_TXEN_9BIT_SHIFT (20U)
134 #define UART_ADDR_CFG_TXEN_9BIT_SET(x) (((uint32_t)(x) << UART_ADDR_CFG_TXEN_9BIT_SHIFT) & UART_ADDR_CFG_TXEN_9BIT_MASK)
135 #define UART_ADDR_CFG_TXEN_9BIT_GET(x) (((uint32_t)(x) & UART_ADDR_CFG_TXEN_9BIT_MASK) >> UART_ADDR_CFG_TXEN_9BIT_SHIFT)
136 
137 /*
138  * RXEN_ADDR_MSB (RW)
139  *
140  * set to use MSB as address flag at receiver(actually this is done by software set correct MSB in addr0/addr1).
141  * Clr to use first character as address.
142  * Only needed if enable address match feature
143  */
144 #define UART_ADDR_CFG_RXEN_ADDR_MSB_MASK (0x80000UL)
145 #define UART_ADDR_CFG_RXEN_ADDR_MSB_SHIFT (19U)
146 #define UART_ADDR_CFG_RXEN_ADDR_MSB_SET(x) (((uint32_t)(x) << UART_ADDR_CFG_RXEN_ADDR_MSB_SHIFT) & UART_ADDR_CFG_RXEN_ADDR_MSB_MASK)
147 #define UART_ADDR_CFG_RXEN_ADDR_MSB_GET(x) (((uint32_t)(x) & UART_ADDR_CFG_RXEN_ADDR_MSB_MASK) >> UART_ADDR_CFG_RXEN_ADDR_MSB_SHIFT)
148 
149 /*
150  * RXEN_9BIT (RW)
151  *
152  * set to use 9bit mode for receiver, only valid if rxen_addr_msb is set
153  */
154 #define UART_ADDR_CFG_RXEN_9BIT_MASK (0x40000UL)
155 #define UART_ADDR_CFG_RXEN_9BIT_SHIFT (18U)
156 #define UART_ADDR_CFG_RXEN_9BIT_SET(x) (((uint32_t)(x) << UART_ADDR_CFG_RXEN_9BIT_SHIFT) & UART_ADDR_CFG_RXEN_9BIT_MASK)
157 #define UART_ADDR_CFG_RXEN_9BIT_GET(x) (((uint32_t)(x) & UART_ADDR_CFG_RXEN_9BIT_MASK) >> UART_ADDR_CFG_RXEN_9BIT_SHIFT)
158 
159 /*
160  * A1_EN (RW)
161  *
162  * enable addr1 compare for the first character.
163  * If a1_en OR a0_en, then do not receive data if address not match.
164  * If ~a1_en AND ~a0_en, the receive all data like before.
165  * NOTE: should set idle_tmout_en if enable address match feature
166  */
167 #define UART_ADDR_CFG_A1_EN_MASK (0x20000UL)
168 #define UART_ADDR_CFG_A1_EN_SHIFT (17U)
169 #define UART_ADDR_CFG_A1_EN_SET(x) (((uint32_t)(x) << UART_ADDR_CFG_A1_EN_SHIFT) & UART_ADDR_CFG_A1_EN_MASK)
170 #define UART_ADDR_CFG_A1_EN_GET(x) (((uint32_t)(x) & UART_ADDR_CFG_A1_EN_MASK) >> UART_ADDR_CFG_A1_EN_SHIFT)
171 
172 /*
173  * A0_EN (RW)
174  *
175  * enable addr0 compare for the first character
176  */
177 #define UART_ADDR_CFG_A0_EN_MASK (0x10000UL)
178 #define UART_ADDR_CFG_A0_EN_SHIFT (16U)
179 #define UART_ADDR_CFG_A0_EN_SET(x) (((uint32_t)(x) << UART_ADDR_CFG_A0_EN_SHIFT) & UART_ADDR_CFG_A0_EN_MASK)
180 #define UART_ADDR_CFG_A0_EN_GET(x) (((uint32_t)(x) & UART_ADDR_CFG_A0_EN_MASK) >> UART_ADDR_CFG_A0_EN_SHIFT)
181 
182 /*
183  * ADDR1 (RW)
184  *
185  * address 1 fileld.
186  * in 9bit mode, this is the full address byte.
187  * For other mode(8/7/6/5bit), MSB should be set for address flag.
188  * If want address==0 to be matched at 8bit mode, should set addr1=0x80
189  */
190 #define UART_ADDR_CFG_ADDR1_MASK (0xFF00U)
191 #define UART_ADDR_CFG_ADDR1_SHIFT (8U)
192 #define UART_ADDR_CFG_ADDR1_SET(x) (((uint32_t)(x) << UART_ADDR_CFG_ADDR1_SHIFT) & UART_ADDR_CFG_ADDR1_MASK)
193 #define UART_ADDR_CFG_ADDR1_GET(x) (((uint32_t)(x) & UART_ADDR_CFG_ADDR1_MASK) >> UART_ADDR_CFG_ADDR1_SHIFT)
194 
195 /*
196  * ADDR0 (RW)
197  *
198  * address 0 field.
199  */
200 #define UART_ADDR_CFG_ADDR0_MASK (0xFFU)
201 #define UART_ADDR_CFG_ADDR0_SHIFT (0U)
202 #define UART_ADDR_CFG_ADDR0_SET(x) (((uint32_t)(x) << UART_ADDR_CFG_ADDR0_SHIFT) & UART_ADDR_CFG_ADDR0_MASK)
203 #define UART_ADDR_CFG_ADDR0_GET(x) (((uint32_t)(x) & UART_ADDR_CFG_ADDR0_MASK) >> UART_ADDR_CFG_ADDR0_SHIFT)
204 
205 /* Bitfield definition for register: IIR2 */
206 /*
207  * RXIDLE_FLAG (W1C)
208  *
209  * UART RX IDLE Flag, assert after rxd high and then rx idle timeout, write one clear
210  * 0 - UART RX is busy
211  * 1 - UART RX is idle
212  */
213 #define UART_IIR2_RXIDLE_FLAG_MASK (0x80000000UL)
214 #define UART_IIR2_RXIDLE_FLAG_SHIFT (31U)
215 #define UART_IIR2_RXIDLE_FLAG_SET(x) (((uint32_t)(x) << UART_IIR2_RXIDLE_FLAG_SHIFT) & UART_IIR2_RXIDLE_FLAG_MASK)
216 #define UART_IIR2_RXIDLE_FLAG_GET(x) (((uint32_t)(x) & UART_IIR2_RXIDLE_FLAG_MASK) >> UART_IIR2_RXIDLE_FLAG_SHIFT)
217 
218 /*
219  * TXIDLE_FLAG (W1C)
220  *
221  * UART TX IDLE Flag, assert after txd high and then tx idle timeout, write one clear
222  * 0 - UART TX is busy
223  * 1 - UART TX is idle
224  */
225 #define UART_IIR2_TXIDLE_FLAG_MASK (0x40000000UL)
226 #define UART_IIR2_TXIDLE_FLAG_SHIFT (30U)
227 #define UART_IIR2_TXIDLE_FLAG_SET(x) (((uint32_t)(x) << UART_IIR2_TXIDLE_FLAG_SHIFT) & UART_IIR2_TXIDLE_FLAG_MASK)
228 #define UART_IIR2_TXIDLE_FLAG_GET(x) (((uint32_t)(x) & UART_IIR2_TXIDLE_FLAG_MASK) >> UART_IIR2_TXIDLE_FLAG_SHIFT)
229 
230 /*
231  * ADDR_MATCH (W1C)
232  *
233  * address match irq status, assert if either address match(and enabled). Write one clear
234  * NOTE: the address byte may not moved by DMA at this point.
235  * User can wait next addr_match_idle irq for the whole data include address
236  */
237 #define UART_IIR2_ADDR_MATCH_MASK (0x20000000UL)
238 #define UART_IIR2_ADDR_MATCH_SHIFT (29U)
239 #define UART_IIR2_ADDR_MATCH_SET(x) (((uint32_t)(x) << UART_IIR2_ADDR_MATCH_SHIFT) & UART_IIR2_ADDR_MATCH_MASK)
240 #define UART_IIR2_ADDR_MATCH_GET(x) (((uint32_t)(x) & UART_IIR2_ADDR_MATCH_MASK) >> UART_IIR2_ADDR_MATCH_SHIFT)
241 
242 /*
243  * ADDR_MATCH_IDLE (W1C)
244  *
245  * address match and idle irq status, assert at rx bus idle if address match event triggered.
246  * Write one clear;
247  */
248 #define UART_IIR2_ADDR_MATCH_IDLE_MASK (0x10000000UL)
249 #define UART_IIR2_ADDR_MATCH_IDLE_SHIFT (28U)
250 #define UART_IIR2_ADDR_MATCH_IDLE_SET(x) (((uint32_t)(x) << UART_IIR2_ADDR_MATCH_IDLE_SHIFT) & UART_IIR2_ADDR_MATCH_IDLE_MASK)
251 #define UART_IIR2_ADDR_MATCH_IDLE_GET(x) (((uint32_t)(x) & UART_IIR2_ADDR_MATCH_IDLE_MASK) >> UART_IIR2_ADDR_MATCH_IDLE_SHIFT)
252 
253 /*
254  * DATA_LOST (W1C)
255  *
256  * assert if data lost before address match status, write one clear;
257  * It will not assert if no address match occurs
258  */
259 #define UART_IIR2_DATA_LOST_MASK (0x8000000UL)
260 #define UART_IIR2_DATA_LOST_SHIFT (27U)
261 #define UART_IIR2_DATA_LOST_SET(x) (((uint32_t)(x) << UART_IIR2_DATA_LOST_SHIFT) & UART_IIR2_DATA_LOST_MASK)
262 #define UART_IIR2_DATA_LOST_GET(x) (((uint32_t)(x) & UART_IIR2_DATA_LOST_MASK) >> UART_IIR2_DATA_LOST_SHIFT)
263 
264 /*
265  * LSR_ERRF_STS (W1C)
266  *
267  * Receiving FIFO error status,when occurs parity error、framing error or break error,it will generatei;write 1 clear to 0
268  */
269 #define UART_IIR2_LSR_ERRF_STS_MASK (0x4000000UL)
270 #define UART_IIR2_LSR_ERRF_STS_SHIFT (26U)
271 #define UART_IIR2_LSR_ERRF_STS_SET(x) (((uint32_t)(x) << UART_IIR2_LSR_ERRF_STS_SHIFT) & UART_IIR2_LSR_ERRF_STS_MASK)
272 #define UART_IIR2_LSR_ERRF_STS_GET(x) (((uint32_t)(x) & UART_IIR2_LSR_ERRF_STS_MASK) >> UART_IIR2_LSR_ERRF_STS_SHIFT)
273 
274 /*
275  * LSR_BREAK_STS (W1C)
276  *
277  * Transmission break status, when occurs break error,it will generate;write 1 clear 0
278  */
279 #define UART_IIR2_LSR_BREAK_STS_MASK (0x2000000UL)
280 #define UART_IIR2_LSR_BREAK_STS_SHIFT (25U)
281 #define UART_IIR2_LSR_BREAK_STS_SET(x) (((uint32_t)(x) << UART_IIR2_LSR_BREAK_STS_SHIFT) & UART_IIR2_LSR_BREAK_STS_MASK)
282 #define UART_IIR2_LSR_BREAK_STS_GET(x) (((uint32_t)(x) & UART_IIR2_LSR_BREAK_STS_MASK) >> UART_IIR2_LSR_BREAK_STS_SHIFT)
283 
284 /*
285  * LSR_FRAMING_STS (W1C)
286  *
287  * Framing error status,when occurs frame error,it will generate;write 1 clear 0
288  */
289 #define UART_IIR2_LSR_FRAMING_STS_MASK (0x1000000UL)
290 #define UART_IIR2_LSR_FRAMING_STS_SHIFT (24U)
291 #define UART_IIR2_LSR_FRAMING_STS_SET(x) (((uint32_t)(x) << UART_IIR2_LSR_FRAMING_STS_SHIFT) & UART_IIR2_LSR_FRAMING_STS_MASK)
292 #define UART_IIR2_LSR_FRAMING_STS_GET(x) (((uint32_t)(x) & UART_IIR2_LSR_FRAMING_STS_MASK) >> UART_IIR2_LSR_FRAMING_STS_SHIFT)
293 
294 /*
295  * LSR_PARITY_STS (W1C)
296  *
297  * Parity error status,when occurs parity error ,it will generate;write 1 clear 0
298  */
299 #define UART_IIR2_LSR_PARITY_STS_MASK (0x800000UL)
300 #define UART_IIR2_LSR_PARITY_STS_SHIFT (23U)
301 #define UART_IIR2_LSR_PARITY_STS_SET(x) (((uint32_t)(x) << UART_IIR2_LSR_PARITY_STS_SHIFT) & UART_IIR2_LSR_PARITY_STS_MASK)
302 #define UART_IIR2_LSR_PARITY_STS_GET(x) (((uint32_t)(x) & UART_IIR2_LSR_PARITY_STS_MASK) >> UART_IIR2_LSR_PARITY_STS_SHIFT)
303 
304 /*
305  * LSR_OVERRUN_STS (W1C)
306  *
307  * Receive data overload status;when occurs overrun error ,it will generate;write 1 clear 0
308  */
309 #define UART_IIR2_LSR_OVERRUN_STS_MASK (0x400000UL)
310 #define UART_IIR2_LSR_OVERRUN_STS_SHIFT (22U)
311 #define UART_IIR2_LSR_OVERRUN_STS_SET(x) (((uint32_t)(x) << UART_IIR2_LSR_OVERRUN_STS_SHIFT) & UART_IIR2_LSR_OVERRUN_STS_MASK)
312 #define UART_IIR2_LSR_OVERRUN_STS_GET(x) (((uint32_t)(x) & UART_IIR2_LSR_OVERRUN_STS_MASK) >> UART_IIR2_LSR_OVERRUN_STS_SHIFT)
313 
314 /*
315  * FIFOED (RO)
316  *
317  * FIFOs enabled
318  * These two bits are 1 when bit 0 of the FIFO Control
319  * Register (FIFOE) is set to 1.
320  */
321 #define UART_IIR2_FIFOED_MASK (0xC0U)
322 #define UART_IIR2_FIFOED_SHIFT (6U)
323 #define UART_IIR2_FIFOED_GET(x) (((uint32_t)(x) & UART_IIR2_FIFOED_MASK) >> UART_IIR2_FIFOED_SHIFT)
324 
325 /*
326  * INTRID (RO)
327  *
328  * Interrupt ID, see IIR2 for detail decoding
329  */
330 #define UART_IIR2_INTRID_MASK (0xFU)
331 #define UART_IIR2_INTRID_SHIFT (0U)
332 #define UART_IIR2_INTRID_GET(x) (((uint32_t)(x) & UART_IIR2_INTRID_MASK) >> UART_IIR2_INTRID_SHIFT)
333 
334 /* Bitfield definition for register: CFG */
335 /*
336  * FIFOSIZE (RO)
337  *
338  * The depth of RXFIFO and TXFIFO
339  * 0: 16-byte FIFO
340  * 1: 32-byte FIFO
341  * 2: 64-byte FIFO
342  * 3: 128-byte FIFO
343  */
344 #define UART_CFG_FIFOSIZE_MASK (0x3U)
345 #define UART_CFG_FIFOSIZE_SHIFT (0U)
346 #define UART_CFG_FIFOSIZE_GET(x) (((uint32_t)(x) & UART_CFG_FIFOSIZE_MASK) >> UART_CFG_FIFOSIZE_SHIFT)
347 
348 /* Bitfield definition for register: OSCR */
349 /*
350  * OSC (RW)
351  *
352  * Over-sample control
353  * The value must be an even number; any odd value
354  * writes to this field will be converted to an even value.
355  * OSC=0: reserved
356  * OSC<=8: The over-sample ratio is 8
357  * 8 < OSC< 32: The over sample ratio is OSC
358  */
359 #define UART_OSCR_OSC_MASK (0x1FU)
360 #define UART_OSCR_OSC_SHIFT (0U)
361 #define UART_OSCR_OSC_SET(x) (((uint32_t)(x) << UART_OSCR_OSC_SHIFT) & UART_OSCR_OSC_MASK)
362 #define UART_OSCR_OSC_GET(x) (((uint32_t)(x) & UART_OSCR_OSC_MASK) >> UART_OSCR_OSC_SHIFT)
363 
364 /* Bitfield definition for register: FCRR */
365 /*
366  * DMA_STOP_EN (RW)
367  *
368  * enable dma stopped function
369  */
370 #define UART_FCRR_DMA_STOP_EN_MASK (0x80000000UL)
371 #define UART_FCRR_DMA_STOP_EN_SHIFT (31U)
372 #define UART_FCRR_DMA_STOP_EN_SET(x) (((uint32_t)(x) << UART_FCRR_DMA_STOP_EN_SHIFT) & UART_FCRR_DMA_STOP_EN_MASK)
373 #define UART_FCRR_DMA_STOP_EN_GET(x) (((uint32_t)(x) & UART_FCRR_DMA_STOP_EN_MASK) >> UART_FCRR_DMA_STOP_EN_SHIFT)
374 
375 /*
376  * DMA_STOPPED_WRITE_CLEAR (WO)
377  *
378  * dma stopped function by writing 1 clear 0
379  */
380 #define UART_FCRR_DMA_STOPPED_WRITE_CLEAR_MASK (0x40000000UL)
381 #define UART_FCRR_DMA_STOPPED_WRITE_CLEAR_SHIFT (30U)
382 #define UART_FCRR_DMA_STOPPED_WRITE_CLEAR_SET(x) (((uint32_t)(x) << UART_FCRR_DMA_STOPPED_WRITE_CLEAR_SHIFT) & UART_FCRR_DMA_STOPPED_WRITE_CLEAR_MASK)
383 #define UART_FCRR_DMA_STOPPED_WRITE_CLEAR_GET(x) (((uint32_t)(x) & UART_FCRR_DMA_STOPPED_WRITE_CLEAR_MASK) >> UART_FCRR_DMA_STOPPED_WRITE_CLEAR_SHIFT)
384 
385 /*
386  * BAUD_ACT_ENJ_PCLK (RW)
387  *
388  * Set the value of the configuration object.
389  */
390 #define UART_FCRR_BAUD_ACT_ENJ_PCLK_MASK (0x2000000UL)
391 #define UART_FCRR_BAUD_ACT_ENJ_PCLK_SHIFT (25U)
392 #define UART_FCRR_BAUD_ACT_ENJ_PCLK_SET(x) (((uint32_t)(x) << UART_FCRR_BAUD_ACT_ENJ_PCLK_SHIFT) & UART_FCRR_BAUD_ACT_ENJ_PCLK_MASK)
393 #define UART_FCRR_BAUD_ACT_ENJ_PCLK_GET(x) (((uint32_t)(x) & UART_FCRR_BAUD_ACT_ENJ_PCLK_MASK) >> UART_FCRR_BAUD_ACT_ENJ_PCLK_SHIFT)
394 
395 /*
396  * TMOUT_RXDMA_DIS (RW)
397  *
398  * set to disable timeout rx dma request
399  */
400 #define UART_FCRR_TMOUT_RXDMA_DIS_MASK (0x1000000UL)
401 #define UART_FCRR_TMOUT_RXDMA_DIS_SHIFT (24U)
402 #define UART_FCRR_TMOUT_RXDMA_DIS_SET(x) (((uint32_t)(x) << UART_FCRR_TMOUT_RXDMA_DIS_SHIFT) & UART_FCRR_TMOUT_RXDMA_DIS_MASK)
403 #define UART_FCRR_TMOUT_RXDMA_DIS_GET(x) (((uint32_t)(x) & UART_FCRR_TMOUT_RXDMA_DIS_MASK) >> UART_FCRR_TMOUT_RXDMA_DIS_SHIFT)
404 
405 /*
406  * FIFOT4EN (RW)
407  *
408  * set to use new 4bit fifo threshold(TFIFOT4 and RFIFOT4)
409  * clr to use 2bit(TFIFOT and RFIFOT)
410  */
411 #define UART_FCRR_FIFOT4EN_MASK (0x800000UL)
412 #define UART_FCRR_FIFOT4EN_SHIFT (23U)
413 #define UART_FCRR_FIFOT4EN_SET(x) (((uint32_t)(x) << UART_FCRR_FIFOT4EN_SHIFT) & UART_FCRR_FIFOT4EN_MASK)
414 #define UART_FCRR_FIFOT4EN_GET(x) (((uint32_t)(x) & UART_FCRR_FIFOT4EN_MASK) >> UART_FCRR_FIFOT4EN_SHIFT)
415 
416 /*
417  * TFIFOT4 (RW)
418  *
419  * txfifo threshold(0 for 1byte, 0xF for 32bytes), uart will send tx_dma_req when data in fifo is less than threshold.
420  */
421 #define UART_FCRR_TFIFOT4_MASK (0x1F0000UL)
422 #define UART_FCRR_TFIFOT4_SHIFT (16U)
423 #define UART_FCRR_TFIFOT4_SET(x) (((uint32_t)(x) << UART_FCRR_TFIFOT4_SHIFT) & UART_FCRR_TFIFOT4_MASK)
424 #define UART_FCRR_TFIFOT4_GET(x) (((uint32_t)(x) & UART_FCRR_TFIFOT4_MASK) >> UART_FCRR_TFIFOT4_SHIFT)
425 
426 /*
427  * RFIFOT4 (RW)
428  *
429  * rxfifo threshold(0 for 1byte, 0xF for 32bytes).
430  * Uart will send rx_dma_req if data in fifo reachs the threshold, also will set the rxdata irq if enabled
431  */
432 #define UART_FCRR_RFIFOT4_MASK (0x1F00U)
433 #define UART_FCRR_RFIFOT4_SHIFT (8U)
434 #define UART_FCRR_RFIFOT4_SET(x) (((uint32_t)(x) << UART_FCRR_RFIFOT4_SHIFT) & UART_FCRR_RFIFOT4_MASK)
435 #define UART_FCRR_RFIFOT4_GET(x) (((uint32_t)(x) & UART_FCRR_RFIFOT4_MASK) >> UART_FCRR_RFIFOT4_SHIFT)
436 
437 /*
438  * RFIFOT (RW)
439  *
440  * Receiver FIFO trigger level
441  */
442 #define UART_FCRR_RFIFOT_MASK (0xC0U)
443 #define UART_FCRR_RFIFOT_SHIFT (6U)
444 #define UART_FCRR_RFIFOT_SET(x) (((uint32_t)(x) << UART_FCRR_RFIFOT_SHIFT) & UART_FCRR_RFIFOT_MASK)
445 #define UART_FCRR_RFIFOT_GET(x) (((uint32_t)(x) & UART_FCRR_RFIFOT_MASK) >> UART_FCRR_RFIFOT_SHIFT)
446 
447 /*
448  * TFIFOT (RW)
449  *
450  * Transmitter FIFO trigger level
451  */
452 #define UART_FCRR_TFIFOT_MASK (0x30U)
453 #define UART_FCRR_TFIFOT_SHIFT (4U)
454 #define UART_FCRR_TFIFOT_SET(x) (((uint32_t)(x) << UART_FCRR_TFIFOT_SHIFT) & UART_FCRR_TFIFOT_MASK)
455 #define UART_FCRR_TFIFOT_GET(x) (((uint32_t)(x) & UART_FCRR_TFIFOT_MASK) >> UART_FCRR_TFIFOT_SHIFT)
456 
457 /*
458  * DMAE (RW)
459  *
460  * DMA enable
461  * 0: Disable
462  * 1: Enable
463  */
464 #define UART_FCRR_DMAE_MASK (0x8U)
465 #define UART_FCRR_DMAE_SHIFT (3U)
466 #define UART_FCRR_DMAE_SET(x) (((uint32_t)(x) << UART_FCRR_DMAE_SHIFT) & UART_FCRR_DMAE_MASK)
467 #define UART_FCRR_DMAE_GET(x) (((uint32_t)(x) & UART_FCRR_DMAE_MASK) >> UART_FCRR_DMAE_SHIFT)
468 
469 /*
470  * TFIFORST (WO)
471  *
472  * Transmitter FIFO reset
473  * Write 1 to clear all bytes in the TXFIFO and resets its
474  * counter. The Transmitter Shift Register is not cleared.
475  * This bit will automatically be cleared.
476  */
477 #define UART_FCRR_TFIFORST_MASK (0x4U)
478 #define UART_FCRR_TFIFORST_SHIFT (2U)
479 #define UART_FCRR_TFIFORST_SET(x) (((uint32_t)(x) << UART_FCRR_TFIFORST_SHIFT) & UART_FCRR_TFIFORST_MASK)
480 #define UART_FCRR_TFIFORST_GET(x) (((uint32_t)(x) & UART_FCRR_TFIFORST_MASK) >> UART_FCRR_TFIFORST_SHIFT)
481 
482 /*
483  * RFIFORST (WO)
484  *
485  * Receiver FIFO reset
486  * Write 1 to clear all bytes in the RXFIFO and resets its
487  * counter. The Receiver Shift Register is not cleared.
488  * This bit will automatically be cleared.
489  */
490 #define UART_FCRR_RFIFORST_MASK (0x2U)
491 #define UART_FCRR_RFIFORST_SHIFT (1U)
492 #define UART_FCRR_RFIFORST_SET(x) (((uint32_t)(x) << UART_FCRR_RFIFORST_SHIFT) & UART_FCRR_RFIFORST_MASK)
493 #define UART_FCRR_RFIFORST_GET(x) (((uint32_t)(x) & UART_FCRR_RFIFORST_MASK) >> UART_FCRR_RFIFORST_SHIFT)
494 
495 /*
496  * FIFOE (RW)
497  *
498  * FIFO enable
499  * Write 1 to enable both the transmitter and receiver
500  * FIFOs.
501  * The FIFOs are reset when the value of this bit toggles.
502  */
503 #define UART_FCRR_FIFOE_MASK (0x1U)
504 #define UART_FCRR_FIFOE_SHIFT (0U)
505 #define UART_FCRR_FIFOE_SET(x) (((uint32_t)(x) << UART_FCRR_FIFOE_SHIFT) & UART_FCRR_FIFOE_MASK)
506 #define UART_FCRR_FIFOE_GET(x) (((uint32_t)(x) & UART_FCRR_FIFOE_MASK) >> UART_FCRR_FIFOE_SHIFT)
507 
508 /* Bitfield definition for register: MOTO_CFG */
509 /*
510  * SWTRG (WO)
511  *
512  * software trigger. User should avoid use sw/hw trigger at same time, otherwise result unknown.
513  * Hardware auto reset.
514  */
515 #define UART_MOTO_CFG_SWTRG_MASK (0x80000000UL)
516 #define UART_MOTO_CFG_SWTRG_SHIFT (31U)
517 #define UART_MOTO_CFG_SWTRG_SET(x) (((uint32_t)(x) << UART_MOTO_CFG_SWTRG_SHIFT) & UART_MOTO_CFG_SWTRG_MASK)
518 #define UART_MOTO_CFG_SWTRG_GET(x) (((uint32_t)(x) & UART_MOTO_CFG_SWTRG_MASK) >> UART_MOTO_CFG_SWTRG_SHIFT)
519 
520 /*
521  * TXSTOP_OPT (RW)
522  *
523  * set to use baud_mx as txstop_bits counter, for control DE delay after STOP
524  */
525 #define UART_MOTO_CFG_TXSTOP_OPT_MASK (0x1000000UL)
526 #define UART_MOTO_CFG_TXSTOP_OPT_SHIFT (24U)
527 #define UART_MOTO_CFG_TXSTOP_OPT_SET(x) (((uint32_t)(x) << UART_MOTO_CFG_TXSTOP_OPT_SHIFT) & UART_MOTO_CFG_TXSTOP_OPT_MASK)
528 #define UART_MOTO_CFG_TXSTOP_OPT_GET(x) (((uint32_t)(x) & UART_MOTO_CFG_TXSTOP_OPT_MASK) >> UART_MOTO_CFG_TXSTOP_OPT_SHIFT)
529 
530 /*
531  * TXPRE_DLY (RW)
532  *
533  * if set to none-zero value, will assert DE before START bit, with the unit of clock dividered after dll/dlm
534  */
535 #define UART_MOTO_CFG_TXPRE_DLY_MASK (0xFF0000UL)
536 #define UART_MOTO_CFG_TXPRE_DLY_SHIFT (16U)
537 #define UART_MOTO_CFG_TXPRE_DLY_SET(x) (((uint32_t)(x) << UART_MOTO_CFG_TXPRE_DLY_SHIFT) & UART_MOTO_CFG_TXPRE_DLY_MASK)
538 #define UART_MOTO_CFG_TXPRE_DLY_GET(x) (((uint32_t)(x) & UART_MOTO_CFG_TXPRE_DLY_MASK) >> UART_MOTO_CFG_TXPRE_DLY_SHIFT)
539 
540 /*
541  * TXSTP_BITS (RW)
542  *
543  * if TXSTOP_INSERT is enabled, the STOP bits to be inserted between each byte. 0 for 1 bit; 0xFF for 256bits
544  */
545 #define UART_MOTO_CFG_TXSTP_BITS_MASK (0xFF00U)
546 #define UART_MOTO_CFG_TXSTP_BITS_SHIFT (8U)
547 #define UART_MOTO_CFG_TXSTP_BITS_SET(x) (((uint32_t)(x) << UART_MOTO_CFG_TXSTP_BITS_SHIFT) & UART_MOTO_CFG_TXSTP_BITS_MASK)
548 #define UART_MOTO_CFG_TXSTP_BITS_GET(x) (((uint32_t)(x) & UART_MOTO_CFG_TXSTP_BITS_MASK) >> UART_MOTO_CFG_TXSTP_BITS_SHIFT)
549 
550 /*
551  * HWTRG_EN (RW)
552  *
553  * set to enable hardware trigger(trigger from moto is shared by other UART)
554  */
555 #define UART_MOTO_CFG_HWTRG_EN_MASK (0x80U)
556 #define UART_MOTO_CFG_HWTRG_EN_SHIFT (7U)
557 #define UART_MOTO_CFG_HWTRG_EN_SET(x) (((uint32_t)(x) << UART_MOTO_CFG_HWTRG_EN_SHIFT) & UART_MOTO_CFG_HWTRG_EN_MASK)
558 #define UART_MOTO_CFG_HWTRG_EN_GET(x) (((uint32_t)(x) & UART_MOTO_CFG_HWTRG_EN_MASK) >> UART_MOTO_CFG_HWTRG_EN_SHIFT)
559 
560 /*
561  * TRG_MODE (RW)
562  *
563  * set to enable trigger mode.
564  * software should push needed data into txbuffer frist, uart will not start transmission at this time.
565  * User should send trigger signal(by hw or sw), uart will send all data in txfifo till empty
566  * NOTE: the hw_trigger should be pulse signal from trig mux.
567  */
568 #define UART_MOTO_CFG_TRG_MODE_MASK (0x40U)
569 #define UART_MOTO_CFG_TRG_MODE_SHIFT (6U)
570 #define UART_MOTO_CFG_TRG_MODE_SET(x) (((uint32_t)(x) << UART_MOTO_CFG_TRG_MODE_SHIFT) & UART_MOTO_CFG_TRG_MODE_MASK)
571 #define UART_MOTO_CFG_TRG_MODE_GET(x) (((uint32_t)(x) & UART_MOTO_CFG_TRG_MODE_MASK) >> UART_MOTO_CFG_TRG_MODE_SHIFT)
572 
573 /*
574  * TRG_CLR_RFIFO (RW)
575  *
576  * set to enable the feature that, clear rxfifo at tx trigger(sw or hw), avoid unexpected data in rxfifo.
577  */
578 #define UART_MOTO_CFG_TRG_CLR_RFIFO_MASK (0x20U)
579 #define UART_MOTO_CFG_TRG_CLR_RFIFO_SHIFT (5U)
580 #define UART_MOTO_CFG_TRG_CLR_RFIFO_SET(x) (((uint32_t)(x) << UART_MOTO_CFG_TRG_CLR_RFIFO_SHIFT) & UART_MOTO_CFG_TRG_CLR_RFIFO_MASK)
581 #define UART_MOTO_CFG_TRG_CLR_RFIFO_GET(x) (((uint32_t)(x) & UART_MOTO_CFG_TRG_CLR_RFIFO_MASK) >> UART_MOTO_CFG_TRG_CLR_RFIFO_SHIFT)
582 
583 /*
584  * TXSTOP_INSERT (RW)
585  *
586  * set to insert STOP bits between each tx byte till tx fifo empty.
587  * NOTE: there will be no 1.5/2 STOP bits if enabled this feature, LCR.STB should be set to 0 if this bit is set
588  */
589 #define UART_MOTO_CFG_TXSTOP_INSERT_MASK (0x10U)
590 #define UART_MOTO_CFG_TXSTOP_INSERT_SHIFT (4U)
591 #define UART_MOTO_CFG_TXSTOP_INSERT_SET(x) (((uint32_t)(x) << UART_MOTO_CFG_TXSTOP_INSERT_SHIFT) & UART_MOTO_CFG_TXSTOP_INSERT_MASK)
592 #define UART_MOTO_CFG_TXSTOP_INSERT_GET(x) (((uint32_t)(x) & UART_MOTO_CFG_TXSTOP_INSERT_MASK) >> UART_MOTO_CFG_TXSTOP_INSERT_SHIFT)
593 
594 /* Bitfield definition for register: RBR */
595 /*
596  * RX_BREAK_ERR (RO)
597  *
598  * can see if a break error occurs per byte of data(including intermediate state)
599  */
600 #define UART_RBR_RX_BREAK_ERR_MASK (0x400U)
601 #define UART_RBR_RX_BREAK_ERR_SHIFT (10U)
602 #define UART_RBR_RX_BREAK_ERR_GET(x) (((uint32_t)(x) & UART_RBR_RX_BREAK_ERR_MASK) >> UART_RBR_RX_BREAK_ERR_SHIFT)
603 
604 /*
605  * FRAMING_ERR (RO)
606  *
607  * can see if a framing error occurs per byte of data(including intermediate state)
608  */
609 #define UART_RBR_FRAMING_ERR_MASK (0x200U)
610 #define UART_RBR_FRAMING_ERR_SHIFT (9U)
611 #define UART_RBR_FRAMING_ERR_GET(x) (((uint32_t)(x) & UART_RBR_FRAMING_ERR_MASK) >> UART_RBR_FRAMING_ERR_SHIFT)
612 
613 /*
614  * PARITY_ERR (RO)
615  *
616  * can see if a parity error occurs per byte of data(including intermediate state)
617  */
618 #define UART_RBR_PARITY_ERR_MASK (0x100U)
619 #define UART_RBR_PARITY_ERR_SHIFT (8U)
620 #define UART_RBR_PARITY_ERR_GET(x) (((uint32_t)(x) & UART_RBR_PARITY_ERR_MASK) >> UART_RBR_PARITY_ERR_SHIFT)
621 
622 /*
623  * RBR (RO)
624  *
625  * Receive data read port
626  */
627 #define UART_RBR_RBR_MASK (0xFFU)
628 #define UART_RBR_RBR_SHIFT (0U)
629 #define UART_RBR_RBR_GET(x) (((uint32_t)(x) & UART_RBR_RBR_MASK) >> UART_RBR_RBR_SHIFT)
630 
631 /* Bitfield definition for register: THR */
632 /*
633  * THR (WO)
634  *
635  * Transmit data write port
636  */
637 #define UART_THR_THR_MASK (0xFFU)
638 #define UART_THR_THR_SHIFT (0U)
639 #define UART_THR_THR_SET(x) (((uint32_t)(x) << UART_THR_THR_SHIFT) & UART_THR_THR_MASK)
640 #define UART_THR_THR_GET(x) (((uint32_t)(x) & UART_THR_THR_MASK) >> UART_THR_THR_SHIFT)
641 
642 /* Bitfield definition for register: DLL */
643 /*
644  * DLL (RW)
645  *
646  * Least significant byte of the Divisor Latch
647  */
648 #define UART_DLL_DLL_MASK (0xFFU)
649 #define UART_DLL_DLL_SHIFT (0U)
650 #define UART_DLL_DLL_SET(x) (((uint32_t)(x) << UART_DLL_DLL_SHIFT) & UART_DLL_DLL_MASK)
651 #define UART_DLL_DLL_GET(x) (((uint32_t)(x) & UART_DLL_DLL_MASK) >> UART_DLL_DLL_SHIFT)
652 
653 /* Bitfield definition for register: IER */
654 /*
655  * ERXIDLE (RW)
656  *
657  * Enable Receive Idle interrupt
658  * 0 - Disable Idle interrupt
659  * 1 - Enable Idle interrupt
660  */
661 #define UART_IER_ERXIDLE_MASK (0x80000000UL)
662 #define UART_IER_ERXIDLE_SHIFT (31U)
663 #define UART_IER_ERXIDLE_SET(x) (((uint32_t)(x) << UART_IER_ERXIDLE_SHIFT) & UART_IER_ERXIDLE_MASK)
664 #define UART_IER_ERXIDLE_GET(x) (((uint32_t)(x) & UART_IER_ERXIDLE_MASK) >> UART_IER_ERXIDLE_SHIFT)
665 
666 /*
667  * ETXIDLE (RW)
668  *
669  * enable transmit idle interrupt
670  */
671 #define UART_IER_ETXIDLE_MASK (0x40000000UL)
672 #define UART_IER_ETXIDLE_SHIFT (30U)
673 #define UART_IER_ETXIDLE_SET(x) (((uint32_t)(x) << UART_IER_ETXIDLE_SHIFT) & UART_IER_ETXIDLE_MASK)
674 #define UART_IER_ETXIDLE_GET(x) (((uint32_t)(x) & UART_IER_ETXIDLE_MASK) >> UART_IER_ETXIDLE_SHIFT)
675 
676 /*
677  * EADDRM (RW)
678  *
679  * enable ADDR_MATCH interrupt
680  */
681 #define UART_IER_EADDRM_MASK (0x20000000UL)
682 #define UART_IER_EADDRM_SHIFT (29U)
683 #define UART_IER_EADDRM_SET(x) (((uint32_t)(x) << UART_IER_EADDRM_SHIFT) & UART_IER_EADDRM_MASK)
684 #define UART_IER_EADDRM_GET(x) (((uint32_t)(x) & UART_IER_EADDRM_MASK) >> UART_IER_EADDRM_SHIFT)
685 
686 /*
687  * EADDRM_IDLE (RW)
688  *
689  * enable ADDR_MATCH_IDLE interrupt
690  */
691 #define UART_IER_EADDRM_IDLE_MASK (0x10000000UL)
692 #define UART_IER_EADDRM_IDLE_SHIFT (28U)
693 #define UART_IER_EADDRM_IDLE_SET(x) (((uint32_t)(x) << UART_IER_EADDRM_IDLE_SHIFT) & UART_IER_EADDRM_IDLE_MASK)
694 #define UART_IER_EADDRM_IDLE_GET(x) (((uint32_t)(x) & UART_IER_EADDRM_IDLE_MASK) >> UART_IER_EADDRM_IDLE_SHIFT)
695 
696 /*
697  * EDATLOST (RW)
698  *
699  * enable DATA_LOST interrupt
700  */
701 #define UART_IER_EDATLOST_MASK (0x8000000UL)
702 #define UART_IER_EDATLOST_SHIFT (27U)
703 #define UART_IER_EDATLOST_SET(x) (((uint32_t)(x) << UART_IER_EDATLOST_SHIFT) & UART_IER_EDATLOST_MASK)
704 #define UART_IER_EDATLOST_GET(x) (((uint32_t)(x) & UART_IER_EDATLOST_MASK) >> UART_IER_EDATLOST_SHIFT)
705 
706 /*
707  * LSR_ERRF_IRQ_EN (RW)
708  *
709  * enable transmission error interrupt
710  */
711 #define UART_IER_LSR_ERRF_IRQ_EN_MASK (0x4000000UL)
712 #define UART_IER_LSR_ERRF_IRQ_EN_SHIFT (26U)
713 #define UART_IER_LSR_ERRF_IRQ_EN_SET(x) (((uint32_t)(x) << UART_IER_LSR_ERRF_IRQ_EN_SHIFT) & UART_IER_LSR_ERRF_IRQ_EN_MASK)
714 #define UART_IER_LSR_ERRF_IRQ_EN_GET(x) (((uint32_t)(x) & UART_IER_LSR_ERRF_IRQ_EN_MASK) >> UART_IER_LSR_ERRF_IRQ_EN_SHIFT)
715 
716 /*
717  * LSR_BREAK_IRQ_EN (RW)
718  *
719  * enable break error interrupt
720  */
721 #define UART_IER_LSR_BREAK_IRQ_EN_MASK (0x2000000UL)
722 #define UART_IER_LSR_BREAK_IRQ_EN_SHIFT (25U)
723 #define UART_IER_LSR_BREAK_IRQ_EN_SET(x) (((uint32_t)(x) << UART_IER_LSR_BREAK_IRQ_EN_SHIFT) & UART_IER_LSR_BREAK_IRQ_EN_MASK)
724 #define UART_IER_LSR_BREAK_IRQ_EN_GET(x) (((uint32_t)(x) & UART_IER_LSR_BREAK_IRQ_EN_MASK) >> UART_IER_LSR_BREAK_IRQ_EN_SHIFT)
725 
726 /*
727  * LSR_FRAMING_IRQ_EN (RW)
728  *
729  * enable framing error interrupt
730  */
731 #define UART_IER_LSR_FRAMING_IRQ_EN_MASK (0x1000000UL)
732 #define UART_IER_LSR_FRAMING_IRQ_EN_SHIFT (24U)
733 #define UART_IER_LSR_FRAMING_IRQ_EN_SET(x) (((uint32_t)(x) << UART_IER_LSR_FRAMING_IRQ_EN_SHIFT) & UART_IER_LSR_FRAMING_IRQ_EN_MASK)
734 #define UART_IER_LSR_FRAMING_IRQ_EN_GET(x) (((uint32_t)(x) & UART_IER_LSR_FRAMING_IRQ_EN_MASK) >> UART_IER_LSR_FRAMING_IRQ_EN_SHIFT)
735 
736 /*
737  * LSR_PARITY_IRQ_EN (RW)
738  *
739  * enable parity error interrupt
740  */
741 #define UART_IER_LSR_PARITY_IRQ_EN_MASK (0x800000UL)
742 #define UART_IER_LSR_PARITY_IRQ_EN_SHIFT (23U)
743 #define UART_IER_LSR_PARITY_IRQ_EN_SET(x) (((uint32_t)(x) << UART_IER_LSR_PARITY_IRQ_EN_SHIFT) & UART_IER_LSR_PARITY_IRQ_EN_MASK)
744 #define UART_IER_LSR_PARITY_IRQ_EN_GET(x) (((uint32_t)(x) & UART_IER_LSR_PARITY_IRQ_EN_MASK) >> UART_IER_LSR_PARITY_IRQ_EN_SHIFT)
745 
746 /*
747  * LSR_OVERRUN_IRQ_EN (RW)
748  *
749  * enable data overload interrupt
750  */
751 #define UART_IER_LSR_OVERRUN_IRQ_EN_MASK (0x400000UL)
752 #define UART_IER_LSR_OVERRUN_IRQ_EN_SHIFT (22U)
753 #define UART_IER_LSR_OVERRUN_IRQ_EN_SET(x) (((uint32_t)(x) << UART_IER_LSR_OVERRUN_IRQ_EN_SHIFT) & UART_IER_LSR_OVERRUN_IRQ_EN_MASK)
754 #define UART_IER_LSR_OVERRUN_IRQ_EN_GET(x) (((uint32_t)(x) & UART_IER_LSR_OVERRUN_IRQ_EN_MASK) >> UART_IER_LSR_OVERRUN_IRQ_EN_SHIFT)
755 
756 /*
757  * EMSI (RW)
758  *
759  * Enable modem status interrupt
760  * The interrupt asserts when the status of one of the
761  * following occurs:
762  * The status of modem_rin, modem_dcdn,
763  * modem_dsrn or modem_ctsn (If the auto-cts mode is
764  * disabled) has been changed.
765  * If the auto-cts mode is enabled (MCR bit4 (AFE) = 1),
766  * modem_ctsn would be used to control the transmitter.
767  */
768 #define UART_IER_EMSI_MASK (0x8U)
769 #define UART_IER_EMSI_SHIFT (3U)
770 #define UART_IER_EMSI_SET(x) (((uint32_t)(x) << UART_IER_EMSI_SHIFT) & UART_IER_EMSI_MASK)
771 #define UART_IER_EMSI_GET(x) (((uint32_t)(x) & UART_IER_EMSI_MASK) >> UART_IER_EMSI_SHIFT)
772 
773 /*
774  * ELSI (RW)
775  *
776  * Enable receiver line status interrupt
777  */
778 #define UART_IER_ELSI_MASK (0x4U)
779 #define UART_IER_ELSI_SHIFT (2U)
780 #define UART_IER_ELSI_SET(x) (((uint32_t)(x) << UART_IER_ELSI_SHIFT) & UART_IER_ELSI_MASK)
781 #define UART_IER_ELSI_GET(x) (((uint32_t)(x) & UART_IER_ELSI_MASK) >> UART_IER_ELSI_SHIFT)
782 
783 /*
784  * ETHEI (RW)
785  *
786  * Enable transmitter holding register interrupt
787  */
788 #define UART_IER_ETHEI_MASK (0x2U)
789 #define UART_IER_ETHEI_SHIFT (1U)
790 #define UART_IER_ETHEI_SET(x) (((uint32_t)(x) << UART_IER_ETHEI_SHIFT) & UART_IER_ETHEI_MASK)
791 #define UART_IER_ETHEI_GET(x) (((uint32_t)(x) & UART_IER_ETHEI_MASK) >> UART_IER_ETHEI_SHIFT)
792 
793 /*
794  * ERBI (RW)
795  *
796  * Enable received data available interrupt and the
797  * character timeout interrupt
798  * 0: Disable
799  * 1: Enable
800  */
801 #define UART_IER_ERBI_MASK (0x1U)
802 #define UART_IER_ERBI_SHIFT (0U)
803 #define UART_IER_ERBI_SET(x) (((uint32_t)(x) << UART_IER_ERBI_SHIFT) & UART_IER_ERBI_MASK)
804 #define UART_IER_ERBI_GET(x) (((uint32_t)(x) & UART_IER_ERBI_MASK) >> UART_IER_ERBI_SHIFT)
805 
806 /* Bitfield definition for register: DLM */
807 /*
808  * DLM (RW)
809  *
810  * Most significant byte of the Divisor Latch
811  */
812 #define UART_DLM_DLM_MASK (0xFFU)
813 #define UART_DLM_DLM_SHIFT (0U)
814 #define UART_DLM_DLM_SET(x) (((uint32_t)(x) << UART_DLM_DLM_SHIFT) & UART_DLM_DLM_MASK)
815 #define UART_DLM_DLM_GET(x) (((uint32_t)(x) & UART_DLM_DLM_MASK) >> UART_DLM_DLM_SHIFT)
816 
817 /* Bitfield definition for register: IIR */
818 /*
819  * RXIDLE_FLAG (W1C)
820  *
821  * UART IDLE Flag
822  * 0 - UART is busy
823  * 1 - UART is idle
824  * NOTE: when write one to clear this bit, avoid changging FCR register since it's same address as IIR
825  */
826 #define UART_IIR_RXIDLE_FLAG_MASK (0x80000000UL)
827 #define UART_IIR_RXIDLE_FLAG_SHIFT (31U)
828 #define UART_IIR_RXIDLE_FLAG_SET(x) (((uint32_t)(x) << UART_IIR_RXIDLE_FLAG_SHIFT) & UART_IIR_RXIDLE_FLAG_MASK)
829 #define UART_IIR_RXIDLE_FLAG_GET(x) (((uint32_t)(x) & UART_IIR_RXIDLE_FLAG_MASK) >> UART_IIR_RXIDLE_FLAG_SHIFT)
830 
831 /*
832  * FIFOED (RO)
833  *
834  * FIFOs enabled
835  * These two bits are 1 when bit 0 of the FIFO Control
836  * Register (FIFOE) is set to 1.
837  */
838 #define UART_IIR_FIFOED_MASK (0xC0U)
839 #define UART_IIR_FIFOED_SHIFT (6U)
840 #define UART_IIR_FIFOED_GET(x) (((uint32_t)(x) & UART_IIR_FIFOED_MASK) >> UART_IIR_FIFOED_SHIFT)
841 
842 /*
843  * INTRID (RO)
844  *
845  * Interrupt ID, see IIR2 for detail decoding
846  */
847 #define UART_IIR_INTRID_MASK (0xFU)
848 #define UART_IIR_INTRID_SHIFT (0U)
849 #define UART_IIR_INTRID_GET(x) (((uint32_t)(x) & UART_IIR_INTRID_MASK) >> UART_IIR_INTRID_SHIFT)
850 
851 /* Bitfield definition for register: FCR */
852 /*
853  * RFIFOT (WO)
854  *
855  * Receiver FIFO trigger level(0 for 1byte, 0x3 for 4bytes). Uart will send rx_dma_req if data in fifo reachs the threshold
856  */
857 #define UART_FCR_RFIFOT_MASK (0xC0U)
858 #define UART_FCR_RFIFOT_SHIFT (6U)
859 #define UART_FCR_RFIFOT_SET(x) (((uint32_t)(x) << UART_FCR_RFIFOT_SHIFT) & UART_FCR_RFIFOT_MASK)
860 #define UART_FCR_RFIFOT_GET(x) (((uint32_t)(x) & UART_FCR_RFIFOT_MASK) >> UART_FCR_RFIFOT_SHIFT)
861 
862 /*
863  * TFIFOT (WO)
864  *
865  * Transmitter FIFO trigger level(0 for 1byte, 0x3 for 4bytes), uart will send tx_dma_req when data in fifo is less than threshold.
866  */
867 #define UART_FCR_TFIFOT_MASK (0x30U)
868 #define UART_FCR_TFIFOT_SHIFT (4U)
869 #define UART_FCR_TFIFOT_SET(x) (((uint32_t)(x) << UART_FCR_TFIFOT_SHIFT) & UART_FCR_TFIFOT_MASK)
870 #define UART_FCR_TFIFOT_GET(x) (((uint32_t)(x) & UART_FCR_TFIFOT_MASK) >> UART_FCR_TFIFOT_SHIFT)
871 
872 /*
873  * DMAE (WO)
874  *
875  * DMA enable
876  * 0: Disable
877  * 1: Enable
878  */
879 #define UART_FCR_DMAE_MASK (0x8U)
880 #define UART_FCR_DMAE_SHIFT (3U)
881 #define UART_FCR_DMAE_SET(x) (((uint32_t)(x) << UART_FCR_DMAE_SHIFT) & UART_FCR_DMAE_MASK)
882 #define UART_FCR_DMAE_GET(x) (((uint32_t)(x) & UART_FCR_DMAE_MASK) >> UART_FCR_DMAE_SHIFT)
883 
884 /*
885  * TFIFORST (WO)
886  *
887  * Transmitter FIFO reset
888  * Write 1 to clear all bytes in the TXFIFO and resets its
889  * counter. The Transmitter Shift Register is not cleared.
890  * This bit will automatically be cleared.
891  */
892 #define UART_FCR_TFIFORST_MASK (0x4U)
893 #define UART_FCR_TFIFORST_SHIFT (2U)
894 #define UART_FCR_TFIFORST_SET(x) (((uint32_t)(x) << UART_FCR_TFIFORST_SHIFT) & UART_FCR_TFIFORST_MASK)
895 #define UART_FCR_TFIFORST_GET(x) (((uint32_t)(x) & UART_FCR_TFIFORST_MASK) >> UART_FCR_TFIFORST_SHIFT)
896 
897 /*
898  * RFIFORST (WO)
899  *
900  * Receiver FIFO reset
901  * Write 1 to clear all bytes in the RXFIFO and resets its
902  * counter. The Receiver Shift Register is not cleared.
903  * This bit will automatically be cleared.
904  */
905 #define UART_FCR_RFIFORST_MASK (0x2U)
906 #define UART_FCR_RFIFORST_SHIFT (1U)
907 #define UART_FCR_RFIFORST_SET(x) (((uint32_t)(x) << UART_FCR_RFIFORST_SHIFT) & UART_FCR_RFIFORST_MASK)
908 #define UART_FCR_RFIFORST_GET(x) (((uint32_t)(x) & UART_FCR_RFIFORST_MASK) >> UART_FCR_RFIFORST_SHIFT)
909 
910 /*
911  * FIFOE (WO)
912  *
913  * FIFO enable
914  * Write 1 to enable both the transmitter and receiver
915  * FIFOs.
916  * The FIFOs are reset when the value of this bit toggles.
917  */
918 #define UART_FCR_FIFOE_MASK (0x1U)
919 #define UART_FCR_FIFOE_SHIFT (0U)
920 #define UART_FCR_FIFOE_SET(x) (((uint32_t)(x) << UART_FCR_FIFOE_SHIFT) & UART_FCR_FIFOE_MASK)
921 #define UART_FCR_FIFOE_GET(x) (((uint32_t)(x) & UART_FCR_FIFOE_MASK) >> UART_FCR_FIFOE_SHIFT)
922 
923 /* Bitfield definition for register: LCR */
924 /*
925  * DLAB (RW)
926  *
927  * Divisor latch access bit
928  */
929 #define UART_LCR_DLAB_MASK (0x80U)
930 #define UART_LCR_DLAB_SHIFT (7U)
931 #define UART_LCR_DLAB_SET(x) (((uint32_t)(x) << UART_LCR_DLAB_SHIFT) & UART_LCR_DLAB_MASK)
932 #define UART_LCR_DLAB_GET(x) (((uint32_t)(x) & UART_LCR_DLAB_MASK) >> UART_LCR_DLAB_SHIFT)
933 
934 /*
935  * BC (RW)
936  *
937  * Break control
938  */
939 #define UART_LCR_BC_MASK (0x40U)
940 #define UART_LCR_BC_SHIFT (6U)
941 #define UART_LCR_BC_SET(x) (((uint32_t)(x) << UART_LCR_BC_SHIFT) & UART_LCR_BC_MASK)
942 #define UART_LCR_BC_GET(x) (((uint32_t)(x) & UART_LCR_BC_MASK) >> UART_LCR_BC_SHIFT)
943 
944 /*
945  * SPS (RW)
946  *
947  * Stick parity
948  * 1: Parity bit is constant 0 or 1, depending on bit4 (EPS).
949  * 0: Disable the sticky bit parity.
950  */
951 #define UART_LCR_SPS_MASK (0x20U)
952 #define UART_LCR_SPS_SHIFT (5U)
953 #define UART_LCR_SPS_SET(x) (((uint32_t)(x) << UART_LCR_SPS_SHIFT) & UART_LCR_SPS_MASK)
954 #define UART_LCR_SPS_GET(x) (((uint32_t)(x) & UART_LCR_SPS_MASK) >> UART_LCR_SPS_SHIFT)
955 
956 /*
957  * EPS (RW)
958  *
959  * Even parity select
960  * 1: Even parity (an even number of logic-1 is in the data
961  * and parity bits)
962  * 0: Old parity.
963  */
964 #define UART_LCR_EPS_MASK (0x10U)
965 #define UART_LCR_EPS_SHIFT (4U)
966 #define UART_LCR_EPS_SET(x) (((uint32_t)(x) << UART_LCR_EPS_SHIFT) & UART_LCR_EPS_MASK)
967 #define UART_LCR_EPS_GET(x) (((uint32_t)(x) & UART_LCR_EPS_MASK) >> UART_LCR_EPS_SHIFT)
968 
969 /*
970  * PEN (RW)
971  *
972  * Parity enable
973  * When this bit is set, a parity bit is generated in
974  * transmitted data before the first STOP bit and the parity
975  * bit would be checked for the received data.
976  */
977 #define UART_LCR_PEN_MASK (0x8U)
978 #define UART_LCR_PEN_SHIFT (3U)
979 #define UART_LCR_PEN_SET(x) (((uint32_t)(x) << UART_LCR_PEN_SHIFT) & UART_LCR_PEN_MASK)
980 #define UART_LCR_PEN_GET(x) (((uint32_t)(x) & UART_LCR_PEN_MASK) >> UART_LCR_PEN_SHIFT)
981 
982 /*
983  * STB (RW)
984  *
985  * Number of STOP bits
986  * 0: 1 bits
987  * 1: The number of STOP bit is based on the WLS setting
988  * When WLS = 0, STOP bit is 1.5 bits
989  * When WLS = 1, 2, 3, STOP bit is 2 bits
990  */
991 #define UART_LCR_STB_MASK (0x4U)
992 #define UART_LCR_STB_SHIFT (2U)
993 #define UART_LCR_STB_SET(x) (((uint32_t)(x) << UART_LCR_STB_SHIFT) & UART_LCR_STB_MASK)
994 #define UART_LCR_STB_GET(x) (((uint32_t)(x) & UART_LCR_STB_MASK) >> UART_LCR_STB_SHIFT)
995 
996 /*
997  * WLS (RW)
998  *
999  * Word length setting
1000  * 0: 5 bits
1001  * 1: 6 bits
1002  * 2: 7 bits
1003  * 3: 8 bits
1004  */
1005 #define UART_LCR_WLS_MASK (0x3U)
1006 #define UART_LCR_WLS_SHIFT (0U)
1007 #define UART_LCR_WLS_SET(x) (((uint32_t)(x) << UART_LCR_WLS_SHIFT) & UART_LCR_WLS_MASK)
1008 #define UART_LCR_WLS_GET(x) (((uint32_t)(x) & UART_LCR_WLS_MASK) >> UART_LCR_WLS_SHIFT)
1009 
1010 /* Bitfield definition for register: MCR */
1011 /*
1012  * AFE (RW)
1013  *
1014  * Auto flow control enable
1015  * 0: Disable
1016  * 1: The auto-CTS and auto-RTS setting is based on the
1017  * RTS bit setting:
1018  * When RTS = 0, auto-CTS only
1019  * When RTS = 1, auto-CTS and auto-RTS
1020  */
1021 #define UART_MCR_AFE_MASK (0x20U)
1022 #define UART_MCR_AFE_SHIFT (5U)
1023 #define UART_MCR_AFE_SET(x) (((uint32_t)(x) << UART_MCR_AFE_SHIFT) & UART_MCR_AFE_MASK)
1024 #define UART_MCR_AFE_GET(x) (((uint32_t)(x) & UART_MCR_AFE_MASK) >> UART_MCR_AFE_SHIFT)
1025 
1026 /*
1027  * LOOP (RW)
1028  *
1029  * Enable loopback mode
1030  * 0: Disable
1031  * 1: Enable
1032  */
1033 #define UART_MCR_LOOP_MASK (0x10U)
1034 #define UART_MCR_LOOP_SHIFT (4U)
1035 #define UART_MCR_LOOP_SET(x) (((uint32_t)(x) << UART_MCR_LOOP_SHIFT) & UART_MCR_LOOP_MASK)
1036 #define UART_MCR_LOOP_GET(x) (((uint32_t)(x) & UART_MCR_LOOP_MASK) >> UART_MCR_LOOP_SHIFT)
1037 
1038 /*
1039  * RTS (RW)
1040  *
1041  * Request to send
1042  * This bit controls the modem_rtsn output.
1043  * 0: The modem_rtsn output signal will be driven HIGH
1044  * 1: The modem_rtsn output signal will be driven LOW
1045  */
1046 #define UART_MCR_RTS_MASK (0x2U)
1047 #define UART_MCR_RTS_SHIFT (1U)
1048 #define UART_MCR_RTS_SET(x) (((uint32_t)(x) << UART_MCR_RTS_SHIFT) & UART_MCR_RTS_MASK)
1049 #define UART_MCR_RTS_GET(x) (((uint32_t)(x) & UART_MCR_RTS_MASK) >> UART_MCR_RTS_SHIFT)
1050 
1051 /* Bitfield definition for register: LSR */
1052 /*
1053  * RXIDLE (RO)
1054  *
1055  * rxidle after timeout, clear after rx idle condition not match
1056  */
1057 #define UART_LSR_RXIDLE_MASK (0x80000000UL)
1058 #define UART_LSR_RXIDLE_SHIFT (31U)
1059 #define UART_LSR_RXIDLE_GET(x) (((uint32_t)(x) & UART_LSR_RXIDLE_MASK) >> UART_LSR_RXIDLE_SHIFT)
1060 
1061 /*
1062  * TXIDLE (RO)
1063  *
1064  * txidle after timeout, clear after tx idle condition not match
1065  */
1066 #define UART_LSR_TXIDLE_MASK (0x40000000UL)
1067 #define UART_LSR_TXIDLE_SHIFT (30U)
1068 #define UART_LSR_TXIDLE_GET(x) (((uint32_t)(x) & UART_LSR_TXIDLE_MASK) >> UART_LSR_TXIDLE_SHIFT)
1069 
1070 /*
1071  * RFIFO_NUM (RO)
1072  *
1073  * data bytes in rxfifo not read
1074  */
1075 #define UART_LSR_RFIFO_NUM_MASK (0x1F0000UL)
1076 #define UART_LSR_RFIFO_NUM_SHIFT (16U)
1077 #define UART_LSR_RFIFO_NUM_GET(x) (((uint32_t)(x) & UART_LSR_RFIFO_NUM_MASK) >> UART_LSR_RFIFO_NUM_SHIFT)
1078 
1079 /*
1080  * TFIFO_NUM (RO)
1081  *
1082  * data bytes in txfifo not sent
1083  */
1084 #define UART_LSR_TFIFO_NUM_MASK (0x1F00U)
1085 #define UART_LSR_TFIFO_NUM_SHIFT (8U)
1086 #define UART_LSR_TFIFO_NUM_GET(x) (((uint32_t)(x) & UART_LSR_TFIFO_NUM_MASK) >> UART_LSR_TFIFO_NUM_SHIFT)
1087 
1088 /*
1089  * ERRF (RO)
1090  *
1091  * Error in RXFIFO
1092  * In the FIFO mode, this bit is set when there is at least
1093  * one parity error, framing error, or line break
1094  * associated with data in the RXFIFO. It is cleared when
1095  * this register is read and there is no more error for the
1096  * rest of data in the RXFIFO.
1097  */
1098 #define UART_LSR_ERRF_MASK (0x80U)
1099 #define UART_LSR_ERRF_SHIFT (7U)
1100 #define UART_LSR_ERRF_GET(x) (((uint32_t)(x) & UART_LSR_ERRF_MASK) >> UART_LSR_ERRF_SHIFT)
1101 
1102 /*
1103  * TEMT (RO)
1104  *
1105  * Transmitter empty
1106  * This bit is 1 when the THR (TXFIFO in the FIFO
1107  * mode) and the Transmitter Shift Register (TSR) are
1108  * both empty. Otherwise, it is zero.
1109  */
1110 #define UART_LSR_TEMT_MASK (0x40U)
1111 #define UART_LSR_TEMT_SHIFT (6U)
1112 #define UART_LSR_TEMT_GET(x) (((uint32_t)(x) & UART_LSR_TEMT_MASK) >> UART_LSR_TEMT_SHIFT)
1113 
1114 /*
1115  * THRE (RO)
1116  *
1117  * Transmitter Holding Register empty
1118  * This bit is 1 when the THR (TXFIFO in the FIFO
1119  * mode) is empty. Otherwise, it is zero.
1120  * If the THRE interrupt is enabled, an interrupt is
1121  * triggered when THRE becomes 1.
1122  */
1123 #define UART_LSR_THRE_MASK (0x20U)
1124 #define UART_LSR_THRE_SHIFT (5U)
1125 #define UART_LSR_THRE_GET(x) (((uint32_t)(x) & UART_LSR_THRE_MASK) >> UART_LSR_THRE_SHIFT)
1126 
1127 /*
1128  * LBREAK (RO)
1129  *
1130  * Line break
1131  * This bit is set when the uart_sin input signal was held
1132  * LOWfor longer than the time for a full-word
1133  * transmission. A full-word transmission is the
1134  * transmission of the START, data, parity, and STOP
1135  * bits. It is cleared when this register is read.
1136  * In the FIFO mode, this bit indicates the line break for
1137  * the received data at the top of the RXFIFO.
1138  */
1139 #define UART_LSR_LBREAK_MASK (0x10U)
1140 #define UART_LSR_LBREAK_SHIFT (4U)
1141 #define UART_LSR_LBREAK_GET(x) (((uint32_t)(x) & UART_LSR_LBREAK_MASK) >> UART_LSR_LBREAK_SHIFT)
1142 
1143 /*
1144  * FE (RO)
1145  *
1146  * Framing error
1147  * This bit is set when the received STOP bit is not
1148  * HIGH. It is cleared when this register is read.
1149  * In the FIFO mode, this bit indicates the framing error
1150  * for the received data at the top of the RXFIFO.
1151  */
1152 #define UART_LSR_FE_MASK (0x8U)
1153 #define UART_LSR_FE_SHIFT (3U)
1154 #define UART_LSR_FE_GET(x) (((uint32_t)(x) & UART_LSR_FE_MASK) >> UART_LSR_FE_SHIFT)
1155 
1156 /*
1157  * PE (RO)
1158  *
1159  * Parity error
1160  * This bit is set when the received parity does not match
1161  * with the parity selected in the LCR[5:4]. It is cleared
1162  * when this register is read.
1163  * In the FIFO mode, this bit indicates the parity error
1164  * for the received data at the top of the RXFIFO.
1165  */
1166 #define UART_LSR_PE_MASK (0x4U)
1167 #define UART_LSR_PE_SHIFT (2U)
1168 #define UART_LSR_PE_GET(x) (((uint32_t)(x) & UART_LSR_PE_MASK) >> UART_LSR_PE_SHIFT)
1169 
1170 /*
1171  * OE (RO)
1172  *
1173  * Overrun error
1174  * This bit indicates that data in the Receiver Buffer
1175  * Register (RBR) is overrun.
1176  */
1177 #define UART_LSR_OE_MASK (0x2U)
1178 #define UART_LSR_OE_SHIFT (1U)
1179 #define UART_LSR_OE_GET(x) (((uint32_t)(x) & UART_LSR_OE_MASK) >> UART_LSR_OE_SHIFT)
1180 
1181 /*
1182  * DR (RO)
1183  *
1184  * Data ready.
1185  * This bit is set when there are incoming received data
1186  * in the Receiver Buffer Register (RBR). It is cleared
1187  * when all of the received data are read.
1188  */
1189 #define UART_LSR_DR_MASK (0x1U)
1190 #define UART_LSR_DR_SHIFT (0U)
1191 #define UART_LSR_DR_GET(x) (((uint32_t)(x) & UART_LSR_DR_MASK) >> UART_LSR_DR_SHIFT)
1192 
1193 /* Bitfield definition for register: MSR */
1194 /*
1195  * CTS (RO)
1196  *
1197  * Clear to send
1198  * 0: The modem_ctsn input signal is HIGH.
1199  * 1: The modem_ctsn input signal is LOW.
1200  */
1201 #define UART_MSR_CTS_MASK (0x10U)
1202 #define UART_MSR_CTS_SHIFT (4U)
1203 #define UART_MSR_CTS_GET(x) (((uint32_t)(x) & UART_MSR_CTS_MASK) >> UART_MSR_CTS_SHIFT)
1204 
1205 /*
1206  * DCTS (RC)
1207  *
1208  * Delta clear to send
1209  * This bit is set when the state of the modem_ctsn input
1210  * signal has been changed since the last time this
1211  * register is read.
1212  */
1213 #define UART_MSR_DCTS_MASK (0x1U)
1214 #define UART_MSR_DCTS_SHIFT (0U)
1215 #define UART_MSR_DCTS_GET(x) (((uint32_t)(x) & UART_MSR_DCTS_MASK) >> UART_MSR_DCTS_SHIFT)
1216 
1217 /* Bitfield definition for register: GPR */
1218 /*
1219  * DATA (RW)
1220  *
1221  * A one-byte storage register
1222  */
1223 #define UART_GPR_DATA_MASK (0xFFU)
1224 #define UART_GPR_DATA_SHIFT (0U)
1225 #define UART_GPR_DATA_SET(x) (((uint32_t)(x) << UART_GPR_DATA_SHIFT) & UART_GPR_DATA_MASK)
1226 #define UART_GPR_DATA_GET(x) (((uint32_t)(x) & UART_GPR_DATA_MASK) >> UART_GPR_DATA_SHIFT)
1227 
1228 
1229 
1230 
1231 #endif /* HPM_UART_H */
Definition: hpm_uart_regs.h:12