diff options
author | Nao Pross <naopross@thearcway.org> | 2017-10-19 17:52:58 +0200 |
---|---|---|
committer | Nao Pross <naopross@thearcway.org> | 2017-10-19 17:52:58 +0200 |
commit | fe1ac63fc152ea70bc32b9d514841a5f806838ed (patch) | |
tree | 434d336625c9564ec20ddc2834b72f5551f53856 /sw/z80/drivers/include | |
parent | Move test units to z80/tests, and drivers are now statically linked (diff) | |
download | z80uPC-fe1ac63fc152ea70bc32b9d514841a5f806838ed.tar.gz z80uPC-fe1ac63fc152ea70bc32b9d514841a5f806838ed.zip |
Fix for PIO driver and its test and deletes build files
Diffstat (limited to 'sw/z80/drivers/include')
-rw-r--r-- | sw/z80/drivers/include/pio.h | 16 |
1 files changed, 13 insertions, 3 deletions
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 <stdint.h> +// 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); |