Crates.io | tca9539 |
lib.rs | tca9539 |
version | 0.2.1 |
source | src |
created_at | 2023-06-30 14:52:36.509628 |
updated_at | 2024-05-05 20:31:19.015026 |
description | TCA9539 (also PCA9539) 16-Bit I2C I/O Expander with I2C Interface |
homepage | |
repository | https://github.com/quartiq/tca9539 |
max_upload_size | |
id | 904645 |
size | 6,997 |
tca9539
This crate is a no_std
driver for the
TCA9539 and
PCA9539
16-Bit/8-Bit I2C I/O Expanders.
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());
API Docs available on docs.rs
Minimum supported Rust version (MSRV) is 1.62.0.