diff options
author | Wojtek Kosior <kwojtus@protonmail.com> | 2019-12-30 17:34:23 +0100 |
---|---|---|
committer | Wojtek Kosior <kwojtus@protonmail.com> | 2019-12-30 17:34:23 +0100 |
commit | c9e045dc2170a99c9f32386e3e53aee9e01a8e7c (patch) | |
tree | faa57aef89cd1a03efc665c1e5809cf4f0304269 /uart.c | |
parent | eae54c24e2e2b89f399bc2d3be195468c2e462a5 (diff) | |
download | rpi-MMU-example-c9e045dc2170a99c9f32386e3e53aee9e01a8e7c.tar.gz rpi-MMU-example-c9e045dc2170a99c9f32386e3e53aee9e01a8e7c.zip |
io api rework
Diffstat (limited to 'uart.c')
-rw-r--r-- | uart.c | 10 |
1 files changed, 2 insertions, 8 deletions
@@ -63,22 +63,16 @@ void uart_init() mmio_write(UART0_CR, (1 << 0) | (1 << 8) | (1 << 9)); } -void uart_putc(unsigned char c) +void putchar(char c) { // Wait for UART to become ready to transmit. while ( mmio_read(UART0_FR) & (1 << 5) ) { } mmio_write(UART0_DR, c); } -unsigned char uart_getc() +char getchar(void) { // Wait for UART to have received something. while ( mmio_read(UART0_FR) & (1 << 4) ) { } return mmio_read(UART0_DR); } - -void uart_puts(const char* str) -{ - for (size_t i = 0; str[i] != '\0'; i ++) - uart_putc((unsigned char)str[i]); -} |