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§
Provided Methods§
Sourcefn write(&self, field: FieldValue<Self::T, Self::R>)
fn write(&self, field: FieldValue<Self::T, Self::R>)
Write the value of one or more fields, overwriting the other fields with zero
Sourcefn modify_no_read(
&self,
original: LocalRegisterCopy<Self::T, Self::R>,
field: FieldValue<Self::T, Self::R>,
)
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.