mirror of
https://github.com/nopnop2002/esp-idf-mpr121.git
synced 2025-12-17 01:44:30 +03:00
Added support for ESP32C2
This commit is contained in:
12
README.md
12
README.md
@@ -3,22 +3,22 @@ MPR121 Capacitive Touch Driver for esp-idf.
|
|||||||
|
|
||||||
I ported from [here](https://github.com/BareConductive/mpr121).
|
I ported from [here](https://github.com/BareConductive/mpr121).
|
||||||
|
|
||||||
|
# Software requirements
|
||||||
|
ESP-IDF V4.4/V5.0.
|
||||||
|
ESP-IDF V5 is required when using ESP32-C2.
|
||||||
|
|
||||||
# Hardware requirements
|
# Hardware requirements
|
||||||
MPR121 Capacitive Touch switch.
|
MPR121 Capacitive Touch switch.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
# Software requirements
|
|
||||||
esp-idf v4.4 or later.
|
|
||||||
This is because this version supports ESP32-C3.
|
|
||||||
|
|
||||||
# Installation
|
# Installation
|
||||||
|
|
||||||
```Shell
|
```Shell
|
||||||
git clone https://github.com/nopnop2002/esp-idf-mpr121
|
git clone https://github.com/nopnop2002/esp-idf-mpr121
|
||||||
cd esp-idf-mpr121
|
cd esp-idf-mpr121
|
||||||
idf.py set-target {esp32/esp32s2/esp32s3/esp32c3}
|
idf.py set-target {esp32/esp32s2/esp32s3/esp32c2/esp32c3}
|
||||||
idf.py menuconfig
|
idf.py menuconfig
|
||||||
idf.py flash
|
idf.py flash
|
||||||
```
|
```
|
||||||
@@ -32,7 +32,7 @@ idf.py flash
|
|||||||
|
|
||||||
# Wirering
|
# Wirering
|
||||||
|
|
||||||
|MPR121||ESP32|ESP32-S2/S3|ESP32-C3|
|
|MPR121||ESP32|ESP32-S2/S3|ESP32-C2/C3|
|
||||||
|:-:|:-:|:-:|:-:|:-:|
|
|:-:|:-:|:-:|:-:|:-:|
|
||||||
|SCL|--|GPIO4|GPIO16|GPIO6|
|
|SCL|--|GPIO4|GPIO16|GPIO6|
|
||||||
|SDA|--|GPIO5|GPIO17|GPIO7|
|
|SDA|--|GPIO5|GPIO17|GPIO7|
|
||||||
|
|||||||
@@ -4,8 +4,9 @@ menu "MPR121 Configuration"
|
|||||||
int
|
int
|
||||||
default 33 if IDF_TARGET_ESP32
|
default 33 if IDF_TARGET_ESP32
|
||||||
default 46 if IDF_TARGET_ESP32S2
|
default 46 if IDF_TARGET_ESP32S2
|
||||||
default 19 if IDF_TARGET_ESP32C3
|
|
||||||
default 48 if IDF_TARGET_ESP32S3
|
default 48 if IDF_TARGET_ESP32S3
|
||||||
|
default 18 if IDF_TARGET_ESP32C2
|
||||||
|
default 19 if IDF_TARGET_ESP32C3
|
||||||
|
|
||||||
config I2C_ADDRESS
|
config I2C_ADDRESS
|
||||||
hex "I2C address"
|
hex "I2C address"
|
||||||
@@ -16,8 +17,8 @@ menu "MPR121 Configuration"
|
|||||||
config SCL_GPIO
|
config SCL_GPIO
|
||||||
int "SCL GPIO number"
|
int "SCL GPIO number"
|
||||||
range 0 GPIO_RANGE_MAX
|
range 0 GPIO_RANGE_MAX
|
||||||
default 6 if IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32H2
|
|
||||||
default 16 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3
|
default 16 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3
|
||||||
|
default 6 if IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C2
|
||||||
default 4
|
default 4
|
||||||
help
|
help
|
||||||
GPIO number (IOxx) to SCL.
|
GPIO number (IOxx) to SCL.
|
||||||
@@ -26,8 +27,8 @@ menu "MPR121 Configuration"
|
|||||||
config SDA_GPIO
|
config SDA_GPIO
|
||||||
int "SDA GPIO number"
|
int "SDA GPIO number"
|
||||||
range 0 GPIO_RANGE_MAX
|
range 0 GPIO_RANGE_MAX
|
||||||
default 7 if IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32H2
|
|
||||||
default 17 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3
|
default 17 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3
|
||||||
|
default 7 if IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C2
|
||||||
default 5
|
default 5
|
||||||
help
|
help
|
||||||
GPIO number (IOxx) to SDA.
|
GPIO number (IOxx) to SDA.
|
||||||
@@ -36,8 +37,8 @@ menu "MPR121 Configuration"
|
|||||||
config IRQ_GPIO
|
config IRQ_GPIO
|
||||||
int "IRQ GPIO number"
|
int "IRQ GPIO number"
|
||||||
range 0 GPIO_RANGE_MAX
|
range 0 GPIO_RANGE_MAX
|
||||||
default 8 if IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32H2
|
|
||||||
default 18 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3
|
default 18 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3
|
||||||
|
default 8 if IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C2
|
||||||
default 15
|
default 15
|
||||||
help
|
help
|
||||||
GPIO number (IOxx) to IRQ.
|
GPIO number (IOxx) to IRQ.
|
||||||
|
|||||||
Reference in New Issue
Block a user