1
/**********************************************************************
3
E05-16 Real Time Clock emulation
6
Visit http://mamedev.org for licensing and usage restrictions.
8
**********************************************************************
10
Vdd1 1 |* \_/ | 16 Vdd2
13
_STOP 4 | E05-16 | 13 DI/O
14
_RESET 5 | E050-16 | 12 _SEC
17
Vss 8 |_____________| 9 _CS
19
**********************************************************************/
30
//**************************************************************************
32
//**************************************************************************
37
//**************************************************************************
38
// INTERFACE CONFIGURATION MACROS
39
//**************************************************************************
41
#define MCFG_E0516_ADD(_tag, _clock) \
42
MCFG_DEVICE_ADD(_tag, E0516, _clock)
46
//**************************************************************************
48
//**************************************************************************
51
// ======================> e0516_device_config
53
class e0516_device_config : public device_config
55
friend class e0516_device;
57
// construction/destruction
58
e0516_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
62
static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
63
virtual device_t *alloc_device(running_machine &machine) const;
69
// ======================> e0516_device
71
class e0516_device : public device_t
73
friend class e0516_device_config;
75
// construction/destruction
76
e0516_device(running_machine &_machine, const e0516_device_config &_config);
79
DECLARE_WRITE_LINE_MEMBER( cs_w );
80
DECLARE_WRITE_LINE_MEMBER( clk_w );
81
DECLARE_WRITE_LINE_MEMBER( dio_w );
82
DECLARE_READ_LINE_MEMBER( dio_r );
85
// device-level overrides
86
virtual void device_start();
87
virtual void device_reset();
88
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
91
int m_cs; // chip select
93
int m_data_latch; // data latch
94
int m_reg_latch; // register latch
95
int m_read_write; // read/write data
97
int m_bits; // number of bits transferred
98
int m_dio; // data pin
100
UINT8 m_register[8]; // registers
105
const e0516_device_config &m_config;
109
// device type definition
110
extern const device_type E0516;