ddevmem

Crates.ioddevmem
lib.rsddevmem
version
sourcesrc
created_at2024-10-30 15:52:20.008091
updated_at2024-12-10 15:20:53.618339
descriptionLibrary for accessing the physical address space using /dev/mem similar to busybox devmem
homepage
repositoryhttps://github.com/dodeca1337/ddevmem
max_upload_size
id1428722
Cargo.toml error:TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
Dodeca (dodeca1337)

documentation

README

ddevmem

Latest Version Documentation Downloads License

Rust library for accessing the physical address space using /dev/mem similar to busybox devmem

Installation

Add ddevmem to your Cargo.toml:

[dependencies]
ddevmem = "0.3.0"

Example

use ddevmem::{register_map, DevMem};

register_map! {
    pub unsafe map MyRegisterMap {
        0x00 => rw reg0: u32,
        0x04 => ro reg1: u32,
        0x08 => wo reg2: u32
    }
}

let devmem = unsafe { DevMem::new(0xD0DE_0000, None).unwrap() };
let mut reg_map = unsafe { MyRegisterMap::new(std::sync::Arc::new(devmem)).unwrap() };
let (reg0_address, reg0_offset) = (reg_map.reg0_address(), reg_map.reg0_offset());
let reg1_value = *reg_map.reg1();
*reg_map.reg2_mut() = reg1_value;

License

Ddevmem is distributed under the terms of the MIT license. See terms and conditions here.

Commit count: 16

cargo fmt