From 6609dfa4b1334ae8425aa64b2a7b39345552224c Mon Sep 17 00:00:00 2001 From: Paul Mathieu Date: Sun, 14 Mar 2021 12:17:48 -0700 Subject: [PATCH] uart: can now write more stuff --- uart/uart.c | 6 ++++++ uart/uart.h | 1 + 2 files changed, 7 insertions(+) diff --git a/uart/uart.c b/uart/uart.c index 098d8de..e801399 100644 --- a/uart/uart.c +++ b/uart/uart.c @@ -21,3 +21,9 @@ char uart_read(struct uart* uart) { return uart->data; } + +void uart_writen(struct uart* uart, const char* data, int len) { + for (int i = 0; i < len; ++i) { + uart_write(uart, data[i]); + } +} diff --git a/uart/uart.h b/uart/uart.h index e5266af..55fca51 100644 --- a/uart/uart.h +++ b/uart/uart.h @@ -14,3 +14,4 @@ int uart_rx_available(struct uart* uart); int uart_tx_available(struct uart* uart); void uart_write(struct uart* uart, const char c); char uart_read(struct uart* uart); +void uart_writen(struct uart* uart, const char* data, int len);