OXYGENHUB
◆ main openmsx / src / serial / SerialDataInterface.hh
653 B · C++ · last changed chore(): initial commit 1 month ago source blame history raw
e8555c89 Andy McCall 1
#ifndef SERIALDATAINTERFACE_HH
2
#define SERIALDATAINTERFACE_HH
3
4
#include "EmuTime.hh"
5
6
#include <cstdint>
7
8
namespace openmsx {
9
10
class SerialDataInterface
11
{
12
public:
13
	enum class DataBits : uint8_t {
14
		D5 = 5, D6 = 6, D7 = 7, D8 = 8
15
	};
16
	enum class StopBits : uint8_t {
17
		INV = 0, S1 = 2, S1_5 = 3, S2 = 4
18
	};
19
	enum class Parity : uint8_t {
20
		EVEN = 0, ODD = 1
21
	};
22
23
	virtual void setDataBits(DataBits bits) = 0;
24
	virtual void setStopBits(StopBits bits) = 0;
25
	virtual void setParityBit(bool enable, Parity parity) = 0;
26
	virtual void recvByte(uint8_t value, EmuTime time) = 0;
27
28
protected:
29
	~SerialDataInterface() = default;
30
};
31
32
} // namespace openmsx
33
34
#endif