derive-mmio 0.8.0

A mechanism for making it easier to access MMIO peripherals
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#[derive(derive_mmio::Mmio)]
#[repr(C)]
struct Uart {
    // this is read-write by default
    data: u32,
}

fn send_check<T: Send>(_: &T) {}

fn main() {
    let mut uart = Uart { data: 0xA };

    // Safety: We're pointing at a real object
    let mmio_uart = unsafe { Uart::new_mmio(core::ptr::addr_of_mut!(uart)) };
    send_check(&mmio_uart);
}