27#define USART0_BASE 0x4000C000
28#define USART1_BASE 0x4000D000
29#define USART2_BASE 0x4000E000
32#define USART_DR(x) MMIO32((x) + 0x0000)
33#define USART_IR(x) MMIO32((x) + 0x0004)
34#define USART_FR(x) MMIO32((x) + 0x0018)
35#define USART_ILPR(x) MMIO32((x) + 0x0020)
36#define USART_IBRD(x) MMIO32((x) + 0x0024)
37#define USART_FBRD(x) MMIO32((x) + 0x0028)
38#define USART_LCRH(x) MMIO32((x) + 0x002c)
39#define USART_CTL(x) MMIO32((x) + 0x0030)
40#define USART_IFLS(x) MMIO32((x) + 0x0034)
41#define USART_IM(x) MMIO32((x) + 0x0038)
42#define USART_RIS(x) MMIO32((x) + 0x003c)
43#define USART_MIS(x) MMIO32((x) + 0x0040)
44#define USART_IC(x) MMIO32((x) + 0x0044)
48#define USART_DR_OE (0x01 << 11)
49#define USART_DR_BE (0x01 << 10)
50#define USART_DR_PE (0x01 << 9)
51#define USART_DR_FE (0x01 << 8)
55#define USART_FR_TXFE (0x01 << 7)
56#define USART_FR_RXFF (0x01 << 6)
57#define USART_FR_TXFF (0x01 << 5)
58#define USART_FR_RXFE (0x01 << 4)
59#define USART_FR_BUSY (0x01 << 3)
64#define USART_IM_OE (0x01 << 10)
65#define USART_IM_BE (0x01 << 9)
66#define USART_IM_PE (0x01 << 8)
67#define USART_IM_FE (0x01 << 7)
68#define USART_IM_RT (0x01 << 6)
69#define USART_IM_TX (0x01 << 5)
70#define USART_IM_RX (0x01 << 4)
75#define USART_IC_OE (0x01 << 10)
76#define USART_IC_BE (0x01 << 9)
77#define USART_IC_PE (0x01 << 8)
78#define USART_IC_FE (0x01 << 7)
79#define USART_IC_RT (0x01 << 6)
80#define USART_IC_TX (0x01 << 5)
81#define USART_IC_RX (0x01 << 4)
108void usart_send(uint32_t usart, uint16_t data);
uint16_t usart_recv(uint32_t usart)
void usart_send(uint32_t usart, uint16_t data)
void usart_enable_tx_interrupt(uint32_t usart)
void usart_clear_rx_interrupt(uint32_t usart)
void usart_disable_rx_interrupt(uint32_t usart)
bool usart_get_interrupt_source(uint32_t usart, uint32_t flag)
bool usart_is_recv_ready(uint32_t usart)
uint16_t usart_recv_blocking(uint32_t usart)
void usart_enable_rx_interrupt(uint32_t usart)
void usart_clear_tx_interrupt(uint32_t usart)
bool usart_is_send_ready(uint32_t usart)
void usart_disable_tx_interrupt(uint32_t usart)
void usart_send_blocking(uint32_t usart, uint16_t data)
@ USART_FLOWCONTROL_RTS_CTS