pub struct Pca9539<I2C> { /* private fields */ }
Expand description
PCA9539/TCA9539 is a 16-pin I2C I/O Expander with I2C Interface.
Implementations§
Source§impl<I2C, E> Pca9539<I2C>
impl<I2C, E> Pca9539<I2C>
Sourcepub fn new_default(i2c: I2C) -> Result<Self, Error<E>>
pub fn new_default(i2c: I2C) -> Result<Self, Error<E>>
Creates an expander with the default configuration.
Sourcepub fn new(i2c: I2C, address: u8) -> Result<Self, Error<E>>
pub fn new(i2c: I2C, address: u8) -> Result<Self, Error<E>>
Creates an expander with specific address.
Sourcepub fn set_bit(&mut self, addr: u8, bit: usize, value: bool) -> Result<(), E>
pub fn set_bit(&mut self, addr: u8, bit: usize, value: bool) -> Result<(), E>
Set a single bit in a register
pub fn set_level(&mut self, pin: Pin, level: Level) -> Result<(), E>
pub fn set_direction(&mut self, pin: Pin, direction: Direction) -> Result<(), E>
Trait Implementations§
impl<I2C: Copy> Copy for Pca9539<I2C>
Auto Trait Implementations§
impl<I2C> Freeze for Pca9539<I2C>where
I2C: Freeze,
impl<I2C> RefUnwindSafe for Pca9539<I2C>where
I2C: RefUnwindSafe,
impl<I2C> Send for Pca9539<I2C>where
I2C: Send,
impl<I2C> Sync for Pca9539<I2C>where
I2C: Sync,
impl<I2C> Unpin for Pca9539<I2C>where
I2C: Unpin,
impl<I2C> UnwindSafe for Pca9539<I2C>where
I2C: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more