Merge branch 'feature/esp32h2_gpio_support' into 'master'

gpio: Add support for esp32h2

Closes IDF-6227, IDF-6388, IDF-6403, and IDF-6676

See merge request espressif/esp-idf!21986
This commit is contained in:
Song Ruo Jing
2023-01-18 16:24:13 +08:00
26 changed files with 557 additions and 299 deletions

View File

@@ -23,10 +23,10 @@ This test code shows how to configure GPIO and how to use it with interruption.
**Note:** The following pin assignments are used by default, you can change them by `idf.py menuconfig` > `Example Configuration`.
| | CONFIG_GPIO_OUTPUT_0 | CONFIG_GPIO_OUTPUT_1 | CONFIG_GPIO_INPUT_0 | CONFIG_GPIO_INPUT_1 |
| --------------- | -------------------- | -------------------- | ------------------- | ------------------- |
| ESP32-C2/ESP32H4| 8 | 9 | 4 | 5 |
| All other chips | 18 | 19 | 4 | 5 |
| | CONFIG_GPIO_OUTPUT_0 | CONFIG_GPIO_OUTPUT_1 | CONFIG_GPIO_INPUT_0 | CONFIG_GPIO_INPUT_1 |
| ---------------------- | -------------------- | -------------------- | ------------------- | ------------------- |
| ESP32C2/ESP32H2/ESP32H4| 8 | 9 | 4 | 5 |
| All other chips | 18 | 19 | 4 | 5 |
## How to use example

View File

@@ -5,7 +5,7 @@ menu "Example Configuration"
config GPIO_OUTPUT_0
int "GPIO output pin 0"
range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX
default 8 if IDF_TARGET_ESP32C2 || IDF_TARGET_ESP32H4
default 8 if IDF_TARGET_ESP32C2 || IDF_TARGET_ESP32H4 || IDF_TARGET_ESP32H2
default 18
help
GPIO pin number to be used as GPIO_OUTPUT_IO_0.
@@ -13,7 +13,7 @@ menu "Example Configuration"
config GPIO_OUTPUT_1
int "GPIO output pin 1"
range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX
default 9 if IDF_TARGET_ESP32C2 || IDF_TARGET_ESP32H4
default 9 if IDF_TARGET_ESP32C2 || IDF_TARGET_ESP32H4 || IDF_TARGET_ESP32H2
default 19
help
GPIO pin number to be used as GPIO_OUTPUT_IO_1.

View File

@@ -20,8 +20,8 @@
* This test code shows how to configure gpio and how to use gpio interrupt.
*
* GPIO status:
* GPIO18: output (ESP32C2/ESP32H4 uses GPIO8 as the second output pin)
* GPIO19: output (ESP32C2/ESP32H4 uses GPIO9 as the second output pin)
* GPIO18: output (ESP32C2/ESP32H2/ESP32H4 uses GPIO8 as the second output pin)
* GPIO19: output (ESP32C2/ESP32H2/ESP32H4 uses GPIO9 as the second output pin)
* GPIO4: input, pulled up, interrupt from rising edge and falling edge
* GPIO5: input, pulled up, interrupt from rising edge.
*