summaryrefslogtreecommitdiffstats
path: root/include/device/portio_uart.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/device/portio_uart.h')
-rw-r--r--include/device/portio_uart.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/include/device/portio_uart.h b/include/device/portio_uart.h
new file mode 100644
index 0000000..1b521a1
--- /dev/null
+++ b/include/device/portio_uart.h
@@ -0,0 +1,27 @@
+#ifndef _JOVE_DEVICE_PORTIO_UART
+#define _JOVE_DEVICE_PORTIO_UART 1
+
+#include <stdint.h>
+
+#define PORTIO_UART_COM1 0x3F8
+
+#define PORTIO_UART_COM_THR(COM) COM
+#define PORTIO_UART_COM_RBR(COM) COM
+#define PORTIO_UART_COM_DLAB_DLL(COM) COM
+#define PORTIO_UART_COM_IER(COM) (COM + 1)
+#define PORTIO_UART_COM_DLAB_DLH(COM) (COM + 1)
+#define PORTIO_UART_COM_IIR(COM) (COM + 2)
+#define PORTIO_UART_COM_FCR(COM) (COM + 2)
+#define PORTIO_UART_COM_LCR(COM) (COM + 3)
+#define PORTIO_UART_COM_MCR(COM) (COM + 4)
+#define PORTIO_UART_COM_LSR(COM) (COM + 5)
+#define PORTIO_UART_COM_MSR(COM) (COM + 6)
+#define PORTIO_UART_COM_SR(COM) (COM + 7)
+
+void
+portio_uart_setup(void);
+
+void
+portio_uart_write(uint64_t dev, const char *s, int n);
+
+#endif