| Crates.io | i2c-tiny-usb |
| lib.rs | i2c-tiny-usb |
| version | 0.1.0 |
| created_at | 2025-03-04 10:34:38.712274+00 |
| updated_at | 2025-03-04 10:34:38.712274+00 |
| description | Library for communicating with USB-to-I2C adapters supporting the i2c-tiny-usb protocol |
| homepage | https://github.com/tdudziak/i2c-tiny-usb-rs |
| repository | https://github.com/tdudziak/i2c-tiny-usb-rs |
| max_upload_size | |
| id | 1577073 |
| size | 48,601 |
A Rust library for communicating with USB-to-I2C adapters from userspace using libusb via the
rusb crate. The library is compatible with a variety of USB adapters supported by the
i2c-tiny-usb Linux kernel driver.
The library implements traits from the i2c crate so it can be used
as a drop-in replacement for i2c-linux on non-Linux platforms if no other implementation is
available.
You can find some example programs using the library in the examples/ directory. Most of them
require some kind of extra hardware to be present on the I2C bus which is described in the top level
comment of each example.
dump-eeprom.rs: Dumps content from an I2C EEPROMi2cdetect.rs: Scans for devices on the I2C bussht35.rs: Reads temperature and humidity from an SHT35 sensorBasic testcases can be simply run with cargo test but other tests require a pysical setup with an
i2c-tiny-usb device present and an EEPROM chip connected to the I2C bus. Check the top level
comment of hw_tests.rs for more details.
Run the hardware tests with:
cargo test --features hw-tests