[−][src]Struct xca9548a::Xca9548a
Device driver for T/PCA9548A
Implementations
impl<I2C> Xca9548a<I2C>
[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 split<'a>(&'a self) -> Parts<'a, Xca9548a<I2C>, I2C>
[src]
Split device into individual I2C devices
It is not possible to know the compatibilities between channels so when talking to a split I2C device, only its channel will be selected.
impl<I2C, E> Xca9548a<I2C> where
I2C: Read<Error = E>,
[src]
I2C: Read<Error = E>,
pub fn get_channel_status(&mut self) -> Result<u8, Error<E>>
[src]
Get status of channels.
Each bit corresponds to a channel.
Bit 0 corresponds to channel 0 and so on up to bit 7 which
corresponds to channel 7.
A 0
means the channel is disabled and a 1
that the channel is enabled.
impl<I2C, E> Xca9548a<I2C> where
I2C: Write<Error = E>,
[src]
I2C: Write<Error = E>,
pub fn select_channels(&mut self, channels: u8) -> Result<(), Error<E>>
[src]
Select which channels are enabled.
Each bit corresponds to a channel.
Bit 0 corresponds to channel 0 and so on up to bit 7 which
corresponds to channel 7.
A 0
disables the channel and a 1
enables it.
Several channels can be enabled at the same time
Trait Implementations
impl<I2C: Debug> Debug for Xca9548a<I2C>
[src]
impl<I2C: Default> Default for Xca9548a<I2C>
[src]
impl<I2C, E> Read for Xca9548a<I2C> where
I2C: Read<Error = E>,
[src]
I2C: Read<Error = E>,
type Error = Error<E>
Error type
fn read(&mut self, address: u8, buffer: &mut [u8]) -> Result<(), Self::Error>
[src]
impl<I2C, E> Write for Xca9548a<I2C> where
I2C: Write<Error = E>,
[src]
I2C: Write<Error = E>,
type Error = Error<E>
Error type
fn write(&mut self, address: u8, bytes: &[u8]) -> Result<(), Self::Error>
[src]
impl<I2C, E> WriteRead for Xca9548a<I2C> where
I2C: WriteRead<Error = E>,
[src]
I2C: WriteRead<Error = E>,
Auto Trait Implementations
impl<I2C> !RefUnwindSafe for Xca9548a<I2C>
impl<I2C> Send for Xca9548a<I2C> where
I2C: Send,
I2C: Send,
impl<I2C> !Sync for Xca9548a<I2C>
impl<I2C> Unpin for Xca9548a<I2C> where
I2C: Unpin,
I2C: Unpin,
impl<I2C> UnwindSafe for Xca9548a<I2C> where
I2C: UnwindSafe,
I2C: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,