hardware 0.0.9

A no_std bare-metal hardware abstraction layer — all port I/O, memory and swap allocations are guarded at runtime. Do not consider this dependency stable before x.1.x
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
/// # Safety
/// `addr` must be a valid, aligned MMIO address mapped into the process.
pub unsafe fn mmio_read32(addr: usize) -> u32 {
    let ptr = addr as *const u32;
    core::ptr::read_volatile(ptr)
}

/// # Safety
/// `addr` must be a valid, aligned MMIO address mapped into the process.
pub unsafe fn mmio_write32(addr: usize, val: u32) {
    let ptr = addr as *mut u32;
    core::ptr::write_volatile(ptr, val);
}