Skip to main content

Module i2c

Module i2c 

Source
Expand description

The internal I²C bus (GPIO8/9), shared by the TCA8418 keyboard scanner, ES8311 codec and BMI270 IMU.

The bus lives in a static behind an async mutex, created once per boot by SysI2cResources::into_bus. Each driver gets its own SysI2cDevice handle and locks the bus only for the length of one transaction, so tasks on the same executor can use different chips concurrently. Code that didn’t create the bus can find it with bus.

Structs§

SysI2cResources
I²C0 on GPIO8 (SDA) / GPIO9 (SCL).

Constants§

FREQUENCY
Bus clock. All three on-board chips support Fast-mode (400 kHz).

Functions§

bus
The shared bus, if SysI2cResources::into_bus has been called.
device
A new device handle on the shared bus.

Type Aliases§

SysI2cBus
The shared bus.
SysI2cDevice
A handle to one device on the shared bus; implements embedded_hal_async::i2c::I2c.