summaryrefslogtreecommitdiff
path: root/emu/7seg.h
diff options
context:
space:
mode:
Diffstat (limited to 'emu/7seg.h')
-rw-r--r--emu/7seg.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/emu/7seg.h b/emu/7seg.h
index 0cd585f..3953c70 100644
--- a/emu/7seg.h
+++ b/emu/7seg.h
@@ -1,6 +1,8 @@
#ifndef SEG7_H
#define SEG7_H
+#include "device.h"
+
#ifdef WITH_GUI
#include <SDL.h>
#endif
@@ -18,8 +20,8 @@
// +---- RCLK
// +----- SRCLK
enum {
- PORTA = 0x6001,
- DDRA = 0x6003,
+ PORTA = 0x01,
+ DDRA = 0x03,
SER = 0x01,
RCLK = 0x02,
@@ -28,6 +30,10 @@ enum {
typedef struct seg7_t
{
+ device_t base;
+
+ uint16_t addr;
+
uint8_t ddr;
uint16_t shift;
uint16_t latch;
@@ -35,8 +41,10 @@ typedef struct seg7_t
bool debug;
} seg7_t;
-void seg7_init( seg7_t *seg );
-uint8_t seg7_read( seg7_t *seg, uint16_t addr );
-void seg7_write( seg7_t *seg, uint16_t addr, uint8_t data );
+void seg7_init( seg7_t *seg, uint16_t addr );
+
+uint8_t seg7_read( void *obj, uint16_t addr );
+void seg7_write( void *obj, uint16_t addr, uint8_t data );
+void seg7_deinit( void *obj );
#endif