Register

Trait Register 

Source
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§

Source

const REGISTER_SIZE: usize

The size of the register in bytes

Source

const ADDRESS: u64

The virtual address of this register

Required Associated Types§

Source

type Unpacked

The associated unpacked type

Source

type CodecError: Debug

A common error type which can represent all associated codec errors

Source

type SpiCodec: CodecSync<Error = Self::CodecError> + CodecAsync<Error = Self::CodecError>

Source

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.

Implementors§