Max OS 0.3
Loading...
Searching...
No Matches
serial.h
Go to the documentation of this file.
1
9#ifndef MAXOS_SERIAL_H
10#define MAXOS_SERIAL_H
11
13#include <drivers/driver.h>
14#include <common/logger.h>
15
16
17namespace MaxOS::drivers {
18
19
24 class SerialConsole : public Driver, public common::OutputStream {
25
26 private:
28 hardwarecommunication::Port8Bit m_interrupt_enable_port;
29 hardwarecommunication::Port8Bit m_fifo_control_port;
30 hardwarecommunication::Port8Bit m_line_control_port;
31 hardwarecommunication::Port8Bit m_modem_control_port;
32 hardwarecommunication::Port8Bit m_line_status_port;
33
34 public:
35 explicit SerialConsole(Logger* logger);
37
38 void put_character(char c);
39 void write_char(char c) final;
40
41 };
42
43}
44
45
46#endif // MAXOS_SERIAL_H
A class that handles logging messages to the console and files.
Definition logger.h:44
A stream that strings can be written to.
base class for all drivers, handles the activation, deactivation, initialisation and reset of the dri...
Definition driver.h:27
A driver for the serial output.
Definition serial.h:24
void write_char(char c) final
Writes a character to the output stream.
Definition serial.cpp:76
void put_character(char c)
Waits for the serial port to be ready, then writes a character to it.
Definition serial.cpp:66
Defines a base Driver class and DriverManager for managing drivers.
Defines a Logger class for logging messages with different severity levels to multiple output streams...
Defines classes for handling hardware communication ports (8, 16, and 32 bit)