Enum max7301::expander::transactional::Strategy[][src]

pub enum Strategy {
    Exact,
    StompClean,
    StompAny,
}

Control how TransactionalIO::write_back will batch writes to modified pins.

Variants

Exact

This strategy will issue writes such that only the ports that have had output values explicitly set through the OutputPin impl will be altered.

This is the safest but least efficient write back strategy.

StompClean

This strategy will relax the write back batching so that it may overwrite any port that had its state read and cached in the most recent refresh call.

This means that some port registers may be “stomped” by writing values that match the values they had when refresh was called. This is true regardless of whether the port is configured as an input or output pin, however ports configured as inputs will remain in input mode and the superfluous write to that port is not observable.

StompAny

This strategy will further relax the write-back batching so that may potentially overwrite any port, even if the previous value was not read in a refresh.

Any ports that were not read in a refresh will be overwritten with an undefined value. This strategy makes most efficient use of the bus when most pins are output pins, but is only usable if you call port_pin for every port you care about, and either

  • Explicitly set every pin whose value you care about before each write_back call, or
  • Call refresh first before setting any pins.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.