Struct pcf857x::Pcf8574a[][src]

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

Device driver

Implementations

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]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

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

fn default() -> Pcf8574a<I2C>[src]

Returns the “default value” for a type. Read more

Auto Trait Implementations

impl<I2C> !RefUnwindSafe for Pcf8574a<I2C>

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

impl<I2C> !Sync for Pcf8574a<I2C>

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

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

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.