|
IgrOS-Kernel 0.1.34.545
Simple C++20 Kernel for i386/x86_64
|
UART driver. More...
#include <array>#include <arch/io.hpp>#include <arch/irq.hpp>#include <drivers/uart/serial.hpp>#include <klib/kFlags.hpp>#include <klib/kPrint.hpp>#include <klib/kString.hpp>
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. | |
| namespace | igros::arch::anonymous_namespace{serial.cpp} |
| Anonymous namespace. | |
Functions | |
| static constexpr auto | igros::arch::serialRegister (const SERIAL_PORT port, const SERIAL_REG reg) noexcept -> port_t |
| Serial port register address. | |
| static void | igros::arch::serialRegWrite (const SERIAL_PORT port, const SERIAL_REG reg, const igros_byte_t value) noexcept |
| Write serial port register. | |
| static auto | igros::arch::serialRegRead (const SERIAL_PORT port, const SERIAL_REG reg) noexcept -> igros_byte_t |
| Read serial port register. | |
| static auto | igros::arch::serialStatus (const SERIAL_PORT port) noexcept -> klib::kFlags< SERIAL_LSR > |
| Read line status register. | |
| static auto | igros::arch::serialWaitStatus (const SERIAL_PORT port, const SERIAL_LSR status) noexcept -> bool |
| Wait until line status bit is set (bounded, so missing UART can't hang the kernel). | |
| 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? | |
| static auto | igros::arch::serialWaitWrite (const SERIAL_PORT port) noexcept -> bool |
| Wait until write ready. | |
| static auto | igros::arch::serialPut (const SERIAL_PORT port, const igros_byte_t value) noexcept -> bool |
| Wait for transmitter and send one byte. | |
| static auto | igros::arch::serialPutSymbol (const SERIAL_PORT port, const char symbol) noexcept -> bool |
| Send one symbol (new line is sent as CR LF). | |
| static auto | igros::arch::serialGetSymbol (const SERIAL_PORT port, char &symbol) noexcept -> bool |
| Receive one symbol (only if available). | |
| 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). | |
| static void | igros::arch::serialInterruptHandler1 (const register_t *const regs) noexcept |
| Serial #1 | #3 IRQ handler. | |
| auto | igros::arch::serialSetup () noexcept -> bool |
| Setup COM1 (115200 8N1) with receive interrupt. | |
UART driver.
Definition in file serial.cpp.