summaryrefslogtreecommitdiff
path: root/src/hardware/port.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/hardware/port.h')
-rw-r--r--src/hardware/port.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/hardware/port.h b/src/hardware/port.h
new file mode 100644
index 0000000..ec96d09
--- /dev/null
+++ b/src/hardware/port.h
@@ -0,0 +1,23 @@
+#ifndef PORT_H
+#define PORT_H
+
+#include <stdint.h>
+
+typedef struct {
+ uint16_t number; // port number, e.g. 0x3d4 VGA index register
+} port8_t;
+
+void port8_init( port8_t *port, uint16_t number );
+void port8_write( port8_t *port, uint8_t data );
+uint8_t port8_read( port8_t *port );
+
+typedef struct {
+ uint16_t number; // port number, e.g. 0x3d4 VGA index register
+} port32_t;
+
+void port32_init( port32_t *port, uint16_t number );
+void port32_write( port32_t *port, uint32_t data );
+uint32_t port32_read( port32_t *port );
+
+#endif // PORT_H
+