2020-04-06 12:20:31 +00:00
|
|
|
#include <stdint.h>
|
|
|
|
|
2020-04-06 13:28:56 +00:00
|
|
|
#include "../include/uart.h"
|
2020-04-11 11:03:49 +00:00
|
|
|
#include "../include/xprintf.h"
|
2020-04-06 12:20:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2020-04-06 13:28:56 +00:00
|
|
|
static void uart_putc(uint8_t c)
|
2020-04-06 12:20:31 +00:00
|
|
|
{
|
|
|
|
while (UART0_REG(UART0_STATUS) & 0x1);
|
2020-04-06 13:28:56 +00:00
|
|
|
UART0_REG(UART0_TXDATA) = c;
|
2020-04-06 12:20:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
UART0_REG(UART0_CTRL) = 0x1;
|
|
|
|
|
|
|
|
xdev_out(uart_putc);
|
|
|
|
|
|
|
|
xprintf("%d hello world\n", 1);
|
|
|
|
|
|
|
|
while (1);
|
|
|
|
}
|