diff options
Diffstat (limited to 'src/devices/machine/rtc9701.h')
-rw-r--r-- | src/devices/machine/rtc9701.h | 59 |
1 files changed, 25 insertions, 34 deletions
diff --git a/src/devices/machine/rtc9701.h b/src/devices/machine/rtc9701.h index 450c0c7c789..b0d35929945 100644 --- a/src/devices/machine/rtc9701.h +++ b/src/devices/machine/rtc9701.h @@ -8,10 +8,10 @@ ***************************************************************************/ -#pragma once +#ifndef MAME_MACHINE_RTC9701_H +#define MAME_MACHINE_RTC9701_H -#ifndef __rtc9701DEV_H__ -#define __rtc9701DEV_H__ +#pragma once @@ -19,31 +19,14 @@ // INTERFACE CONFIGURATION MACROS //************************************************************************** -#define MCFG_RTC9701_ADD(_tag) \ - MCFG_DEVICE_ADD(_tag, rtc9701, XTAL_32_768kHz) +#define MCFG_RTC9701_ADD(tag) \ + MCFG_DEVICE_ADD((tag), RTC9701, XTAL_32_768kHz) //************************************************************************** // TYPE DEFINITIONS //************************************************************************** -enum rtc9701_state_t -{ - RTC9701_CMD_WAIT = 0, - RTC9701_RTC_READ, - RTC9701_RTC_WRITE, - RTC9701_EEPROM_READ, - RTC9701_EEPROM_WRITE, - RTC9701_AFTER_WRITE_ENABLE - -}; - -struct rtc_regs_t -{ - uint8_t sec, min, hour, day, wday, month, year; -}; - - // ======================> rtc9701_device class rtc9701_device : public device_t, @@ -62,6 +45,22 @@ public: TIMER_CALLBACK_MEMBER(timer_callback); protected: + enum state_t + { + RTC9701_CMD_WAIT = 0, + RTC9701_RTC_READ, + RTC9701_RTC_WRITE, + RTC9701_EEPROM_READ, + RTC9701_EEPROM_WRITE, + RTC9701_AFTER_WRITE_ENABLE + + }; + + struct regs_t + { + uint8_t sec, min, hour, day, wday, month, year; + }; + // device-level overrides virtual void device_validity_check(validity_checker &valid) const override; virtual void device_start() override; @@ -79,7 +78,7 @@ protected: int m_clock_line; - rtc9701_state_t rtc_state; + state_t rtc_state; int cmd_stream_pos; int current_cmd; @@ -91,19 +90,11 @@ protected: uint16_t rtc9701_data[0x100]; - rtc_regs_t m_rtc; + regs_t m_rtc; }; // device type definition -extern const device_type rtc9701; - - - -//************************************************************************** -// GLOBAL VARIABLES -//************************************************************************** - - +DECLARE_DEVICE_TYPE(RTC9701, rtc9701_device) -#endif +#endif // MAME_MACHINE_RTC9701_H |