OXYGENHUB
◆ main openmsx / src / PrinterPortDevice.hh
890 B · C++ · last changed chore(): initial commit 1 month ago source blame history raw
1
#ifndef PRINTERPORTDEVICE_HH
2
#define PRINTERPORTDEVICE_HH
3
4
#include "Pluggable.hh"
5
#include <cstdint>
6
7
namespace openmsx {
8
9
class PrinterPortDevice : public Pluggable
10
{
11
public:
12
	/**
13
	 * Returns the STATUS signal:
14
	 *  false = low  = ready,
15
	 *  true  = high = not ready.
16
	 */
17
	[[nodiscard]] virtual bool getStatus(EmuTime time) = 0;
18
19
	/**
20
	 * Sets the strobe signal:
21
	 *  false = low,
22
	 *  true  = high.
23
	 * Normal high, a short pulse (low, high) means data is valid.
24
	 */
25
	virtual void setStrobe(bool strobe, EmuTime time) = 0;
26
27
	/**
28
	 * Sets the data signals.
29
	 * Always use strobe to see whether data is valid.
30
	 * As an optimization, this method might not be called when the
31
	 * new data is the same as the previous data.
32
	 */
33
	virtual void writeData(uint8_t data, EmuTime time) = 0;
34
35
	// Pluggable
36
	[[nodiscard]] zstring_view getClass() const final;
37
};
38
39
} // namespace openmsx
40
41
#endif