#i2c #sm-bus #no-std

no-std smbus-adapter

Provides smbus standardized transfers to i2c devices

2 releases

0.1.1 Jan 18, 2024
0.1.0 Jan 18, 2024

#1934 in Embedded development

39 downloads per month

MIT/Apache

7KB
136 lines

I2c to Smbus Adapter

Smbus is mostly compatable with i2c. This tiny crate does not attempt to address differences such as transfer timeouts, the alert line, or error checking. It simply provides helper functions for the smbus standardized transfers.

Note that the smbus spec only allows 100kHz clock speed. If operating a mixed i2c and smbus bus, and you need to communicate with the i2c devices at more than 100kHz, I recomend using the I2cDeviceWithConfig struct provided by embassy-embedded-hal.

The SmbusAdapter struct accepts anything that impls the I2c trait. It also impls the I2c trait on itself, for devices that use both standard Smbus commands and direct register access.

Currently, only async operation is supported.

Dependencies

~550KB
~10K SLoC