https://github.com/quartiq/tca9539
TCA9539/PCA9539 16-bit I/O expander with I2C interface
https://github.com/quartiq/tca9539
Last synced: 3 months ago
JSON representation
TCA9539/PCA9539 16-bit I/O expander with I2C interface
- Host: GitHub
- URL: https://github.com/quartiq/tca9539
- Owner: quartiq
- License: mit
- Created: 2023-06-30T14:51:00.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-05T20:31:23.000Z (about 1 year ago)
- Last Synced: 2025-02-16T19:01:50.546Z (3 months ago)
- Language: Rust
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `tca9539`
This crate is a `no_std` driver for the
[TCA9539](https://www.ti.com/product/TCA9539) and
[PCA9539](https://www.nxp.com/docs/en/data-sheet/PCA9539_PCA9539R.pdf)
16-Bit/8-Bit I2C I/O Expanders.[](https://github.com/quartiq/tca9539/actions?query=workflow%3Aci)
[](https://crates.io/crates/tca9539)
[](https://docs.rs/tca9539)## Basic usage
Include this [library](https://crates.io/crates/tca9539) as a dependency in your `Cargo.toml`:
```rust
[dependencies]
tca9539 = "0.1"
```Use [embedded-hal](https://github.com/rust-embedded/embedded-hal) implementation to get I2C handle and then create chip handle:
```rust
use tca9539::*;let pin = Pin::P13;
let mut u = Tca9539::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](https://docs.rs/tca9539)
Minimum supported Rust version (MSRV) is 1.62.0.
## License
[MIT license](http://opensource.org/licenses/MIT)