1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 10:37:45 +00:00

Kernel: Add a put_char(char) method to SerialDevice

This can be used to print a single char to the serial port the
SerialDevice instance handles.
This commit is contained in:
Idan Horowitz 2021-04-23 17:25:40 +03:00 committed by Andreas Kling
parent c75ca4ea8f
commit a5699a141d
2 changed files with 17 additions and 1 deletions

View file

@ -27,6 +27,8 @@ public:
virtual bool can_write(const FileDescription&, size_t) const override;
virtual KResultOr<size_t> write(FileDescription&, u64, const UserOrKernelBuffer&, size_t) override;
void put_char(char);
enum InterruptEnable {
LowPowerMode = 0x01 << 5,
SleepMode = 0x01 << 4,
@ -129,6 +131,7 @@ private:
WordLength m_word_length { EightBits };
bool m_break_enable { false };
u8 m_modem_control { 0 };
bool m_last_put_char_was_carriage_return { false };
};
}