src/bare-metal/aps/mmio.md
pointer::read_volatile and pointer::write_volatile.&mut) a reference at any time.&raw to get fields of structs without creating an intermediate
reference.# // Copyright 2023 Google LLC
# // SPDX-License-Identifier: Apache-2.0
#
const SOME_DEVICE_REGISTER: *mut u64 = 0x800_0000 as _;
// SAFETY: Some device is mapped at this address.
unsafe {
SOME_DEVICE_REGISTER.write_volatile(0xff);
SOME_DEVICE_REGISTER.write_volatile(0x80);
assert_eq!(SOME_DEVICE_REGISTER.read_volatile(), 0xaa);
}
&raw to get struct field pointers from a pointer to the struct.addr_of! macro
instead.