src/bare-metal/aps/uart.md
The QEMU 'virt' machine has a PL011 UART, so let's write a driver for that.
# // Copyright 2023 Google LLC
# // SPDX-License-Identifier: Apache-2.0
#
{{#include examples/src/pl011_minimal.rs:Example}}
Uart::new is unsafe while the other methods are safe. This is
because as long as the caller of Uart::new guarantees that its safety
requirements are met (i.e. that there is only ever one instance of the driver
for a given UART, and nothing else aliasing its address space), then it is
always safe to call write_byte later because we can assume the necessary
preconditions.new safe but write_byte
unsafe), but that would be much less convenient to use as every place that
calls write_byte would need to reason about the safety