[][src]Trait embedded_platform::i2c::I2cBusMapping

pub trait I2cBusMapping<SDA, SCL> {
    type Error;
    type Bus: I2cRead<Error = Self::Error> + I2cWrite<Error = Self::Error>;
    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
; }

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

Associated Types

type Error

The common error type for I²C operations.

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

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.

Loading content...

Required methods

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.

Loading content...

Implementors

Loading content...