kernel::utilities::registers::interfaces

Trait Writeable

Source
pub trait Writeable {
    type T: UIntLike;
    type R: RegisterLongName;

    // Required method
    fn set(&self, value: Self::T);

    // Provided methods
    fn write(&self, field: FieldValue<Self::T, Self::R>) { ... }
    fn modify_no_read(
        &self,
        original: LocalRegisterCopy<Self::T, Self::R>,
        field: FieldValue<Self::T, Self::R>,
    ) { ... }
}
Expand description

Writeable register

Register which at least supports setting a value. Only Writeable::set 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§

Source

fn set(&self, value: Self::T)

Set the raw register value

Provided Methods§

Source

fn write(&self, field: FieldValue<Self::T, Self::R>)

Write the value of one or more fields, overwriting the other fields with zero

Source

fn modify_no_read( &self, original: LocalRegisterCopy<Self::T, Self::R>, field: FieldValue<Self::T, Self::R>, )

Write the value of one or more fields, maintaining the value of unchanged fields via a provided original value, rather than a register read.

Implementors§

Source§

impl<T, R> Writeable for InMemoryRegister<T, R>

Source§

type T = T

Source§

type R = R

Source§

impl<T, R> Writeable for ReadWrite<T, R>

Source§

type T = T

Source§

type R = R

Source§

impl<T, R> Writeable for WriteOnly<T, R>

Source§

type T = T

Source§

type R = R

Source§

impl<T, R, W> Writeable for Aliased<T, R, W>

Source§

type T = T

Source§

type R = W