accessor
Accessors to access physical memory.
This crate is intended to access memory-mapped I/O. Reading and writing are done volatilely.
The accessed type must implement Copy because reading and writing values need to copy it.
This crate is #[no_std] compatible.
use Mapper;
use NonZeroUsize;
;
// Create an accessor to an i32 value at the physical address 0x1000.
let mut a = unsafe ;
// Read a value.
a.read;
// Write a value.
a.write;
// Create an accessor to an array at the physical address 0x2000 of the type i32 that has 5 elements.
let mut arr = unsafe ;
// Read the 2nd element.
arr.read_at;
// Write 42 as the 0th element.
arr.write_at;
License: MIT OR Apache-2.0