44 #ifndef __DEV_PS2_DEVICE_HH__ 45 #define __DEV_PS2_DEVICE_HH__ 52 struct PS2DeviceParams;
115 void send(
const uint8_t *data,
size_t size);
117 send(data.data(), data.size());
148 #endif // __DEV_PS2_HOUSE_HH__ std::function< void()> dataAvailableCallback
void sendAck()
Send an ACK byte to the host.
void hostWrite(uint8_t c)
Transmit a character from the host interface to the device.
PS2Device(const PS2DeviceParams *p)
void send(uint8_t data)
Send a byte of data from a PS/2 device to a host.
void serialize(CheckpointOut &cp) const override
Serialize an object.
void hostRegDataAvailable(const std::function< void()> &c)
Register a data available callback into the PS/2 interface.
size_t sendPending() const
Output buffer size.
void send(const uint8_t *data, size_t size)
Send data from a PS/2 device to a host.
std::ostream CheckpointOut
std::deque< uint8_t > outBuffer
Device -> host FIFO.
virtual bool recv(const std::vector< uint8_t > &data)=0
Data received from host.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
void send(const std::vector< uint8_t > &data)
std::vector< uint8_t > inBuffer
Host -> device buffer.
bool hostDataAvailable() const
Check if there is pending data from the PS/2 device.
Abstract superclass for simulation objects.
uint8_t hostRead()
Read a character from the device.