Function scan_init_sequence

Source
pub fn scan_init_sequence<I2C, L>(
    i2c: &mut I2C,
    logger: &mut L,
    init_sequence: &[u8],
)
where I2C: I2c, L: Logger,
Expand description

Scan the I2C bus by testing each command in an initialization sequence.

ยงArguments

  • i2c - Mutable reference to the I2C interface implementing embedded_hal::i2c::I2c.
  • logger - Mutable reference to a logger implementing the Logger trait.
  • init_sequence - Byte slice of initialization commands to test.

This function tries to send each command in init_sequence with a control byte (0x00) to all possible device addresses, logging which addresses respond to which commands. It also logs differences between expected and responding commands.