[−][src]Struct pcf857x::Pcf8574
Device driver
Methods
impl<I2C, E> Pcf8574<I2C> where
I2C: Write<Error = E>,
[src]
I2C: Write<Error = E>,
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, Pcf8574<I2C>, E>
[src]
Split device into individual pins
impl<I2C, E> Pcf8574<I2C> where
I2C: Read<Error = E> + Write<Error = E>,
[src]
I2C: Read<Error = E> + Write<Error = E>,
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]
&mut self,
mask: &PinFlag,
data: &mut [u8]
) -> Result<(), Error<E>>
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
Auto Trait Implementations
Blanket Implementations
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,