2020-04-06 13:28:56 +00:00
|
|
|
#ifndef _UART_H_
|
|
|
|
#define _UART_H_
|
|
|
|
|
|
|
|
#define UART0_BASE (0x30000000)
|
|
|
|
#define UART0_CTRL (UART0_BASE + (0x00))
|
|
|
|
#define UART0_STATUS (UART0_BASE + (0x04))
|
|
|
|
#define UART0_BAUD (UART0_BASE + (0x08))
|
|
|
|
#define UART0_TXDATA (UART0_BASE + (0x0c))
|
2020-06-26 14:46:03 +00:00
|
|
|
#define UART0_RXDATA (UART0_BASE + (0x10))
|
2020-04-06 13:28:56 +00:00
|
|
|
|
|
|
|
#define UART0_REG(addr) (*((volatile uint32_t *)addr))
|
|
|
|
|
2020-04-12 11:36:06 +00:00
|
|
|
void uart_init();
|
2020-06-26 14:46:03 +00:00
|
|
|
void uart_putc(uint8_t c);
|
|
|
|
uint8_t uart_getc();
|
2020-04-12 11:36:06 +00:00
|
|
|
|
2020-04-06 13:28:56 +00:00
|
|
|
#endif
|