Implement mpr121 touch sensor capability to GPIO Expanders #192
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an updated PR cleanly against the v4.3 branch, as #190 was raised against the wrong branch.
Commit 396e754 from #190 could be cherry picked for a REAME.md update (as the v4.3 README.md isn't a small update to match)
This pull request adds an I2C based MP121 chip as a GPIO Expander. This chip provides 12 capacitive touch sensing pins, which are implemented here as inputs suitable for buttons.
The chip also can alternatively provide 8 GPIOs if correctly configured - this pull request does not implement this functionality (there seem to be more cost effective i2c GPIO expanders).
To use, set the
gpio_exp_config
nvs parameter tomodel=mpr121,addr=90,count=12,intr=<n>
(assuming on default i2c address). GPIOs 40-51 can then be used asBUTTON_HIGH
buttons.The chip init parameters have been taken from those used by https://github.com/BareConductive/mpr121 with touch and release thresholds used by the SimpleTouch example there. Those values work for me.