pub struct ReadWrite<T, R = ()>where
T: UIntLike,
R: RegisterLongName,{ /* private fields */ }
Expand description
Read/Write registers.
For accessing and manipulating the register contents, the
Readable
, Writeable
and
ReadWriteable
traits are
implemented.
Trait Implementations§
Source§impl<T, R> Readable for ReadWrite<T, R>where
T: UIntLike,
R: RegisterLongName,
impl<T, R> Readable for ReadWrite<T, R>where
T: UIntLike,
R: RegisterLongName,
type T = T
type R = R
Source§fn read_as_enum<E>(&self, field: Field<Self::T, Self::R>) -> Option<E>where
E: TryFromValue<Self::T, EnumType = E>,
fn read_as_enum<E>(&self, field: Field<Self::T, Self::R>) -> Option<E>where
E: TryFromValue<Self::T, EnumType = E>,
Set the raw register value Read more
Source§fn is_set(&self, field: Field<Self::T, Self::R>) -> bool
fn is_set(&self, field: Field<Self::T, Self::R>) -> bool
Check if one or more bits in a field are set
Source§fn any_matching_bits_set(&self, field: FieldValue<Self::T, Self::R>) -> bool
fn any_matching_bits_set(&self, field: FieldValue<Self::T, Self::R>) -> bool
Check if any bits corresponding to the mask in the passed
FieldValue
are set.
This function is identical to is_set()
but operates on a FieldValue
rather
than a Field
, allowing for checking if any bits are set across multiple,
non-contiguous portions of a bitfield.Source§fn matches_all(&self, field: FieldValue<Self::T, Self::R>) -> bool
fn matches_all(&self, field: FieldValue<Self::T, Self::R>) -> bool
Check if all specified parts of a field match
Source§fn matches_any(&self, fields: &[FieldValue<Self::T, Self::R>]) -> bool
fn matches_any(&self, fields: &[FieldValue<Self::T, Self::R>]) -> bool
Check if any of the passed parts of a field exactly match the contained
value. This allows for matching on unset bits, or matching on specific values
in multi-bit fields.
Source§impl<T, R> Writeable for ReadWrite<T, R>where
T: UIntLike,
R: RegisterLongName,
impl<T, R> Writeable for ReadWrite<T, R>where
T: UIntLike,
R: RegisterLongName,
type T = T
type R = R
Source§fn 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
Source§fn 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.
Auto Trait Implementations§
impl<T, R = ()> !Freeze for ReadWrite<T, R>
impl<T, R = ()> !RefUnwindSafe for ReadWrite<T, R>
impl<T, R> Send for ReadWrite<T, R>
impl<T, R = ()> !Sync for ReadWrite<T, R>
impl<T, R> Unpin for ReadWrite<T, R>
impl<T, R> UnwindSafe for ReadWrite<T, R>where
T: UnwindSafe,
R: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Debuggable for Twhere
T: Readable,
impl<T> Debuggable for Twhere
T: Readable,
Source§fn debug(&self) -> RegisterDebugValue<Self::T, Self::R>
fn debug(&self) -> RegisterDebugValue<Self::T, Self::R>
Returns a
RegisterDebugValue
that
implements core::fmt::Debug
, the debug information is extracted from
<Register>::DebugInfo
.Source§impl<T, R, S> ReadWriteable for S
impl<T, R, S> ReadWriteable for S
type T = T
type R = R
Source§fn modify(
&self,
field: FieldValue<<S as ReadWriteable>::T, <S as ReadWriteable>::R>,
)
fn modify( &self, field: FieldValue<<S as ReadWriteable>::T, <S as ReadWriteable>::R>, )
Write the value of one or more fields, leaving the other fields unchanged