pub trait Register:
Default
+ Clone
+ Pod
+ MaybeBitdumpFormattable {
type Unpacked;
type CodecError: Debug;
type SpiCodec: CodecSync<Error = Self::CodecError> + CodecAsync<Error = Self::CodecError>;
type I2cCodec: CodecSync<Error = Self::CodecError> + CodecAsync<Error = Self::CodecError>;
const REGISTER_SIZE: usize;
const ADDRESS: u64;
}
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§
Sourcetype CodecError: Debug
type CodecError: Debug
A common error type which can represent all associated codec errors
type SpiCodec: CodecSync<Error = Self::CodecError> + CodecAsync<Error = Self::CodecError>
type I2cCodec: CodecSync<Error = Self::CodecError> + CodecAsync<Error = Self::CodecError>
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.