summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/machine/itt1700_kbd.h
blob: b8ee3cfd3eeb20cf9a68c2516d9a5f0f77d6e7c1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// license:BSD-3-Clause
// copyright-holders:AJR

#ifndef MAME_MACHINE_ITT1700_KBD
#define MAME_MACHINE_ITT1700_KBD

#pragma once


//**************************************************************************
//  TYPE DEFINITIONS
//**************************************************************************

// ======================> itt1700_keyboard_device

class itt1700_keyboard_device : public device_t
{
public:
	// device constructor
	itt1700_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0);

	// host interface
	DECLARE_WRITE_LINE_MEMBER(line1_w);
	DECLARE_WRITE_LINE_MEMBER(line2_w);
	DECLARE_WRITE_LINE_MEMBER(clock_w);
	DECLARE_READ_LINE_MEMBER(sense_r);

protected:
	// device-specific overrides
	virtual void device_start() override;
	virtual ioport_constructor device_input_ports() const override;

private:
	// internal state
	bool m_clock_state;
	bool m_line1_state;
	bool m_line2_state;
	u8 m_scan_counter;

	// key input matrix
	required_ioport_array<16> m_keys;
};

// device type definition
DECLARE_DEVICE_TYPE(ITT1700_KEYBOARD, itt1700_keyboard_device)

#endif // MAME_MACHINE_ITT1700_KBD_H