[][src]Struct xca9548a::Xca9543a

pub struct Xca9543a<I2C> { /* fields omitted */ }

Device driver for T/PCA9543A

Implementations

impl<I2C> Xca9543a<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) -> Parts2<'a, Xca9543a<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> Xca9543a<I2C> where
    I2C: Read<Error = E>, 
[src]

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, bit 1 to channel 1 and so on. A 0 means the channel is disabled and a 1 that the channel is enabled.

pub fn get_interrupt_status(&mut self) -> Result<u8, Error<E>>[src]

Get status of channel interrupts.

Each bit corresponds to a channel. Bit 0 corresponds to channel 0, bit 1 to channel 1 and so on. A 1 means the channel's interrupt is high and a 0 that the channel's interrupt is low. Note: I2C interrupts are usually active LOW!

impl<I2C, E> Xca9543a<I2C> where
    I2C: Write<Error = E>, 
[src]

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, bit 1 to channel 1 and so on. A 0 disables the channel and a 1 enables it. Several channels can be enabled at the same time.

Channels/bits that does not exist for the specific device are ignored.

Trait Implementations

impl<I2C: Debug> Debug for Xca9543a<I2C>[src]

impl<I2C: Default> Default for Xca9543a<I2C>[src]

impl<I2C, E> Read for Xca9543a<I2C> where
    I2C: Read<Error = E>, 
[src]

type Error = Error<E>

Error type

impl<I2C, E> Write for Xca9543a<I2C> where
    I2C: Write<Error = E>, 
[src]

type Error = Error<E>

Error type

impl<I2C, E> WriteRead for Xca9543a<I2C> where
    I2C: WriteRead<Error = E>, 
[src]

type Error = Error<E>

Error type

Auto Trait Implementations

impl<I2C> !RefUnwindSafe for Xca9543a<I2C>

impl<I2C> Send for Xca9543a<I2C> where
    I2C: Send

impl<I2C> !Sync for Xca9543a<I2C>

impl<I2C> Unpin for Xca9543a<I2C> where
    I2C: Unpin

impl<I2C> UnwindSafe for Xca9543a<I2C> where
    I2C: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.