![]() |
MOS Source Code
|
#include <serial.hpp>
Public Member Functions | |
| virtual | ~ISerialDevice ()=default |
| virtual u8 | ReadByte ()=0 |
| virtual int | WriteByte (u8 byte)=0 |
| virtual bool | get_data_ready ()=0 |
| virtual u8 | read_register (serial_register_t offset)=0 |
| virtual void | write_register (serial_register_t offset, u8 value)=0 |
| bool | setup () |
| int | read_data (char *data, size_t length) |
| int | write_data (const char *data, size_t length) |
Protected Attributes | |
| serial_baudrate_t | baudrate_divisor |
| serial_charlength_t | char_length |
| serial_stopbits_t | stop_bits |
| serial_parity_t | parity |
Private Types | |
| enum | serial_modem_status_t { MODEM_DCTS = 1 << 0 , MODEM_DDSR = 1 << 1 , MODEM_TERI = 1 << 2 , MODEM_DDCD = 1 << 3 , MODEM_CLEAR_TO_SEND = 1 << 4 , MODEM_DATA_SET_READY = 1 << 5 , MODEM_RING_INDICATOR = 1 << 6 , MODEM_DATA_CARRIER_DETECT = 1 << 7 } |
| enum | serial_modem_control_t { MODEM_DTR = 1 << 0 , MODEM_RTS = 1 << 1 , MODEM_UNUSED_PIN1 = 1 << 2 , MODEM_IRQ = 1 << 3 , MODEM_LOOP = 1 << 4 } |
| enum | serial_line_status_t { LINE_DATA_READY = 1 << 0 , LINE_ERR_OVERRUN = 1 << 1 , LINE_ERR_PARITY = 1 << 2 , LINE_ERR_FRAMING = 1 << 3 , LINE_ERR_BREAK = 1 << 4 , LINE_TRANSMITR_BUF_EMPTY = 1 << 5 , LINE_TRANSMITR_EMPTY = 1 << 6 , LINE_ERR_IMPENDING = 1 << 7 } |
Private Member Functions | |
| void | SetBaudrateDivisor () |
| void | SetDataBits () |
| void | SetStopBits () |
| void | SetParity () |
| void | SetInterrupts (int interrupts) |
| void | SetModemOptions (serial_modem_control_t control, bool enable) |
| char | GetLineStatus () |
| __maybe_unused char | GetModelStatus () |
| bool | GetDataReady () |
| void | WaitReadyToRead () |
| void | WaitReadyToWrite () |
Definition at line 71 of file serial.hpp.
|
private |
| Enumerator | |
|---|---|
| MODEM_DCTS | |
| MODEM_DDSR | |
| MODEM_TERI | |
| MODEM_DDCD | |
| MODEM_CLEAR_TO_SEND | |
| MODEM_DATA_SET_READY | |
| MODEM_RING_INDICATOR | |
| MODEM_DATA_CARRIER_DETECT | |
Definition at line 94 of file serial.hpp.
|
private |
| Enumerator | |
|---|---|
| MODEM_DTR | |
| MODEM_RTS | |
| MODEM_UNUSED_PIN1 | |
| MODEM_IRQ | |
| MODEM_LOOP | |
Definition at line 106 of file serial.hpp.
|
private |
| Enumerator | |
|---|---|
| LINE_DATA_READY | |
| LINE_ERR_OVERRUN | |
| LINE_ERR_PARITY | |
| LINE_ERR_FRAMING | |
| LINE_ERR_BREAK | |
| LINE_TRANSMITR_BUF_EMPTY | |
| LINE_TRANSMITR_EMPTY | |
| LINE_ERR_IMPENDING | |
Definition at line 115 of file serial.hpp.
|
virtualdefault |
|
pure virtual |
Implemented in RiscV64UartDevice, and x86SerialDevice.
Referenced by read_data(), and setup().
Implemented in RiscV64UartDevice, and x86SerialDevice.
Referenced by setup(), and write_data().
|
pure virtual |
Implemented in RiscV64UartDevice, and x86SerialDevice.
|
pure virtual |
Implemented in RiscV64UartDevice, and x86SerialDevice.
Referenced by GetLineStatus(), GetModelStatus(), SetBaudrateDivisor(), SetDataBits(), SetInterrupts(), SetModemOptions(), SetParity(), and SetStopBits().
|
pure virtual |
Implemented in RiscV64UartDevice, and x86SerialDevice.
Referenced by SetBaudrateDivisor(), SetDataBits(), SetInterrupts(), SetModemOptions(), SetParity(), and SetStopBits().
| bool setup | ( | ) |
|
private |
Definition at line 58 of file serial.cpp.
Referenced by setup().
|
private |
Definition at line 77 of file serial.cpp.
Referenced by setup().
|
private |
Definition at line 84 of file serial.cpp.
Referenced by setup().
|
private |
Definition at line 91 of file serial.cpp.
Referenced by setup().
Definition at line 98 of file serial.cpp.
Referenced by setup().
|
private |
Definition at line 105 of file serial.cpp.
Referenced by setup().
|
private |
Definition at line 119 of file serial.cpp.
Referenced by GetDataReady(), and WaitReadyToWrite().
|
private |
|
private |
Definition at line 129 of file serial.cpp.
Referenced by WaitReadyToRead().
|
private |
Definition at line 134 of file serial.cpp.
Referenced by read_data().
|
private |
Definition at line 140 of file serial.cpp.
Referenced by write_data().
|
protected |
Definition at line 88 of file serial.hpp.
Referenced by RiscV64UartDevice::RiscV64UartDevice(), SetBaudrateDivisor(), and x86SerialDevice::x86SerialDevice().
|
protected |
Definition at line 89 of file serial.hpp.
Referenced by RiscV64UartDevice::RiscV64UartDevice(), SetDataBits(), and x86SerialDevice::x86SerialDevice().
|
protected |
Definition at line 90 of file serial.hpp.
Referenced by RiscV64UartDevice::RiscV64UartDevice(), SetStopBits(), and x86SerialDevice::x86SerialDevice().
|
protected |
Definition at line 91 of file serial.hpp.
Referenced by RiscV64UartDevice::RiscV64UartDevice(), SetParity(), and x86SerialDevice::x86SerialDevice().