#i2c #io #hal #pca9539

no-std tca9539

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

2 unstable releases

0.2.0 Jun 30, 2023
0.1.0 Jun 30, 2023

#780 in Embedded development

Download history 41/week @ 2024-01-10 94/week @ 2024-01-17 100/week @ 2024-01-24 54/week @ 2024-01-31 80/week @ 2024-02-07 71/week @ 2024-02-14 86/week @ 2024-02-21 125/week @ 2024-02-28 128/week @ 2024-03-06 59/week @ 2024-03-13 136/week @ 2024-03-20 198/week @ 2024-03-27

534 downloads per month

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

~1.5MB
~35K SLoC