35#ifndef LIBOPENCM3_VF6XX_UART_H
36#define LIBOPENCM3_VF6XX_UART_H
48#define UART0 UART0_BASE
49#define UART1 UART1_BASE
50#define UART2 UART2_BASE
51#define UART3 UART3_BASE
52#define UART4 UART4_BASE
53#define UART5 UART5_BASE
57#define UART_BDH(uart_base) MMIO8((uart_base) + 0x00)
58#define UART_BDL(uart_base) MMIO8((uart_base) + 0x01)
59#define UART_C1(uart_base) MMIO8((uart_base) + 0x02)
60#define UART_C2(uart_base) MMIO8((uart_base) + 0x03)
61#define UART_S1(uart_base) MMIO8((uart_base) + 0x04)
62#define UART_S2(uart_base) MMIO8((uart_base) + 0x05)
63#define UART_C3(uart_base) MMIO8((uart_base) + 0x06)
64#define UART_D(uart_base) MMIO8((uart_base) + 0x07)
65#define UART_MA1(uart_base) MMIO8((uart_base) + 0x08)
66#define UART_MA2(uart_base) MMIO8((uart_base) + 0x09)
67#define UART_C4(uart_base) MMIO8((uart_base) + 0x0A)
68#define UART_C5(uart_base) MMIO8((uart_base) + 0x0B)
69#define UART_ED(uart_base) MMIO8((uart_base) + 0x0C)
70#define UART_MODEM(uart_base) MMIO8((uart_base) + 0x0D)
76#define UART_BDH_LBKDIE (1 << 7)
77#define UART_BDH_RXEDGIE (1 << 6)
78#define UART_BDH_SBR_MASK 0x1f
81#define UART_BDL_SBR_MASK 0xff
84#define UART_C1_LOOPS (1 << 7)
85#define UART_C1_RSRC (1 << 5)
86#define UART_C1_M (1 << 4)
87#define UART_C1_WAKE (1 << 3)
88#define UART_C1_ILT (1 << 2)
89#define UART_C1_PE (1 << 1)
90#define UART_C1_PT (1 << 0)
93#define UART_C2_TIE (1 << 7)
94#define UART_C2_TCIE (1 << 6)
95#define UART_C2_RIE (1 << 5)
96#define UART_C2_ILIE (1 << 4)
97#define UART_C2_TE (1 << 3)
98#define UART_C2_RE (1 << 2)
99#define UART_C2_RWU (1 << 1)
100#define UART_C2_SBK (1 << 0)
103#define UART_S1_TDRE (1 << 7)
104#define UART_S1_TC (1 << 6)
105#define UART_S1_RDRF (1 << 5)
106#define UART_S1_IDLE (1 << 4)
107#define UART_S1_OR (1 << 3)
108#define UART_S1_NF (1 << 2)
109#define UART_S1_FE (1 << 1)
110#define UART_S1_PF (1 << 0)
113#define UART_S2_LBKDIF (1 << 7)
114#define UART_S2_RXEDGIF (1 << 6)
115#define UART_S2_MSBF (1 << 5)
116#define UART_S2_RXINV (1 << 4)
117#define UART_S2_RWUID (1 << 3)
118#define UART_S2_BRK13 (1 << 2)
119#define UART_S2_LBKDE (1 << 1)
120#define UART_S2_RAF (1 << 0)
123#define UART_C3_R8 (1 << 7)
124#define UART_C3_T8 (1 << 6)
125#define UART_C3_TXDIR (1 << 5)
126#define UART_C3_TXINV (1 << 4)
127#define UART_C3_ORIE (1 << 3)
128#define UART_C3_NEIE (1 << 2)
129#define UART_C3_FEIE (1 << 1)
130#define UART_C3_PEIE (1 << 0)
133#define UART_MODEM_RXRTSE (1 << 3)
134#define UART_MODEM_TXRTSPOL (1 << 2)
135#define UART_MODEM_TXRTSE (1 << 1)
136#define UART_MODEM_TXCTSE (1 << 0)
143#define UART_PARITY_NONE 0x00
144#define UART_PARITY_EVEN UART_C1_PE
145#define UART_PARITY_ODD (UART_C1_PE | UART_C1_PT)
147#define UART_PARITY_MASK 0x3
155#define UART_FLOWCONTROL_NONE 0x00
156#define UART_FLOWCONTROL_RTS UART_MODEM_RXRTSE
157#define UART_FLOWCONTROL_CTS UART_MODEM_TXCTSE
158#define UART_FLOWCONTROL_RTS_CTS (UART_MODEM_RXRTSE | UART_MODEM_TXCTSE)
160#define UART_FLOWCONTROL_MASK (UART_MODEM_RXRTSE | UART_MODEM_TXCTSE)
173void uart_send(uint32_t uart, uint8_t data);
void uart_disable(uint32_t uart)
UART Disable.
void uart_set_baudrate(uint32_t uart, uint32_t baud)
UART Set Baudrate.
void uart_send(uint32_t uart, uint8_t data)
UART Send a Data Word.
void uart_wait_recv_ready(uint32_t uart)
UART Wait for Received Data Available.
void uart_send_blocking(uint32_t usart, uint8_t data)
UART Send Data byte blocking.
uint8_t uart_recv(uint32_t uart)
UART Read a Received Data Word.
void uart_set_parity(uint32_t uart, uint8_t parity)
UART Set Parity.
void uart_wait_send_ready(uint32_t uart)
UART Wait for Transmit Data Buffer Empty.
void uart_enable(uint32_t uart)
UART Enable.
uint8_t uart_recv_blocking(uint32_t uart)
UART Read a Received Data Word with Blocking.
void uart_set_flow_control(uint32_t uart, uint8_t flowcontrol)
UART Set Hardware Flow Control.