devmem 0.1.1

Small library for accessing the physical address space using /dev/mem
Documentation
  • Coverage
  • 85.71%
    6 out of 7 items documented0 out of 6 items with examples
  • Size
  • Source code size: 18.54 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 958.03 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 11s Average build duration of successful builds.
  • all releases: 11s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • GVitali1412/devmem-rs
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • GVitali1412

devmem-rs

Small Rust library for accessing the physical address space using /dev/mem

Documentation

Example

use devmem::Mapping

let mut mapping = unsafe {
    Mapping::new(0x1000_0000, 8).unwrap()
};
let data_to_write: Vec<u8> = vec![0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08];
mapping.copy_from_slice(&data_to_write);
    
let mapping = unsafe {
    Mapping::new(0x1000_0004, 4).unwrap()
};
let mut data_read: Vec<u8> = vec![0x00; 4];
mapping.copy_into_slice(&mut data_read);

assert_eq!(data_read, data_to_write[4..8]);

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.