[][src]Struct pcf857x::Pcf8574a

pub struct Pcf8574a<I2C> { /* fields omitted */ }

Device driver

Methods

impl<I2C, E> Pcf8574a<I2C> where
    I2C: Write<Error = E>, 
[src]

pub fn new(i2c: I2C, address: SlaveAddr) -> Self[src]

Create new instance of the device

pub fn destroy(self) -> I2C[src]

Destroy driver instance, return I²C bus instance.

pub fn set(&mut self, bits: u8) -> Result<(), Error<E>>[src]

Set the status of all I/O pins.

pub fn write_array(&mut self, data: &[u8]) -> Result<(), Error<E>>[src]

Set the status of all I/O pins repeatedly by looping through each array element

pub fn split<'a>(&'a self) -> Parts<'a, Pcf8574a<I2C>, E>[src]

Split device into individual pins

impl<I2C, E> Pcf8574a<I2C> where
    I2C: Read<Error = E> + Write<Error = E>, 
[src]

pub fn get(&mut self, mask: &PinFlag) -> Result<u8, Error<E>>[src]

Get the status of the selected I/O pins. The mask of the pins to be read can be created with a combination of PinFlag::P0 to PinFlag::P7.

pub fn read_array(
    &mut self,
    mask: &PinFlag,
    data: &mut [u8]
) -> Result<(), Error<E>>
[src]

Get the status of the selected I/O pins repeatedly and put them in the provided array. The mask of the pins to be read can be created with a combination of PinFlag::P0 to PinFlag::P7.

Trait Implementations

impl<I2C: Debug> Debug for Pcf8574a<I2C>[src]

impl<I2C: Default> Default for Pcf8574a<I2C>[src]

Auto Trait Implementations

impl<I2C> Send for Pcf8574a<I2C> where
    I2C: Send

impl<I2C> !Sync for Pcf8574a<I2C>

Blanket Implementations

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> Into<U> for T where
    U: From<T>, 
[src]

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

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.

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

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

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