Trait drone_cortexm::reg::RwRegAtomic[][src]

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
;
fn modify_reg<F>(&'a self, f: F)
    where
        F: for<'b> Fn(&'b Self, &'b mut Self::Val)
; }

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]

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]

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.

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...