Trait probe_rs::MemoryMappedRegister
source · pub trait MemoryMappedRegister<T>: Clone + From<T> + Into<T> + Sized + Debug {
const ADDRESS_OFFSET: u64;
const NAME: &'static str;
// Provided methods
fn get_mmio_address_from_base(base_address: u64) -> Result<u64, Error> { ... }
fn get_mmio_address() -> u64 { ... }
}
Expand description
A memory mapped register, for instance ARM debug registers (DHCSR, etc).
Required Associated Constants§
sourceconst ADDRESS_OFFSET: u64
const ADDRESS_OFFSET: u64
The register’s address in the target memory. For some architectures (e.g. ARM Cortex-A) this address is offset from a base address. For others (e.g. ARM Cortex-M, RISC-V) this address is absolute.
Provided Methods§
sourcefn get_mmio_address_from_base(base_address: u64) -> Result<u64, Error>
fn get_mmio_address_from_base(base_address: u64) -> Result<u64, Error>
Get the register’s address in the memory map.
For architectures like ARM Cortex-A, this address is offset from a base address, which must be supplied when calling this method.
For others (e.g. ARM Cortex-M, RISC-V) where this address is a constant, please use MemoryMappedRegister::get_mmio_address
.
sourcefn get_mmio_address() -> u64
fn get_mmio_address() -> u64
Get the register’s address in the memory map.
For architectures ARM Cortex-M and RISC-V, this address is constant value stored as part of MemoryMappedRegister::ADDRESS_OFFSET
.
For other architectures (e.g. ARM Cortex-A) where this address is offset from a base address, please use MemoryMappedRegister::get_mmio_address_from_base
.