Function port_expander::write_multiple[][src]

pub fn write_multiple<PD, MUTEX, MODE: HasOutput, const N: usize>(
    pins: [&mut Pin<'_, MODE, MUTEX>; N],
    states: [bool; N]
) -> Result<(), PD::Error> where
    PD: PortDriver,
    MUTEX: BusMutex<Bus = PD>, 

Set multiple pins at the same time.

The usual method of setting multiple pins


can be problematic because the time between the two operations might be significant (they are done as two separate bus transactions). If it is desired that multiple pins change state in a single bus transaction, the write_multiple() function provides an interface to do this.


    [&mut io0, &mut io1],
    [true, false],