IgrOS-Kernel 0.1.34.545
Simple C++20 Kernel for i386/x86_64
Loading...
Searching...
No Matches
serial.hpp File Reference

UART driver. More...

#include <span>
#include <string_view>
#include <arch/types.hpp>
Include dependency graph for serial.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  igros
 IgrOS kernel: common types and literals.
namespace  igros::arch
 Architecture-independent interface: drivers and aliases of current architecture types.

Enumerations

enum class  igros::arch::SERIAL_PORT : igros_word_t { COM1 = 0x03F8_u16 , COM2 = 0x02F8_u16 , COM3 = 0x03E8_u16 , COM4 = 0x02E8_u16 }
 Serial ports (standard PC I/O bases). More...
enum class  igros::arch::BAUD_RATE : igros_dword_t {
  BAUD_110 = 110_u32 , BAUD_300 = 300_u32 , BAUD_600 = 600_u32 , BAUD_1200 = 1200_u32 ,
  BAUD_2400 = 2400_u32 , BAUD_4800 = 4800_u32 , BAUD_9600 = 9600_u32 , BAUD_14400 = 14400_u32 ,
  BAUD_19200 = 19200_u32 , BAUD_38400 = 38400_u32 , BAUD_57600 = 57600_u32 , BAUD_115200 = 115200_u32
}
 Baud rates. More...
enum class  igros::arch::DATA_SIZE : igros_byte_t { CHAR_5 = 0x00 , CHAR_6 = 0x01 , CHAR_7 = 0x02 , CHAR_8 = 0x03 }
 Data size. More...
enum class  igros::arch::STOP_BITS : igros_byte_t { STOP_1 = 0x00_u8 , STOP_1_5 = 0x01_u8 , STOP_2 = 0x03_u8 }
 Stop bits. More...
enum class  igros::arch::PARITY : igros_byte_t {
  NONE = 0x00_u8 , ODD = 0x01_u8 , EVEN = 0x02_u8 , MARK = 0x05_u8 ,
  SPACE = 0x07_u8
}
 Parity. More...

Functions

auto igros::arch::serialInit (const SERIAL_PORT port, const BAUD_RATE baudRate, const DATA_SIZE dataSize, const STOP_BITS stopBits, const PARITY parity) noexcept -> bool
 Initialize serial port.
auto igros::arch::serialReadyWrite (const SERIAL_PORT port) noexcept -> bool
 Is write ready?
auto igros::arch::serialReadyRead (const SERIAL_PORT port) noexcept -> bool
 Is read ready?
auto igros::arch::serialWrite (const SERIAL_PORT port, const std::string_view text) noexcept -> igros_usize_t
 Serial write.
auto igros::arch::serialRead (const SERIAL_PORT port, const std::span< char > buffer) noexcept -> igros_usize_t
 Serial read.
auto igros::arch::serialWrite (const std::string_view text) noexcept -> igros_usize_t
 Serial write to COM1 (kernel console).
auto igros::arch::serialWrite (const char *const src) noexcept -> igros_usize_t
 Serial write to COM1 (kernel console).
auto igros::arch::serialSetup () noexcept -> bool
 Setup COM1 (115200 8N1) with receive interrupt.

Detailed Description

UART driver.

Date
03 Nov 2026
Author
Igor Baklykov

Definition in file serial.hpp.