14 lines
430 B
C
14 lines
430 B
C
#define PL011_SERIAL_BASE 0x16000000
|
|
#define PL011_SERIAL_FLAG_REGISTER 0x18
|
|
#define PL011_SERIAL_BUFFER_FULL (1 << 5)
|
|
|
|
void pl011_putc(char c)
|
|
{
|
|
/* Wait until the serial buffer is empty */
|
|
while (*(volatile unsigned long*)(PL011_SERIAL_BASE + PL011_SERIAL_FLAG_REGISTER)
|
|
& (PL011_SERIAL_BUFFER_FULL));
|
|
|
|
/* When it's empty, put our character at the base */
|
|
*(volatile unsigned long*)PL011_SERIAL_BASE = c;
|
|
}
|