Crates.io | ddevmem |
lib.rs | ddevmem |
version | |
source | src |
created_at | 2024-10-30 15:52:20.008091 |
updated_at | 2024-12-10 15:20:53.618339 |
description | Library for accessing the physical address space using /dev/mem similar to busybox devmem |
homepage | |
repository | https://github.com/dodeca1337/ddevmem |
max_upload_size | |
id | 1428722 |
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` |
size | 0 |
Rust library for accessing the physical address space using /dev/mem similar to busybox devmem
Add ddevmem
to your Cargo.toml
:
[dependencies]
ddevmem = "0.3.0"
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;
Ddevmem is distributed under the terms of the MIT license. See terms and conditions here.