Register

Trait Register 

Source
pub trait Register: Copy {
    type Regwidth: RegInt + AsPrimitive<Self::Accesswidth>;
    type Accesswidth: RegInt + AsPrimitive<Self::Regwidth>;
    type Access: Access;
    type ByteEndian: Endian;
    type WordEndian: Endian;

    // Required methods
    unsafe fn from_raw(val: Self::Regwidth) -> Self;
    fn to_raw(self) -> Self::Regwidth;
}
Expand description

Trait implemented by all register types.

Required Associated Types§

Source

type Regwidth: RegInt + AsPrimitive<Self::Accesswidth>

Primitive integer type representing the size of the full register value.

Source

type Accesswidth: RegInt + AsPrimitive<Self::Regwidth>

Primitive integer type representing the size of memory accesses used when reading/writing this register.

Source

type Access: Access

Access controls for this register.

Source

type ByteEndian: Endian

Ordering of bytes within each accesswidth subword.

Source

type WordEndian: Endian

Ordering of accesswidth subwords within the register.

Required Methods§

Source

unsafe fn from_raw(val: Self::Regwidth) -> Self

Convert a raw bit value into a Register instance.

§Safety

The caller must ensure the raw bit value is valid for the given register. For example, by reading it directly from hardware.

Source

fn to_raw(self) -> Self::Regwidth

Convert a Register instance into its raw bit value.

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§