pub struct Multiplexer<I2C: 'static + Send + Sync> { /* private fields */ }
Implementations§
Source§impl<I2C> Multiplexer<I2C>
impl<I2C> Multiplexer<I2C>
pub fn new(i2c: I2C) -> Self
Sourcepub fn with_address_pins(self, a0: bool, a1: bool, a2: bool) -> Self
pub fn with_address_pins(self, a0: bool, a1: bool, a2: bool) -> Self
Sets the address according to the enabled hardware settings
Sourcepub fn with_address(self, address: u8) -> Self
pub fn with_address(self, address: u8) -> Self
Sets the address
Source§impl<I2C> Multiplexer<I2C>
impl<I2C> Multiplexer<I2C>
Sourcepub fn with_ports_disabled(self) -> Result<Self, I2C::Error>
pub fn with_ports_disabled(self) -> Result<Self, I2C::Error>
Disables all ports
Sourcepub fn set_ports_disabled(self) -> Result<(), I2C::Error>
pub fn set_ports_disabled(self) -> Result<(), I2C::Error>
Disables all ports
Sourcepub fn with_ports_enabled(self) -> Result<Self, I2C::Error>
pub fn with_ports_enabled(self) -> Result<Self, I2C::Error>
Enables all ports
Sourcepub fn set_ports_enabled(self) -> Result<(), I2C::Error>
pub fn set_ports_enabled(self) -> Result<(), I2C::Error>
Enables all ports
Sourcepub fn set_port(
&mut self,
port: u8,
state: impl Into<bool>,
) -> Result<(), I2C::Error>
pub fn set_port( &mut self, port: u8, state: impl Into<bool>, ) -> Result<(), I2C::Error>
Enables / Disables the selected port
Sourcepub fn with_port(
self,
port: u8,
state: impl Into<bool>,
) -> Result<Self, I2C::Error>
pub fn with_port( self, port: u8, state: impl Into<bool>, ) -> Result<Self, I2C::Error>
Sets the selected port
Trait Implementations§
Source§impl<I2C: Clone + 'static + Send + Sync> Clone for Multiplexer<I2C>
impl<I2C: Clone + 'static + Send + Sync> Clone for Multiplexer<I2C>
Source§fn clone(&self) -> Multiplexer<I2C>
fn clone(&self) -> Multiplexer<I2C>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreimpl<I2C: Copy + 'static + Send + Sync> Copy for Multiplexer<I2C>
Auto Trait Implementations§
impl<I2C> Freeze for Multiplexer<I2C>where
I2C: Freeze,
impl<I2C> RefUnwindSafe for Multiplexer<I2C>where
I2C: RefUnwindSafe,
impl<I2C> Send for Multiplexer<I2C>
impl<I2C> Sync for Multiplexer<I2C>
impl<I2C> Unpin for Multiplexer<I2C>where
I2C: Unpin,
impl<I2C> UnwindSafe for Multiplexer<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