mcp230xx

Crates.iomcp230xx
lib.rsmcp230xx
version1.0.1
sourcesrc
created_at2022-08-05 14:55:16.557786
updated_at2024-05-05 20:32:24.350825
descriptionMCP23008/MCP23017 8/16-Bit I2C I/O Expander with I2C Interface
homepage
repositoryhttps://github.com/quartiq/mcp230xx
max_upload_size
id639409
size14,409
Robert Jördens (jordens)

documentation

README

mcp230xx

This crate is a no_std driver for the MCP23017 and MCP23008 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]
mcp230xx = "0.1"

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

use mcp230xx::*;

let pin = Mcp23017::A0;
let mut u = Mcp230xx<I2C, Mcp23017>::default(i2c).unwrap();
u.set_direction(pin, Direction::Output).unwrap();
u.set_gpio(pin, Level::High).unwrap();
assert!(u.gpio(pin).unwrap());

Hardware address pins

Address table

Documentation

API Docs available on docs.rs

Thise crate has evolved from mcp23017.

Minimum supported Rust version (MSRV) is 1.62.0.

License

MIT license

Commit count: 55

cargo fmt