Mpr121 proximity capacitive touch sensor controller driver. Used for instance on the Adafruit Mpr121 module.
The crate uses the embeded-hal crate to provided a generic implementation for multiple HALs alongside embedded-hal-async for async support.
It uses maybe-async to provide a single API for both sync and async implementations.
Simply use either the sync
or async
feature to enable the desired implementation.
If both features are enabled cargo will fail to compile the project.
The implementation provides a similar API to the C++ Adafruit library. It should work with similar boards using the Mpr121 as well.
Within the examples directory there is an ESP32S3 example using the MPR121 Adafruit Breakout Board and the Embassy Framework that runs in complete Async.
There is a Simple Sync Script that runs on Mac/Linux using a FTD232H I2C Adapter that uses the library in Synchronous mode. You may need to Install the following sys dependencies to run the sync example. You do not need any sys dependencies for the esp32 example or to use the driver on any other platform:
brew install libusb
brew install libftdi
sudo apt update
sudo apt install libftdi1 libftdi1-dev
Then to run the example do the following:
cargo run --example os_sync_basic --no-default-features --features sync
More information on this can be found here.
If you want to extend this crate, have a look at the development notes on how to get started with testing and linting the project.
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.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.