| Crates.io | mmreg |
| lib.rs | mmreg |
| version | 0.1.1 |
| created_at | 2025-12-05 03:16:30.705799+00 |
| updated_at | 2025-12-06 05:57:52.133486+00 |
| description | Safe, concurrent 32-bit memory-mapped IO register access for Rust. Library and CLI for embedded and PC (linux) platforms. |
| homepage | |
| repository | https://github.com/PurnenduK90/mmreg |
| max_upload_size | |
| id | 1967624 |
| size | 31,681 |
A Rust library and CLI tool for safe, concurrent access to 32-bit memory-mapped IO registers.
/dev/mem)read <address>: Read a 32-bit value from the given physical address.write <address> <value>: Write a 32-bit value to the given physical address.mmreg read 0x40000000
mmreg write 0x40000000 0xDEADBEEF
0x).0xXXXXXXXX for reads.See Documentation for API documentation and examples.
use mmreg::{Interface, Register, SubRegister};
use mmreg::{read_register_at, write_register_at};
// Read a 32-bit value from a physical address
let value = read_register_at(0x4000_0000)?;
// Write a 32-bit value to a physical address
write_register_at(0x4000_0000, 0xDEADBEEF)?;
// ...
src/register.rs: Single register and subregister abstractionsrc/interface.rs: Group of registers (interface)src/memregs.rs: Unsafe Memory read Write (unix only)src/lib.rs: Library APIsrc/main.rs: Command-line interfaceThe list of supported cross-compilation targets is maintained in a single file: targets.txt.
sudo apt update ; sudo apt install -y build-essential
targets.txt.targets.txt to ensure consistency.targets.txt:x86_64-unknown-linux-gnu
i686-unknown-linux-gnu
armv7-unknown-linux-gnueabihf
aarch64-unknown-linux-gnu
To add or remove a target, simply edit targets.txt and rerun your build commands.
MIT
mips-unknown-linux-gnu
powerpc-unknown-linux-gnu
riscv64gc-unknown-linux-gnu