#[repr(transparent)]pub struct Aliased<T, R = (), W = ()>where
T: UIntLike,
R: RegisterLongName,
W: RegisterLongName,{ /* private fields */ }
Expand description
Read-only and write-only registers aliased to the same address.
Unlike the ReadWrite
register, this represents a register
which has different meanings based on if it is written or read.
This might be found on a device where control and status registers
are accessed via the same memory address via writes and reads,
respectively.
This register implements Readable
and Writeable
, but in
general does not implement
ReadWriteable
(only if the
type parameters R
and W
are identical, in which case a
ReadWrite
register might be a better choice).
Trait Implementations§
source§impl<T, R, W> Readable for Aliased<T, R, W>where
T: UIntLike,
R: RegisterLongName,
W: RegisterLongName,
impl<T, R, W> Readable for Aliased<T, R, W>where T: UIntLike, R: RegisterLongName, W: 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, W> Writeable for Aliased<T, R, W>where
T: UIntLike,
R: RegisterLongName,
W: RegisterLongName,
impl<T, R, W> Writeable for Aliased<T, R, W>where T: UIntLike, R: RegisterLongName, W: RegisterLongName,
type T = T
type R = W
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 = (), W = ()> !RefUnwindSafe for Aliased<T, R, W>
impl<T, R, W> Send for Aliased<T, R, W>where R: Send, T: Send, W: Send,
impl<T, R = (), W = ()> !Sync for Aliased<T, R, W>
impl<T, R, W> Unpin for Aliased<T, R, W>where R: Unpin, T: Unpin, W: Unpin,
impl<T, R, W> UnwindSafe for Aliased<T, R, W>where R: UnwindSafe, T: UnwindSafe, W: 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, R, S> ReadWriteable for Swhere
R: RegisterLongName,
S: Readable<T = T, R = R> + Writeable<T = T, R = R>,
T: UIntLike,
impl<T, R, S> ReadWriteable for Swhere R: RegisterLongName, S: Readable<T = T, R = R> + Writeable<T = T, R = R>, T: UIntLike,
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