[][src]Trait drone_cortex_m::reg::RwRegAtomic

pub trait RwRegAtomic<'a, T: RegAtomic>: RReg<T> + WRegAtomic<'a, T> + RegRef<'a, T> {
    fn modify<F>(&'a self, f: F)
    where
        F: for<'b> Fn(&'b mut Self::Hold) -> &'b mut Self::Hold
; }

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

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.

Loading content...

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]

Loading content...