From 367c73b834134e4d26cd90cdea3d5a78717ac139 Mon Sep 17 00:00:00 2001 From: nopnop2002 Date: Sun, 10 Sep 2023 20:08:40 +0900 Subject: [PATCH] Changed default GPIO --- README.md | 11 ++++++----- main/Kconfig.projbuild | 17 +++++++++-------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 6a78b78..5b46445 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,9 @@ MPR121 Capacitive Touch Driver for esp-idf. I ported from [here](https://github.com/BareConductive/mpr121). # Software requirements -ESP-IDF V4.4/V5.0. +ESP-IDF V4.4/V5.x. ESP-IDF V5.0 is required when using ESP32-C2. +ESP-IDF V5.1 is required when using ESP32-C6. # Hardware requirements MPR121 Capacitive Touch switch. @@ -32,11 +33,11 @@ idf.py flash # Wirering -|MPR121||ESP32|ESP32-S2/S3|ESP32-C2/C3| +|MPR121||ESP32|ESP32-S2/S3|ESP32-C2/C3/C6| |:-:|:-:|:-:|:-:|:-:| -|SCL|--|GPIO4|GPIO16|GPIO6| -|SDA|--|GPIO5|GPIO17|GPIO7| -|IRQ|--|GPIO15|GPIO18|GPIO8| +|SCL|--|GPIO22|GPIO12|GPIO6| +|SDA|--|GPIO21|GPIO11|GPIO5| +|IRQ|--|GPIO15|GPIO18|GPIO4| |GND|--|GND|GND|GND| |VCC|--|3.3V|3.3V|3.3V| diff --git a/main/Kconfig.projbuild b/main/Kconfig.projbuild index 01151c5..285214a 100644 --- a/main/Kconfig.projbuild +++ b/main/Kconfig.projbuild @@ -7,6 +7,7 @@ menu "MPR121 Configuration" default 48 if IDF_TARGET_ESP32S3 default 18 if IDF_TARGET_ESP32C2 default 19 if IDF_TARGET_ESP32C3 + default 30 if IDF_TARGET_ESP32C6 config I2C_ADDRESS hex "I2C address" @@ -17,9 +18,9 @@ menu "MPR121 Configuration" config SCL_GPIO int "SCL GPIO number" range 0 GPIO_RANGE_MAX - default 16 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 - default 6 if IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C2 - default 4 + default 22 if IDF_TARGET_ESP32 + default 12 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 + default 6 # C3 and others help GPIO number (IOxx) to SCL. Some GPIOs are used for other purposes (flash connections, etc.) and cannot be used to blink. @@ -27,9 +28,9 @@ menu "MPR121 Configuration" config SDA_GPIO int "SDA GPIO number" range 0 GPIO_RANGE_MAX - default 17 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 - default 7 if IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C2 - default 5 + default 21 if IDF_TARGET_ESP32 + default 11 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 + default 5 # C3 and others help GPIO number (IOxx) to SDA. Some GPIOs are used for other purposes (flash connections, etc.) and cannot be used to blink. @@ -37,9 +38,9 @@ menu "MPR121 Configuration" config IRQ_GPIO int "IRQ GPIO number" range 0 GPIO_RANGE_MAX + default 15 if IDF_TARGET_ESP32 default 18 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 - default 8 if IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C2 - default 15 + default 4 # C3 and others help GPIO number (IOxx) to IRQ. Some GPIOs are used for other purposes (flash connections, etc.) and cannot be used to blink.