38#ifndef __DEV_SERIAL_HH__
39#define __DEV_SERIAL_HH__
48struct SerialDeviceParams;
49struct SerialNullDeviceParams;
Base class for serial devices such as terminals.
std::function< void()> interfaceCallback
Currently regisxtered host interface layer callback.
void notifyInterface()
Notify the host interface of pending data.
virtual uint8_t readData()=0
Read a character from the device.
virtual void writeData(uint8_t c)=0
Transmit a character from the host interface to the device.
void regInterfaceCallback(const std::function< void()> &callback)
Register a data available callback into the host interface layer.
virtual bool dataAvailable() const =0
Check if there is pending data from the serial device.
SerialDevice(const SerialDeviceParams &p)
Dummy serial device that discards all data sent to it.
void writeData(uint8_t c) override
Transmit a character from the host interface to the device.
bool dataAvailable() const override
Check if there is pending data from the serial device.
SerialNullDevice(const SerialNullDeviceParams &p)
uint8_t readData() override
Read a character from the device.
Abstract superclass for simulation objects.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.