Struct i2c_multiplexer::Multiplexer
source · pub struct Multiplexer<I2C: 'static + Send + Sync> { /* private fields */ }
Implementations§
source§impl<I2C> Multiplexer<I2C>where
I2C: WriteRead + Write + Send + Sync,
impl<I2C> Multiplexer<I2C>where I2C: WriteRead + Write + Send + Sync,
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>where
I2C: WriteRead + Write + Send + Sync,
impl<I2C> Multiplexer<I2C>where I2C: WriteRead + Write + Send + Sync,
sourcepub fn with_ports_disabled(self) -> Result<Self>
pub fn with_ports_disabled(self) -> Result<Self>
Disables all ports
sourcepub fn set_ports_disabled(self) -> Result<()>
pub fn set_ports_disabled(self) -> Result<()>
Disables all ports
sourcepub fn with_ports_enabled(self) -> Result<Self>
pub fn with_ports_enabled(self) -> Result<Self>
Enables all ports
sourcepub fn set_ports_enabled(self) -> Result<()>
pub fn set_ports_enabled(self) -> Result<()>
Enables all ports
sourcepub fn set_port(&mut self, port: u8, state: impl Into<bool>) -> Result<()>
pub fn set_port(&mut self, port: u8, state: impl Into<bool>) -> Result<()>
Enables / Disables the selected port
sourcepub fn with_port(self, port: u8, state: impl Into<bool>) -> Result<Self>
pub fn with_port(self, port: u8, state: impl Into<bool>) -> Result<Self>
Sets the selected port
sourcepub fn set_ports(&mut self, ports: [bool; 4]) -> Result<()>
pub fn set_ports(&mut self, ports: [bool; 4]) -> Result<()>
Enables / Disables the selected ports
sourcepub fn with_ports(self, ports: [bool; 4]) -> Result<Self>
pub fn with_ports(self, ports: [bool; 4]) -> Result<Self>
Enables / Disables the selected ports
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 copy 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 more