Trait max7301::expander::pin::ExpanderIO[][src]

pub trait ExpanderIO {
    fn write_port(&self, port: u8, bit: bool);
fn read_port(&self, port: u8) -> bool; }

An indirection between I/O pin abstractions and the expander itself, which allows selection between transactional reads and writes, which reduce bus traffic and latency, and immediate-mode reads and writes, which add more bus traffic and latency but are simpler to use.

Required methods

fn write_port(&self, port: u8, bit: bool)[src]

Write the value of an I/O port. port is a port number between 4 and 31; bit is the value to set the port to. If the pin is configured as an output, the value (true is logic high, false logic low) will be asserted on the corresponding pin.

fn read_port(&self, port: u8) -> bool[src]

Read the value of an I/O port. port is a port number between 4 and 31, the value of that pin will be returned (false if logic low, true if logic high). If the pin is configured as an output, the last set value will be read; if it is configured as an input, the logic level of the externally applied signal will be read.

Loading content...

Implementors

impl<M, EI> ExpanderIO for ImmediateIO<M, EI> where
    M: IOMutex<Expander<EI>>,
    EI: ExpanderInterface + Send
[src]

impl<M, EI> ExpanderIO for TransactionalIO<M, EI> where
    M: IOMutex<Expander<EI>>,
    EI: ExpanderInterface + Send
[src]

Loading content...