Trait I2cBusMapping

Source
pub trait I2cBusMapping<SDA, SCL> {
    type Error;
    type Bus: I2cRead<Error = Self::Error> + I2cWrite<Error = Self::Error>;

    // Required method
    fn poll_initialize(
        self: Pin<&mut Self>,
        cx: &mut Context<'_>,
        sda: &mut SDA,
        scl: &mut SCL,
    ) -> Poll<Result<Self::Bus, Self::Error>>
       where Self: Sized;
}
Expand description

Defines a mapping for two GPIO pins that can be used to create an I²C bus.

Required Associated Types§

Source

type Error

The common error type for I²C operations.

A single error type for all operations is enforced for simplicity.

Source

type Bus: I2cRead<Error = Self::Error> + I2cWrite<Error = Self::Error>

The I²C bus that will be produced once initialization based off of this mapping succeeds.

Required Methods§

Source

fn poll_initialize( self: Pin<&mut Self>, cx: &mut Context<'_>, sda: &mut SDA, scl: &mut SCL, ) -> Poll<Result<Self::Bus, Self::Error>>
where Self: Sized,

Polls the initialization operation to completion.

Implementors§