generic<C: UartChip> struct Uart {
&volatile unsigned int base;
unsigned int baud;
C chip;
}Fields
MMIO base address
configured baud rate
Methods
§
static struct Uart<C> new(
&volatile unsigned int base,
unsigned int baud,
unsigned int clock_hz,
)source · definitionInitialize the UART at base: 8N1 at baud from a clock_hz input clock
(0 = leave the rate the firmware set). The chip type comes from the target.
Send a single byte (blocks until TX ready).
Read a single byte (blocks until RX available).
Send a null-terminated string.
Check if a byte is available to read. Returns 1 if ready.
Check if transmitter is ready. Returns 1 if ready.