Expand description
§MPR121-Hal
This crate follows the Adafruit implementation closely but exposes it in terms of the embedded-hal project.
The main responsibility of this crate is returning the current on/off state of all the (up to) 12 pins.
The chip’s data sheet can be found here. The implementation however mostly mirrors the Adafruit implementation, since this is probably the most widely used one.
When working with this crate you can either use it in Synchronous/Blocking mode with the embedded-hal or in Asynchronous mode with the embedded-hal-async.
This can be done by using the features sync and async. This crate does not pull in the std library and thus is fully no-std.
For MCU scale devices Embassy is a valid framework to use the async feature or Tokio when using Linux/MacOS based devices.
Modules§
Enums§
- Channel
- This enum represents the channels of the sensor and is used to get the corresponding touch values
- Debounce
Number - This enum represents the number of debounces see section 5.7 in the MPR121 Data Sheet
- Mpr121
Address - The four values the sensor can be addressed as. Note that the address of the device is determined by
where the
ADDRpin is connected to. Default is used if no connection, or a connection toVSSis made. - Mpr121
Error - The MPR121 Device has an Enumeration of potential driver errors, which are held in the enum below