Module hal::uart
UART HAL Polling-based UART serial driver. Freestanding-safe.
Uart<C> is generic over the UART block, a compile-time chip type:
UartGeneric reference layout: DATA +0x00, STATUS +0x04 (bit 0 RX
ready, bit 1 TX ready), BAUD +0x08 (written with 'baud')
Pl011 ARM PrimeCell PL011 (QEMU virt, Raspberry Pi, many SoCs)
Ns16550 16550-compatible, byte-wide registers at consecutive
addresses (QEMU RISC-V virt, many SoCs)
Stm32F4Usart STM32F1/F2/F4 USART (SR/DR/BRR/CR1)
struct Uart<Pl011> u = std::Uart::new(uart0, 115200u, 24000000u);
u.write_str("hello\n");
Structs
| UartGeneric | Each chip: init (set the baud rate from the input clock and enable TX/RX; clock_hz == 0 keeps whatever the boot firmware configured), the two ready flags, and one-byte data access. The driver does the waiting. |
| Pl011 | |
| Ns16550 | |
| Stm32F4Usart | |
| Uart |
Traits
| UartChip | What a UART block type provides; Uart<C> requires it. |