Struct tock_registers::LocalRegisterCopy [−][src]
pub struct LocalRegisterCopy<T: UIntLike, R: RegisterLongName = ()> { /* fields omitted */ }
Expand description
A read-write copy of register contents.
This behaves very similarly to a read-write register, but instead of doing a volatile read to MMIO to get the value for each function call, a copy of the register contents are stored locally in memory. This allows a peripheral to do a single read on a register, and then check which bits are set without having to do a full MMIO read each time. It also allows the value of the register to be “cached” in case the peripheral driver needs to clear the register in hardware yet still be able to check the bits. You can write to a local register, which will modify the stored value, but will not modify any hardware because it operates only on local copy.
This type does not implement the
Readable
and
Writeable
traits because it
requires a mutable reference to modify the contained value. It
still mirrors the interface which would be exposed by a type
implementing Readable
,
Writeable
and
ReadWriteable
.
Implementations
Read value of the given field as an enum member
Write the value of one or more fields, overwriting the other fields with zero
Write the value of one or more fields, leaving the other fields unchanged
Check if any specified parts of a field match
Check if all specified parts of a field match
Do a bitwise AND operation of the stored value and the passed in value and return a new LocalRegisterCopy.
Trait Implementations
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Auto Trait Implementations
impl<T, R> Send for LocalRegisterCopy<T, R> where
R: Send,
T: Send,
impl<T, R> Sync for LocalRegisterCopy<T, R> where
R: Sync,
T: Sync,
impl<T, R> Unpin for LocalRegisterCopy<T, R> where
R: Unpin,
T: Unpin,