From fe1ac63fc152ea70bc32b9d514841a5f806838ed Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Thu, 19 Oct 2017 17:52:58 +0200 Subject: Fix for PIO driver and its test and deletes build files --- sw/z80/drivers/include/pio.h | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'sw/z80/drivers/include/pio.h') diff --git a/sw/z80/drivers/include/pio.h b/sw/z80/drivers/include/pio.h index e91029c..a4b6fc2 100644 --- a/sw/z80/drivers/include/pio.h +++ b/sw/z80/drivers/include/pio.h @@ -4,9 +4,19 @@ #include "addresses.h" #include +// ports #define PIO_A 0 #define PIO_B 1 +// registers +#define PIO_REG_DATA 0 +#define PIO_REG_CTRL 1 + +// #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_IN 0 #define PIO_MODE_BYTE_OUT 1 #define PIO_MODE_BYTE_BI 2 @@ -16,9 +26,9 @@ #define PIO_INT_AND_MODE (1<<6) #define PIO_INT_ENABLE (1<<7) - -inline void _pio_data(int port, uint8_t data); -inline void _pio_control(int port, uint8_t cmd); +/* functions used internallyto interface with the device */ +inline void _pio_write(uint8_t reg, uint8_t data); +inline uint8_t _pio_read(uint8_t reg); /* the last argument is needed only for IO mode */ void pio_set_mode(int port, int mode, uint8_t io); -- cgit v1.2.1