Skip to content

SiebenCorgie/mpr121-hal

Repository files navigation

MPR121-hal

crates.io

docs.rs MegaLinter Continuous Build

dependency status

Mpr121 proximity capacitive touch sensor controller driver. Used for instance on the Adafruit Mpr121 module.

Overview

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.

Examples

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:

MacOS

brew install libusb
brew install libftdi

Linux

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.

Development

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.

License

Licensed under either of

at your option.

Contributing

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.

About

A mpr121 Rust implementation for the embedded-hal family.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages