pub trait Register:
Default
+ Clone
+ Pod {
type Bitfield;
type SpiCodec: CodecSync + CodecAsync;
type I2cCodec: CodecSync + CodecAsync;
const REGISTER_SIZE: usize;
const ADDRESS: u64;
// Required methods
fn data(&self) -> &[u8];
fn data_mut(&mut self) -> &mut [u8] ⓘ;
}Expand description
The basis trait for all registers. A register is a type that maps to a specific register on an embedded device and should own the raw data required for this register.
Additionally, a register knows the virtual address ossociated to the embedded device, and a bitfield representation of the data content.
Required Associated Constants§
Sourceconst REGISTER_SIZE: usize
const REGISTER_SIZE: usize
The size of the register in bytes
Required Associated Types§
type SpiCodec: CodecSync + CodecAsync
type I2cCodec: CodecSync + CodecAsync
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".