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  std::string_view getDescription() const final override;
19  std::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 
39 
40 } // namespace openmsx
41 
42 #endif
SerialDataInterface.hh
openmsx::SerialDataInterface
Definition: SerialDataInterface.hh:10
serialize_meta.hh
openmsx::RS232Connector::getClass
std::string_view getClass() const final override
A Connector belong to a certain class.
Definition: RS232Connector.cc:22
openmsx::REGISTER_BASE_CLASS
REGISTER_BASE_CLASS(Connector, "Connector")
openmsx::RS232Connector::~RS232Connector
~RS232Connector()=default
openmsx::RS232Connector::RS232Connector
RS232Connector(PluggingController &pluggingController, std::string name)
Definition: RS232Connector.cc:10
openmsx::RS232Connector::serialize
void serialize(Archive &ar, unsigned version)
Definition: RS232Connector.cc:33
openmsx::RS232Connector::recvByte
void recvByte(byte value, EmuTime::param time) override=0
openmsx::RS232Connector::getDescription
std::string_view getDescription() const final override
Get a description for this connector.
Definition: RS232Connector.cc:17
openmsx::RS232Connector::setDataBits
void setDataBits(DataBits bits) override=0
openmsx::RS232Connector::ready
virtual bool ready()=0
openmsx::SerialDataInterface::StopBits
StopBits
Definition: SerialDataInterface.hh:15
openmsx::RS232Device
Definition: RS232Device.hh:10
openmsx::RS232Connector::getPluggedRS232Dev
RS232Device & getPluggedRS232Dev() const
Definition: RS232Connector.cc:27
openmsx::RS232Connector::setParityBit
void setParityBit(bool enable, ParityBit parity) override=0
openmsx::SerialDataInterface::DataBits
DataBits
Definition: SerialDataInterface.hh:12
Connector.hh
openmsx::RS232Connector::acceptsData
virtual bool acceptsData()=0
openmsx::RS232Connector
Definition: RS232Connector.hh:13
openmsx::RS232Connector::setStopBits
void setStopBits(StopBits bits) override=0
openmsx::Connector
Represents something you can plug devices into.
Definition: Connector.hh:21
openmsx::SerialDataInterface::ParityBit
ParityBit
Definition: SerialDataInterface.hh:19
openmsx::PluggingController
Central administration of Connectors and Pluggables.
Definition: PluggingController.hh:22
openmsx
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5