pub trait IndexedRegister: Sized {
type Value: MmioOperand;
const BASE_OFFSET: usize;
const STRIDE: usize;
const COUNT: usize;
// Required methods
fn from_raw(value: Self::Value) -> Self;
fn to_raw(&self) -> Self::Value;
}Expand description
A trait for types representing an array (block) of registers in MMIO.
Indexed registers are located at a base offset and repeat at a fixed stride. They are typically accessed using a zero-based index.
§Examples
indexed_register! {
DataReg, u32, 0x100, 4, 16, RW, {
pub value, set_value: 31, 0;
}
}Required Associated Constants§
Sourceconst BASE_OFFSET: usize
const BASE_OFFSET: usize
The byte offset of the first element in the register array.
Required Associated Types§
Sourcetype Value: MmioOperand
type Value: MmioOperand
The underlying integer type (e.g., u32) that holds the register bits.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.