Trait drone_cortexm::reg::RwRegAtomic [−][src]
Atomic operations for read-write register.
Required methods
fn modify<F>(&'a self, f: F) where
F: for<'b> Fn(&'b mut Self::Hold) -> &'b mut Self::Hold,
[src]
F: for<'b> Fn(&'b mut Self::Hold) -> &'b mut Self::Hold,
Reads the value from the register memory, then passes the value to the
closure f
, then writes the result of the closure back to the register
memory.
This operation is atomic, it repeats itself in case it was interrupted
in the middle. Thus the closure f
may be called multiple times.
See also modify_reg
.
fn modify_reg<F>(&'a self, f: F) where
F: for<'b> Fn(&'b Self, &'b mut Self::Val),
[src]
F: for<'b> Fn(&'b Self, &'b mut Self::Val),
Reads the value from the register memory, then passes a reference to
this register token and the value to the closure f
, then writes the
modified value into the register memory.
See also modify
.
Implementors
impl<'a, T, R> RwRegAtomic<'a, T> for R where
T: RegAtomic,
R: RReg<T> + WRegAtomic<'a, T> + RegRef<'a, T>,
<R::Val as Bitfield>::Bits: AtomicBits,
[src]
T: RegAtomic,
R: RReg<T> + WRegAtomic<'a, T> + RegRef<'a, T>,
<R::Val as Bitfield>::Bits: AtomicBits,