#define UART_BASE 0xc010 #define UART_DATA ((volatile char*) (UART_BASE + 0x00)) #define UART_STATUS ((volatile char*) (UART_BASE + 0x02)) #define UART_STATUS_RXNE_pos 1 #define UART_STATUS_RXNE_msk (1 << UART_STATUS_RXNE_pos) #define UART_STATUS_TXE_pos 0 #define UART_STATUS_TXE_msk (1 << UART_STATUS_TXE_pos) int uart_rx_available(); int uart_tx_available(); void uart_write(const char c); char uart_read();