OXYGENHUB
◆ main openmsx / src / sound / Y8950KeyboardDevice.hh
901 B · C++ · last changed chore(): initial commit 1 month ago source blame history raw
e8555c89 Andy McCall 1
#ifndef Y8950KEYBOARDDEVICE_HH
2
#define Y8950KEYBOARDDEVICE_HH
3
4
#include "Pluggable.hh"
5
6
#include <cstdint>
7
8
namespace openmsx {
9
10
class Y8950KeyboardDevice : public Pluggable
11
{
12
public:
13
	/**
14
	 * Send data to the device.
15
	 * Normally this is used to select a certain row from the
16
	 * keyboard but you might also connect a non-keyboard device.
17
	 * A 1-bit means corresponding row is selected ( 0V)
18
	 *   0-bit                        not selected (+5V)
19
	 */
20
	virtual void write(uint8_t data, EmuTime time) = 0;
21
22
	/**
23
	 * Read data from the device.
24
	 * Normally this are the keys that are pressed but you might
25
	 * also connect a non-keyboard device.
26
	 * A 0-bit means corresponding key is pressed
27
	 *   1-bit                        not pressed
28
	 */
29
	[[nodiscard]] virtual uint8_t read(EmuTime time) = 0;
30
31
	// pluggable
32
	[[nodiscard]] zstring_view getClass() const final;
33
};
34
35
} // namespace openmsx
36
37
#endif