#i2c #embedded-hal-i2c #io #i2c-driver #hal #no-std-driver #pca9539

no-std tca9539

TCA9539 (also PCA9539) 16-Bit I2C I/O Expander with I2C Interface

3 unstable releases

0.2.1 May 5, 2024
0.2.0 Jun 30, 2023
0.1.0 Jun 30, 2023

#1929 in Embedded development

Download history 194/week @ 2024-08-26 86/week @ 2024-09-02 108/week @ 2024-09-09 65/week @ 2024-09-16 121/week @ 2024-09-23 110/week @ 2024-09-30 109/week @ 2024-10-07 92/week @ 2024-10-14 98/week @ 2024-10-21 57/week @ 2024-10-28 77/week @ 2024-11-04 89/week @ 2024-11-11 100/week @ 2024-11-18 188/week @ 2024-11-25 114/week @ 2024-12-02 146/week @ 2024-12-09

557 downloads per month
Used in stabilizer

MIT license

6KB
93 lines

tca9539

This crate is a no_std driver for the TCA9539 and PCA9539 16-Bit/8-Bit I2C I/O Expanders.

Build Status crates.io Docs

Basic usage

Include this library as a dependency in your Cargo.toml:

[dependencies]
tca9539 = "0.1"

Use embedded-hal implementation to get I2C handle and then create chip handle:

use tca9539::*;

let pin = Pin::P13;
let mut u = Tca9539<I2C>::default(i2c).unwrap();
u.set_direction(pin, Direction::Output).unwrap();
u.set_level(pin, Level::High).unwrap();
assert!(u.gpio(pin).unwrap());

Documentation

API Docs available on docs.rs

Minimum supported Rust version (MSRV) is 1.62.0.

License

MIT license

Dependencies

~0.4–0.8MB
~18K SLoC