openMSX
RS232Connector.hh
Go to the documentation of this file.
1 #ifndef RS232CONNECTOR_HH
2 #define RS232CONNECTOR_HH
3 
4 #include "Connector.hh"
5 #include "SerialDataInterface.hh"
6 #include "serialize_meta.hh"
7 
8 namespace openmsx {
9 
10 class RS232Device;
11 
13 {
14 public:
16 
17  // Connector
18  string_view getDescription() const final override;
19  string_view getClass() const final override;
20 
21  // input (SerialDataInterface)
22  void setDataBits(DataBits bits) override = 0;
23  void setStopBits(StopBits bits) override = 0;
24  void setParityBit(bool enable, ParityBit parity) override = 0;
25  void recvByte(byte value, EmuTime::param time) override = 0;
26  virtual bool ready() = 0;
27  virtual bool acceptsData() = 0;
28 
29  template<typename Archive>
30  void serialize(Archive& ar, unsigned version);
31 
32 protected:
33  RS232Connector(PluggingController& pluggingController,
34  std::string name);
35  ~RS232Connector() = default;
36 };
37 
38 REGISTER_BASE_CLASS(RS232Connector, "rs232connector");
39 
40 } // namespace openmsx
41 
42 #endif
void setParityBit(bool enable, ParityBit parity) override=0
RS232Device & getPluggedRS232Dev() const
Represents something you can plug devices into.
Definition: Connector.hh:20
void serialize(Archive &ar, unsigned version)
string_view getClass() const final override
A Connector belong to a certain class.
virtual bool acceptsData()=0
REGISTER_BASE_CLASS(Connector, "Connector")
uint8_t byte
8 bit unsigned integer
Definition: openmsx.hh:26
Central administration of Connectors and Pluggables.
void recvByte(byte value, EmuTime::param time) override=0
string_view getDescription() const final override
Get a description for this connector.
RS232Connector(PluggingController &pluggingController, std::string name)
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
virtual bool ready()=0
This class implements a (close approximation) of the std::string_view class.
Definition: string_view.hh:16
void setDataBits(DataBits bits) override=0
void setStopBits(StopBits bits) override=0