#i2c #io #hal #mcp23017 #mcp23008

no-std mcp230xx

MCP23008/MCP23017 8/16-Bit I2C I/O Expander with I2C Interface

4 releases (stable)

1.0.2 Jan 9, 2026
1.0.1 May 5, 2024
1.0.0 Mar 23, 2023
0.1.0 Aug 5, 2022

#2252 in Embedded development

Download history 39/week @ 2026-01-22 40/week @ 2026-01-29 87/week @ 2026-02-05 66/week @ 2026-02-12 24/week @ 2026-02-19 26/week @ 2026-02-26 29/week @ 2026-03-05 77/week @ 2026-03-12 33/week @ 2026-03-19 53/week @ 2026-03-26 80/week @ 2026-04-02 45/week @ 2026-04-09 33/week @ 2026-04-16 29/week @ 2026-04-23 25/week @ 2026-04-30 24/week @ 2026-05-07

116 downloads per month
Used in 3 crates

MIT license

12KB
217 lines

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

Dependencies

~225–590KB
~13K SLoC