summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/ds2404.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/machine/ds2404.h')
-rw-r--r--src/devices/machine/ds2404.h42
1 files changed, 21 insertions, 21 deletions
diff --git a/src/devices/machine/ds2404.h b/src/devices/machine/ds2404.h
index 3b7442512a4..3e31b5b14cc 100644
--- a/src/devices/machine/ds2404.h
+++ b/src/devices/machine/ds2404.h
@@ -25,14 +25,14 @@ public:
void ref_day(uint8_t day) { m_ref_day = day; }
/* 1-wire interface reset */
- DECLARE_WRITE8_MEMBER(ds2404_1w_reset_w);
+ void _1w_reset_w(uint8_t data);
/* 3-wire interface reset */
- DECLARE_WRITE8_MEMBER(ds2404_3w_reset_w);
+ void _3w_reset_w(uint8_t data);
- DECLARE_READ8_MEMBER(ds2404_data_r);
- DECLARE_WRITE8_MEMBER(ds2404_data_w);
- DECLARE_WRITE8_MEMBER(ds2404_clk_w);
+ uint8_t data_r();
+ void data_w(uint8_t data);
+ void clk_w(uint8_t data);
protected:
// device-level overrides
@@ -49,24 +49,24 @@ protected:
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
private:
- void ds2404_rom_cmd(uint8_t cmd);
- void ds2404_cmd(uint8_t cmd);
+ void rom_cmd(uint8_t cmd);
+ void cmd(uint8_t cmd);
- uint8_t ds2404_readmem();
- void ds2404_writemem(uint8_t value);
+ uint8_t readmem();
+ void writemem(uint8_t value);
- enum DS2404_STATE
+ enum STATE
{
- DS2404_STATE_IDLE = 1, /* waiting for ROM command, in 1-wire mode */
- DS2404_STATE_COMMAND, /* waiting for memory command */
- DS2404_STATE_ADDRESS1, /* waiting for address bits 0-7 */
- DS2404_STATE_ADDRESS2, /* waiting for address bits 8-15 */
- DS2404_STATE_OFFSET, /* waiting for ending offset */
- DS2404_STATE_INIT_COMMAND,
- DS2404_STATE_READ_MEMORY, /* Read Memory command active */
- DS2404_STATE_WRITE_SCRATCHPAD, /* Write Scratchpad command active */
- DS2404_STATE_READ_SCRATCHPAD, /* Read Scratchpad command active */
- DS2404_STATE_COPY_SCRATCHPAD /* Copy Scratchpad command active */
+ STATE_IDLE = 1, /* waiting for ROM command, in 1-wire mode */
+ STATE_COMMAND, /* waiting for memory command */
+ STATE_ADDRESS1, /* waiting for address bits 0-7 */
+ STATE_ADDRESS2, /* waiting for address bits 8-15 */
+ STATE_OFFSET, /* waiting for ending offset */
+ STATE_INIT_COMMAND,
+ STATE_READ_MEMORY, /* Read Memory command active */
+ STATE_WRITE_SCRATCHPAD, /* Write Scratchpad command active */
+ STATE_READ_SCRATCHPAD, /* Read Scratchpad command active */
+ STATE_COPY_SCRATCHPAD /* Copy Scratchpad command active */
};
emu_timer *m_tick_timer;
@@ -84,7 +84,7 @@ private:
uint8_t m_sram[512]; /* 4096 bits */
uint8_t m_ram[32]; /* scratchpad ram, 256 bits */
uint8_t m_rtc[5]; /* 40-bit RTC counter */
- DS2404_STATE m_state[8];
+ STATE m_state[8];
int m_state_ptr;
};