summaryrefslogtreecommitdiffstats
path: root/sw/z80/drivers/include/pio.h
diff options
context:
space:
mode:
authorNao Pross <naopross@thearcway.org>2017-11-14 11:46:31 +0100
committerNao Pross <naopross@thearcway.org>2017-11-14 11:46:31 +0100
commit8b240f0f90cd11f49947cf335a1e366bbe84b3f1 (patch)
treec6efe1d65ecbeeb01c993f659dbd6596abce0371 /sw/z80/drivers/include/pio.h
parentUpdate doc, remove z80uPC.tex, improved z80uPC_nostyle (diff)
downloadz80uPC-8b240f0f90cd11f49947cf335a1e366bbe84b3f1.tar.gz
z80uPC-8b240f0f90cd11f49947cf335a1e366bbe84b3f1.zip
Improvements in PIO driver, pio test rewritten in inline asm
Diffstat (limited to 'sw/z80/drivers/include/pio.h')
-rw-r--r--sw/z80/drivers/include/pio.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/sw/z80/drivers/include/pio.h b/sw/z80/drivers/include/pio.h
index a1137e4..e234b05 100644
--- a/sw/z80/drivers/include/pio.h
+++ b/sw/z80/drivers/include/pio.h
@@ -4,6 +4,9 @@
#include "addresses.h"
#include <stdint.h>
+// DEBUG
+#define PIO_ASM_INTERFACE
+
// ports
#define PIO_A 0
#define PIO_B 1
@@ -12,10 +15,10 @@
#define PIO_REG_DATA 0
#define PIO_REG_CTRL 2
-// #define PIO_REG_DATA_A (PIO_A + PIO_REG_PORT)
-// #define PIO_REG_DATA_B 1 (PIO_B + PIO_REG_PORT)
-// #define PIO_REG_CTRL_A 2 (PIO_A + PIO_REG_CTRL)
-// #define PIO_REG_CTRL_B 3 (PIO_B + PIO_REG_CTRL)
+#define PIO_REG_DATA_A (PIO_A | PIO_REG_PORT)
+#define PIO_REG_DATA_B 1 (PIO_B | PIO_REG_PORT)
+#define PIO_REG_CTRL_A 2 (PIO_A | PIO_REG_CTRL)
+#define PIO_REG_CTRL_B 3 (PIO_B | PIO_REG_CTRL)
#define PIO_MODE_BYTE_OUT 0 // mode 0
#define PIO_MODE_BYTE_IN 1 // mode 1