src/bare-metal/aps/safemmio/registers.md
The safe-mmio crate provides types to wrap registers that can be read or
written safely.
| Can't read | Read has no side-effects | Read has side-effects | |
|---|---|---|---|
| Can't write | ReadPure | ReadOnly | |
| Can write | WriteOnly | ReadPureWrite | ReadWrite |
# // Copyright 2025 Google LLC
# // SPDX-License-Identifier: Apache-2.0
#
{{#include ../examples/src/pl011.rs:Registers}}
dr has a side effect: it pops a byte from the receive FIFO.rsr (and other registers) has no side-effects. It is a 'pure' read.safe-mmio crate.ReadPure or ReadOnly (and likewise between
ReadPureWrite and ReadWrite) is whether reading a register can have
side-effects that change the state of the device, e.g., reading the data
register pops a byte from the receive FIFO. ReadPure means that reads have
no side-effects, they are purely reading data.