pub trait Readable {
    type T: UIntLike;
    type R: RegisterLongName;

    fn get(&self) -> Self::T;

    fn read(&self, field: Field<Self::T, Self::R>) -> Self::T { ... }
    fn read_as_enum<E: TryFromValue<Self::T, EnumType = E>>(
        &self,
        field: Field<Self::T, Self::R>
    ) -> Option<E> { ... } fn extract(&self) -> LocalRegisterCopy<Self::T, Self::R> { ... } fn is_set(&self, field: Field<Self::T, Self::R>) -> bool { ... } fn matches_any(&self, field: FieldValue<Self::T, Self::R>) -> bool { ... } fn matches_all(&self, field: FieldValue<Self::T, Self::R>) -> bool { ... } }
Expand description

Readable register

Register which at least supports reading the current value. Only Readable::get must be implemented, as for other methods a default implementation is provided.

A register that is both Readable and Writeable will also automatically be ReadWriteable, if the RegisterLongName of Readable is the same as that of Writeable (i.e. not for Aliased registers).

Required Associated Types

Required Methods

Get the raw register value

Provided Methods

Read the value of the given field

Set the raw register value

Make a local copy of the register

Check if one or more bits in a field are set

Check if any specified parts of a field match

Check if all specified parts of a field match

Implementors