18#ifndef __I_REG_UART_H__
19#define __I_REG_UART_H__
35#ifndef __AIC8800_UART_USE_BIT_FIELD
36# define __AIC8800_UART_USE_BIT_FIELD ENABLED
54#define TXRXD_REG TXRXD.VALUE
55#define DIV0_REG DIV0.VALUE
56#define IRQCTL_REG IRQCTL.VALUE
57#define DIV1_REG DIV1.VALUE
58#define IRQTYP_REG IRQTYP.VALUE
59#define DBUFCFG_REG DBUFCFG.VALUE
60#define DFMTCFG_REG DFMTCFG.VALUE
61#define MDMCFG_REG MDMCFG.VALUE
62#define IRQSTS_REG IRQSTS.VALUE
63#define MDMSTS_REG MDMSTS.VALUE
64#define DBUFSTS_REG DBUFSTS.VALUE
65#define DBUFTH_REG DBUFTH.VALUE
66#define DIV2_REG DIV2.VALUE
70#define UART_RXDATA_MSK ((reg32_t)(0xff << UART_RXDATA))
73#define UART_TXDATA_MSK ((reg32_t)(0xff << UART_TXDATA))
77#define UART_DIV0_MSK ((reg32_t)(0xff << UART_DIV0))
82#define UART_PTIRQEN_MSK ((reg32_t)(0x1 << UART_PTIRQEN))
85#define UART_MSIRQEN_MSK ((reg32_t)(0x1 << UART_MSIRQEN))
88#define UART_LSIRQEN_MSK ((reg32_t)(0x1 << UART_LSIRQEN))
91#define UART_TXIRQEN_MSK ((reg32_t)(0x1 << UART_TXIRQEN))
94#define UART_RXIRQEN_MSK ((reg32_t)(0x1 << UART_RXIRQEN))
99#define UART_DIV1_MSK ((reg32_t)(0xff << UART_DIV1))
104#define UART_IRQTYP_MSK ((reg32_t)(0xf << UART_IRQTYP))
105#define UART_IRQTYP_MODEM_INT 0x00
106#define UART_IRQTYP_NO_INT 0x01
107#define UART_IRQTYP_TX_INT 0x02
108#define UART_IRQTYP_RX_INT 0x04
109#define UART_IRQTYP_RX_ERROR_INT 0x06
110#define UART_IRQTYP_TIMEOUT_INT 0x0c
115#define UART_TXDRST_MSK ((reg32_t)(0x1 << UART_TXDRST))
118#define UART_RXDRST_MSK ((reg32_t)(0x1 << UART_RXDRST))
121#define UART_DBUFEN_MSK ((reg32_t)(0x1 << UART_DBUFEN))
126#define UART1_DIVMS_MSK ((reg32_t)(0x1 << UART_DIVMS))
129#define UART_DIVAE_MSK ((reg32_t)(0x1 << UART_DIVAE))
132#define UART_BRK_MSK ((reg32_t)(0x1 << UART_BRK))
135#define UART_EPS_MSK ((reg32_t)(0x1 << UART_EPS))
138#define UART_PEN_MSK ((reg32_t)(0x1 << UART_PEN))
141#define UART_STOP_MSK ((reg32_t)(0x1 << UART_STOP))
144#define UART_DLS_MSK ((reg32_t)(0x3 << UART_DLS))
149#define UART_CLK_P_MSK ((reg32_t)(0x1 << UART_CLK_P))
151#define UART_AUTO_DET 7
152#define UART_AUTO_DET_MSK ((reg32_t)(0x1 << UART_AUTO_DET))
155#define UART_SIRE_MSK ((reg32_t)(0x1 << UART_SIRE))
158#define UART_AFCE_MSK ((reg32_t)(0x1 << UART_AFCE))
160#define UART_LOOPBACK 4
161#define UART_LOOPBACK_MSK ((reg32_t)(0x1 << UART_LOOPBACK))
164#define UART_OUT2_MSK ((reg32_t)(0x1 << UART_OUT2))
167#define UART_OUT1_MSK ((reg32_t)(0x1 << UART_OUT1))
170#define UART_RTS_MSK ((reg32_t)(0x1 << UART_RTS))
173#define UART_DTR_MSK ((reg32_t)(0x1 << UART_DTR))
178#define UART_RTDR_MSK ((reg32_t)(0x1 << UART_RTDR))
181#define UART_RFE_MSK ((reg32_t)(0x1 << UART_RFE))
184#define UART_TEMT_MSK ((reg32_t)(0x1 << UART_TEMT))
187#define UART_THRE_MSK ((reg32_t)(0x1 << UART_THRE))
190#define UART_OE_MSK ((reg32_t)(0x1 << UART_OE))
193#define UART_DR_MSK ((reg32_t)(0x1 << UART_DR))
199#define UART_RX_DBUF_FULL 21
200#define UART_RX_DBUF_FULL_MSK ((reg32_t)(0x1 << UART_RX_DBUF_FULL))
202#define UART_RX_DBUF_EMPTY 20
203#define UART_RX_DBUF_EMPTY_MSK ((reg32_t)(0x1 << UART_RX_DBUF_EMPTY))
205#define UART_TX_DBUF_FULL 19
206#define UART_TX_DBUF_FULL_MSK ((reg32_t)(0x1 << UART_TX_DBUF_FULL))
208#define UART_TX_DBUF_EMPTY 18
209#define UART_TX_DBUF_EMPTY_MSK ((reg32_t)(0x1 << UART_TX_DBUF_EMPTY))
211#define UART_RX_COUNT 9
212#define UART_RX_COUNT_MSK ((reg32_t)(0xFF << UART_RX_COUNT))
214#define UART_TX_COUNT 0
215#define UART_TX_COUNT_MSK ((reg32_t)(0xff << UART_TX_COUNT))
219#define UART_TXTRIGTH 8
220#define UART_TXTRIGTH_MSK ((reg32_t)(0x1fe << UART_TXTRIGTH))
222#define UART_RXTRIGTH 0
223#define UART_RXTRIGTH_MSK ((reg32_t)(0xff << UART_RXTRIGTH))
228#define UART_DIV2_MSK ((reg32_t)(0xff << UART_DIV2))
231#if __AIC8800_UART_USE_BIT_FIELD == ENABLED
232# define DEF_UART_REG(__NAME, __TOTAL_SIZE, ...) \
237 reg##__TOTAL_SIZE##_t VALUE; \
240# define DEF_UART_REG(__NAME, __TOTAL_SIZE, ...) \
241 __VA_ARGS__ reg##__TOTAL_SIZE##_t __NAME
volatile uint32_t reg32_t
Definition f1c100s_reg.h:1039
#define REG_RSVD_U32
Definition f1c100s_reg.h:1057
volatile uint32_t reg32_t
Definition i_io_systick.h:120
#define __OM
Definition i_reg_gpio.h:47
#define __IM
Definition i_reg_gpio.h:42
#define __IOM
Definition i_reg_gpio.h:52
#define DEF_UART_REG(__NAME, __TOTAL_SIZE,...)
Definition i_reg_uart.h:232
struct uart_reg_t uart_reg_t
Definition i_reg_uart.h:245
DEF_UART_REG(DIV2, 32, __IOM reg32_t DIV2 :8;reg32_t :24;)
DEF_UART_REG(MDMSTS, 32, __IM reg32_t MDMSTS :32;)
__IM reg32_t BASE_ADDR
Definition i_reg_uart.h:247
REG_RSVD_U32 DEF_UART_REG(DBUFSTS, 32, __IM reg32_t TX_COUNT :8;reg32_t :1;__IM reg32_t RX_COUNT :8;reg32_t :1;__IM reg32_t TX_DBUF_EMPTY :1;__IM reg32_t TX_DBUF_FULL :1;__IM reg32_t RX_DBUF_EMPTY :1;__IM reg32_t RX_DBUF_FULL :1;reg32_t :10;)
DEF_UART_REG(DFMTCFG, 32, __IOM reg32_t DLS :2;__IOM reg32_t STOP :1;__IOM reg32_t PEN :1;__IOM reg32_t EPS :1;reg32_t :1;__IOM reg32_t BRK :1;__IOM reg32_t DIVAE :1;__IOM reg32_t DIVMS :1;reg32_t :23;)
DEF_UART_REG(DBUFTH, 32, __IOM reg32_t RXTRIGTH :8;reg32_t :1;__IOM reg32_t TXTRIGTH :8;reg32_t :15;)
DEF_UART_REG(MDMCFG, 32, __IOM reg32_t DTR :1;__IOM reg32_t RTS :1;__IOM reg32_t OUT1 :1;__IOM reg32_t OUT2 :1;__IOM reg32_t LOOPBACK :1;__IOM reg32_t AFCE :1;__IOM reg32_t SIRE :1;__IOM reg32_t AUTO_DET :1;__IOM reg32_t CLK_P :1;reg32_t :23;)
DEF_UART_REG(IRQSTS, 32, __IM reg32_t DR :1;__IM reg32_t OE :1;reg32_t :1;reg32_t :1;reg32_t :1;__IM reg32_t THRE :1;__IM reg32_t TEMT :1;__IM reg32_t RFE :1;__IM reg32_t RTDR :1;reg32_t :23;)