summaryrefslogtreecommitdiff
path: root/tools/src/uart.h
diff options
context:
space:
mode:
authormagh <magh@maghmogh.com>2023-03-06 18:44:55 -0600
committermagh <magh@maghmogh.com>2023-03-06 18:44:55 -0600
commite80d9d8871b325a04b18f90a9ea4bb7fd148fb25 (patch)
tree79dbdb8506b7ff1e92549188d1b94cfc0b3503ae /tools/src/uart.h
add m1n1HEADmaster
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