#ifndef SEG7_H #define SEG7_H #include "device.h" #include #include #ifdef WITH_GUI #include #endif // VIA connected on PORTA to 3 wires leading to the 3 coupled 74HC595 // shift register which enable the ROM address lines to read the LED // segment data (cells 0-15 contain the encoded 7 segments of 16 hexdigits) // // PORTA connected as follows: // xxxxx111 // +--- SER // +---- RCLK // +----- SRCLK enum { SER = 0x01, RCLK = 0x02, SRCLK = 0x04 }; typedef struct seg7_t { device_t base; uint16_t shift; uint16_t latch; bool debug; } seg7_t; void seg7_init( seg7_t *seg, bool initialize ); uint8_t seg7_read( void *obj, uint16_t addr ); void seg7_write( void *obj, uint16_t addr, uint8_t data ); #ifdef WITH_GUI void seg7_draw( void *obj, SDL_Renderer *renderer ); #endif void seg7_deinit( void *obj ); #endif