STMPE1600 I/O Expander Rust Driver
This is a platform-agnostic Rust driver for the STMPE1600 I/O expander.
This driver can:
- Setup the pins as input, output or interrupt pins.
- Get the state of all the pins at once.
- Set the state of all the pins at once.
- Have an interrupt callback which is triggered on interrupt.
Interrupts
The STMPE1600 handles interrupts by triggering an interrupt output pin when it detects an interrupt on any of its configured interrupt pins. The active LOW interrupt pin needs to be handled by the microcontroller itself, and then call the handle_interrupt
function to check the STMPE1600 for any pending interrupts, execute the relevent callbacks and clear the pending bits.
Usage
use I2cdev;
use ;
To-Do
- Add interrupt polarity
- Create a way to access each of the pins individually
- Implement [
embedded_hal
] InputPin and OutputPin traits
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be dual licensed as above, without any additional terms or conditions.