summaryrefslogtreecommitdiff
path: root/tools/src/uart.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/src/uart.h')
-rw-r--r--tools/src/uart.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/tools/src/uart.h b/tools/src/uart.h
new file mode 100644
index 0000000..0b03f2d
--- /dev/null
+++ b/tools/src/uart.h
@@ -0,0 +1,29 @@
+/* SPDX-License-Identifier: MIT */
+
+#ifndef UART_H
+#define UART_H
+
+#include "types.h"
+
+int uart_init(void);
+
+void uart_putbyte(u8 c);
+u8 uart_getbyte(void);
+
+void uart_putchar(u8 c);
+u8 uart_getchar(void);
+
+void uart_write(const void *buf, size_t count);
+size_t uart_read(void *buf, size_t count);
+
+void uart_puts(const char *s);
+
+void uart_setbaud(int baudrate);
+
+void uart_flush(void);
+
+void uart_clear_irqs(void);
+
+int uart_printf(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
+
+#endif