diff options
Diffstat (limited to 'src/devices/machine/pcf8583.h')
-rw-r--r-- | src/devices/machine/pcf8583.h | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/devices/machine/pcf8583.h b/src/devices/machine/pcf8583.h index b01eadc44fd..2086eeef6bf 100644 --- a/src/devices/machine/pcf8583.h +++ b/src/devices/machine/pcf8583.h @@ -80,15 +80,14 @@ public: void set_a0(int a0) { m_slave_address = (m_slave_address & 0xfd) | (a0 << 1); } - DECLARE_WRITE_LINE_MEMBER(a0_w); - DECLARE_WRITE_LINE_MEMBER(scl_w); - DECLARE_WRITE_LINE_MEMBER(sda_w); - DECLARE_READ_LINE_MEMBER(sda_r); + void a0_w(int state); + void scl_w(int state); + void sda_w(int state); + int sda_r(); protected: // device-level overrides virtual void device_start() override; - virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; // device_rtc_interface overrides virtual bool rtc_feature_y2k() const override { return true; } @@ -97,8 +96,10 @@ protected: // device_nvram_interface overrides virtual void nvram_default() override; - virtual void nvram_read(emu_file &file) override; - virtual void nvram_write(emu_file &file) override; + virtual bool nvram_read(util::read_stream &file) override; + virtual bool nvram_write(util::write_stream &file) override; + + TIMER_CALLBACK_MEMBER(clock_tick); private: static constexpr uint8_t PCF8583_SLAVE_ADDRESS = 0xa0; @@ -128,8 +129,6 @@ private: CONTROL_STOP_BIT = 7 }; - static const device_timer_id TIMER_TICK = 0; - // get/set date uint8_t get_date_year() { return (m_data[REG_YEAR_DATE] >> 6) & 3; } void set_date_year(uint8_t year) { m_data[REG_YEAR_DATE] = (m_data[REG_YEAR_DATE] & 0x3f) | ((year % 4) << 6); } @@ -166,7 +165,7 @@ private: bool m_irq; emu_timer * m_timer; - enum { STATE_IDLE, STATE_DEVSEL, STATE_REGISTER, STATE_DATAIN, STATE_DATAOUT }; + enum { STATE_IDLE, STATE_DEVSEL, STATE_REGISTER, STATE_DATAIN, STATE_DATAOUT, STATE_READSELACK }; }; // device type definition |