Trait kernel::utilities::registers::interfaces::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>

§

type T = T

§

type R = R

source§

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

§

type T = T

§

type R = R

source§

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

§

type T = T

§

type R = R

source§

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

§

type T = T

§

type R = W