Crate mmreg

Crate mmreg 

Source
Expand description

§mmio Library API

This crate provides safe, concurrent access to 32-bit memory-mapped IO registers via /dev/mem. It is designed for use in CLI tools, controllers, and logging utilities that need direct register access.

§Example Usage

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)?;

Structs§

Interface
The main interface for managing mapped registers and safe access.
Register
Represents a 32-bit register with optional subregisters (bitfields).
SubRegister
Represents a 32-bit register with optional subregisters (bitfields).

Functions§

read_register_at
Reads a 32-bit value from a physical address using /dev/mem.
write_register_at
Writes a 32-bit value to a physical address using /dev/mem.