From 1a20b10fd345c90a1731fb0761731791ef309827 Mon Sep 17 00:00:00 2001 From: Ondrej Kosta Date: Wed, 20 Apr 2022 11:02:26 +0200 Subject: [PATCH] Examples: common source for GPIO range in Kconfigs defined --- examples/common_components/env_caps/README.md | 19 ++++++++++ .../env_caps/esp32/Kconfig.env_caps | 15 ++++++++ .../env_caps/esp32c2/Kconfig.env_caps | 15 ++++++++ .../env_caps/esp32c3/Kconfig.env_caps | 16 +++++++++ .../env_caps/esp32h2/Kconfig.env_caps | 15 ++++++++ .../env_caps/esp32s2/Kconfig.env_caps | 15 ++++++++ .../env_caps/esp32s3/Kconfig.env_caps | 15 ++++++++ .../Kconfig.projbuild | 27 +++++--------- examples/ethernet/README.md | 15 +++++++- .../ethernet/basic/main/Kconfig.projbuild | 35 +++++++------------ .../ethernet/enc28j60/main/Kconfig.projbuild | 21 ++++------- .../ethernet/eth2ap/main/Kconfig.projbuild | 27 +++++--------- .../ethernet/iperf/main/Kconfig.projbuild | 27 +++++--------- .../get-started/blink/main/Kconfig.projbuild | 4 ++- .../simple_sniffer/main/Kconfig.projbuild | 27 +++++--------- .../gpio/generic_gpio/main/Kconfig.projbuild | 6 ++++ .../main/Kconfig.projbuild | 4 +++ .../twai_self_test/main/Kconfig.projbuild | 4 +++ .../nmea0183_parser/main/Kconfig.projbuild | 9 ++--- .../uart/uart_echo/main/Kconfig.projbuild | 16 +++------ .../uart_echo_rs485/main/Kconfig.projbuild | 23 +++--------- .../protocols/mdns/main/Kconfig.projbuild | 9 ++--- .../serial/mb_master/main/Kconfig.projbuild | 17 +++------ .../serial/mb_slave/main/Kconfig.projbuild | 17 +++------ examples/system/gcov/main/Kconfig.projbuild | 4 ++- .../native_ota_example/main/Kconfig.projbuild | 4 ++- 26 files changed, 226 insertions(+), 180 deletions(-) create mode 100644 examples/common_components/env_caps/README.md create mode 100644 examples/common_components/env_caps/esp32/Kconfig.env_caps create mode 100644 examples/common_components/env_caps/esp32c2/Kconfig.env_caps create mode 100644 examples/common_components/env_caps/esp32c3/Kconfig.env_caps create mode 100644 examples/common_components/env_caps/esp32h2/Kconfig.env_caps create mode 100644 examples/common_components/env_caps/esp32s2/Kconfig.env_caps create mode 100644 examples/common_components/env_caps/esp32s3/Kconfig.env_caps diff --git a/examples/common_components/env_caps/README.md b/examples/common_components/env_caps/README.md new file mode 100644 index 0000000000..43f64174b8 --- /dev/null +++ b/examples/common_components/env_caps/README.md @@ -0,0 +1,19 @@ +# Examples Environmental Capabilities + +Examples environmental related capabilities files are describing the attributes which may be considered common among example projects. + +It may include but it is not limited to the following: + +- SoC features like maximum/minimum values, available resources, etc. which are not captured in associated ``soc_caps.h`` and there is some reason they cannot be added to ``soc_caps.h``. For example, feature definition is not generic enough and is more related to examples use case or it is just some kind of approximation which is good enough for examples but not for SoC drivers. +- Various system configuration. +- Espressif's official development boards features. + +## How to use + +- Update the **Environmental Capabilities ``Kcofig``** with capabilities you consider could be shared among other example projects. + +- Use ``orsource`` statement in **your example project ``Kconfig``** to include the Environmental Capabilities as shown below. + +``` +orsource "$IDF_PATH/examples/common_components/env_caps/$IDF_TARGET/Kconfig.env_caps" +``` diff --git a/examples/common_components/env_caps/esp32/Kconfig.env_caps b/examples/common_components/env_caps/esp32/Kconfig.env_caps new file mode 100644 index 0000000000..6aaa51a712 --- /dev/null +++ b/examples/common_components/env_caps/esp32/Kconfig.env_caps @@ -0,0 +1,15 @@ +config ENV_GPIO_RANGE_MIN + int + default 0 + +config ENV_GPIO_RANGE_MAX + int + default 39 + +config ENV_GPIO_IN_RANGE_MAX + int + default ENV_GPIO_RANGE_MAX + +config ENV_GPIO_OUT_RANGE_MAX + int + default 33 diff --git a/examples/common_components/env_caps/esp32c2/Kconfig.env_caps b/examples/common_components/env_caps/esp32c2/Kconfig.env_caps new file mode 100644 index 0000000000..9bc4cb826d --- /dev/null +++ b/examples/common_components/env_caps/esp32c2/Kconfig.env_caps @@ -0,0 +1,15 @@ +config ENV_GPIO_RANGE_MIN + int + default 0 + +config ENV_GPIO_RANGE_MAX + int + default 19 + +config ENV_GPIO_IN_RANGE_MAX + int + default ENV_GPIO_RANGE_MAX + +config ENV_GPIO_OUT_RANGE_MAX + int + default ENV_GPIO_RANGE_MAX diff --git a/examples/common_components/env_caps/esp32c3/Kconfig.env_caps b/examples/common_components/env_caps/esp32c3/Kconfig.env_caps new file mode 100644 index 0000000000..cae3ecadd4 --- /dev/null +++ b/examples/common_components/env_caps/esp32c3/Kconfig.env_caps @@ -0,0 +1,16 @@ +config ENV_GPIO_RANGE_MIN + int + default 0 + +config ENV_GPIO_RANGE_MAX + int + default 19 + # GPIOs 20/21 are always used by UART in examples + +config ENV_GPIO_IN_RANGE_MAX + int + default ENV_GPIO_RANGE_MAX + +config ENV_GPIO_OUT_RANGE_MAX + int + default ENV_GPIO_RANGE_MAX diff --git a/examples/common_components/env_caps/esp32h2/Kconfig.env_caps b/examples/common_components/env_caps/esp32h2/Kconfig.env_caps new file mode 100644 index 0000000000..193652111b --- /dev/null +++ b/examples/common_components/env_caps/esp32h2/Kconfig.env_caps @@ -0,0 +1,15 @@ +config ENV_GPIO_RANGE_MIN + int + default 0 + +config ENV_GPIO_RANGE_MAX + int + default 25 + +config ENV_GPIO_IN_RANGE_MAX + int + default ENV_GPIO_RANGE_MAX + +config ENV_GPIO_OUT_RANGE_MAX + int + default ENV_GPIO_RANGE_MAX diff --git a/examples/common_components/env_caps/esp32s2/Kconfig.env_caps b/examples/common_components/env_caps/esp32s2/Kconfig.env_caps new file mode 100644 index 0000000000..344a31cda4 --- /dev/null +++ b/examples/common_components/env_caps/esp32s2/Kconfig.env_caps @@ -0,0 +1,15 @@ +config ENV_GPIO_RANGE_MIN + int + default 0 + +config ENV_GPIO_RANGE_MAX + int + default 46 + +config ENV_GPIO_IN_RANGE_MAX + int + default ENV_GPIO_RANGE_MAX + +config ENV_GPIO_OUT_RANGE_MAX + int + default 45 diff --git a/examples/common_components/env_caps/esp32s3/Kconfig.env_caps b/examples/common_components/env_caps/esp32s3/Kconfig.env_caps new file mode 100644 index 0000000000..4378fc1d48 --- /dev/null +++ b/examples/common_components/env_caps/esp32s3/Kconfig.env_caps @@ -0,0 +1,15 @@ +config ENV_GPIO_RANGE_MIN + int + default 0 + +config ENV_GPIO_RANGE_MAX + int + default 48 + +config ENV_GPIO_IN_RANGE_MAX + int + default ENV_GPIO_RANGE_MAX + +config ENV_GPIO_OUT_RANGE_MAX + int + default ENV_GPIO_RANGE_MAX diff --git a/examples/common_components/protocol_examples_common/Kconfig.projbuild b/examples/common_components/protocol_examples_common/Kconfig.projbuild index 867863e48c..86ee4f140c 100644 --- a/examples/common_components/protocol_examples_common/Kconfig.projbuild +++ b/examples/common_components/protocol_examples_common/Kconfig.projbuild @@ -1,15 +1,6 @@ menu "Example Connection Configuration" - config EXAMPLE_GPIO_RANGE_MIN - int - default 0 - - config EXAMPLE_GPIO_RANGE_MAX - int - default 33 if IDF_TARGET_ESP32 - default 46 if IDF_TARGET_ESP32S2 - default 19 if IDF_TARGET_ESP32C3 - default 48 if IDF_TARGET_ESP32S3 + orsource "$IDF_PATH/examples/common_components/env_caps/$IDF_TARGET/Kconfig.env_caps" config EXAMPLE_CONNECT_WIFI bool "connect using WiFi interface" @@ -204,14 +195,14 @@ menu "Example Connection Configuration" config EXAMPLE_ETH_MDC_GPIO int "SMI MDC GPIO number" - range EXAMPLE_GPIO_RANGE_MIN EXAMPLE_GPIO_RANGE_MAX + range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX default 23 help Set the GPIO number used by SMI MDC. config EXAMPLE_ETH_MDIO_GPIO int "SMI MDIO GPIO number" - range EXAMPLE_GPIO_RANGE_MIN EXAMPLE_GPIO_RANGE_MAX + range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX default 18 help Set the GPIO number used by SMI MDIO. @@ -227,28 +218,28 @@ menu "Example Connection Configuration" config EXAMPLE_ETH_SPI_SCLK_GPIO int "SPI SCLK GPIO number" - range EXAMPLE_GPIO_RANGE_MIN EXAMPLE_GPIO_RANGE_MAX + range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX default 14 help Set the GPIO number used by SPI SCLK. config EXAMPLE_ETH_SPI_MOSI_GPIO int "SPI MOSI GPIO number" - range EXAMPLE_GPIO_RANGE_MIN EXAMPLE_GPIO_RANGE_MAX + range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX default 13 help Set the GPIO number used by SPI MOSI. config EXAMPLE_ETH_SPI_MISO_GPIO int "SPI MISO GPIO number" - range EXAMPLE_GPIO_RANGE_MIN EXAMPLE_GPIO_RANGE_MAX + range ENV_GPIO_RANGE_MIN ENV_GPIO_IN_RANGE_MAX default 12 help Set the GPIO number used by SPI MISO. config EXAMPLE_ETH_SPI_CS_GPIO int "SPI CS GPIO number" - range EXAMPLE_GPIO_RANGE_MIN EXAMPLE_GPIO_RANGE_MAX + range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX default 15 help Set the GPIO number used by SPI CS. @@ -262,7 +253,7 @@ menu "Example Connection Configuration" config EXAMPLE_ETH_SPI_INT_GPIO int "Interrupt GPIO number" - range EXAMPLE_GPIO_RANGE_MIN EXAMPLE_GPIO_RANGE_MAX + range ENV_GPIO_RANGE_MIN ENV_GPIO_IN_RANGE_MAX default 4 help Set the GPIO number used by the SPI Ethernet module interrupt line. @@ -270,7 +261,7 @@ menu "Example Connection Configuration" config EXAMPLE_ETH_PHY_RST_GPIO int "PHY Reset GPIO number" - range -1 EXAMPLE_GPIO_RANGE_MAX + range -1 ENV_GPIO_OUT_RANGE_MAX default 5 help Set the GPIO number used to reset PHY chip. diff --git a/examples/ethernet/README.md b/examples/ethernet/README.md index ed6e524a94..a36b1f255b 100644 --- a/examples/ethernet/README.md +++ b/examples/ethernet/README.md @@ -17,6 +17,14 @@ See the [README.md](../README.md) file in the upper level [examples](../) direct | GPIO26 | RX1 | EMAC_RXD1 | | GPIO27 | CRS_DV | EMAC_RX_DRV | +* One of the following GPIO pins can be used as RMII REF_CLK input/output: + +| GPIO | Function | Notes | +| ------ | -------------------- | ------------ | +| GPIO0 | EMAC_TX_CLK/CLK_OUT1 | input/output | +| GPIO16 | EMAC_CLK_OUT | output | +| GPIO17 | EMAC_CLK_180 | output | + * SMI (Serial Management Interface) wiring is not fixed. You may need to changed it according to your board schematic. By default they're connected as follows: | GPIO | SMI Signal | Notes | @@ -39,7 +47,12 @@ See the [README.md](../README.md) file in the upper level [examples](../) direct | GPIO4 | Interrupt | | NC | Reset | -Please consult Espressif Technical reference manual along with datasheet for specific ESP Module you use when assigning any other pins, especially when choosing from system configuration menu for the ethernet examples, some pins cannot be used (they may already be utilized for different purpose like SPI Flash/RAM, etc.). +--- + +**Warning:** +Please consult Espressif Technical reference manual along with datasheet for specific ESP Module you use when assigning any other pins, especially when choosing from system configuration menu for the ethernet examples, some pins cannot be used (they may already be utilized for different purpose like SPI Flash/RAM, some pins might be inputs only, etc.). + +--- ## Common Configurations diff --git a/examples/ethernet/basic/main/Kconfig.projbuild b/examples/ethernet/basic/main/Kconfig.projbuild index 6af423249f..b0c5d1af08 100644 --- a/examples/ethernet/basic/main/Kconfig.projbuild +++ b/examples/ethernet/basic/main/Kconfig.projbuild @@ -1,15 +1,6 @@ menu "Example Configuration" - config EXAMPLE_GPIO_RANGE_MIN - int - default 0 - - config EXAMPLE_GPIO_RANGE_MAX - int - default 33 if IDF_TARGET_ESP32 - default 46 if IDF_TARGET_ESP32S2 - default 19 if IDF_TARGET_ESP32C3 - default 48 if IDF_TARGET_ESP32S3 + orsource "$IDF_PATH/examples/common_components/env_caps/$IDF_TARGET/Kconfig.env_caps" config EXAMPLE_USE_INTERNAL_ETHERNET depends on IDF_TARGET_ESP32 @@ -68,21 +59,21 @@ menu "Example Configuration" config EXAMPLE_ETH_MDC_GPIO int "SMI MDC GPIO number" - range EXAMPLE_GPIO_RANGE_MIN EXAMPLE_GPIO_RANGE_MAX + range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX default 23 help Set the GPIO number used by SMI MDC. config EXAMPLE_ETH_MDIO_GPIO int "SMI MDIO GPIO number" - range EXAMPLE_GPIO_RANGE_MIN EXAMPLE_GPIO_RANGE_MAX + range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX default 18 help Set the GPIO number used by SMI MDIO. config EXAMPLE_ETH_PHY_RST_GPIO int "PHY Reset GPIO number" - range -1 EXAMPLE_GPIO_RANGE_MAX + range -1 ENV_GPIO_OUT_RANGE_MAX default 5 help Set the GPIO number used to reset PHY chip. @@ -146,7 +137,7 @@ menu "Example Configuration" config EXAMPLE_ETH_SPI_SCLK_GPIO int "SPI SCLK GPIO number" - range EXAMPLE_GPIO_RANGE_MIN EXAMPLE_GPIO_RANGE_MAX + range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX default 14 if IDF_TARGET_ESP32 default 12 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 default 6 if IDF_TARGET_ESP32C3 @@ -155,7 +146,7 @@ menu "Example Configuration" config EXAMPLE_ETH_SPI_MOSI_GPIO int "SPI MOSI GPIO number" - range EXAMPLE_GPIO_RANGE_MIN EXAMPLE_GPIO_RANGE_MAX + range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX default 13 if IDF_TARGET_ESP32 default 11 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 default 7 if IDF_TARGET_ESP32C3 @@ -164,7 +155,7 @@ menu "Example Configuration" config EXAMPLE_ETH_SPI_MISO_GPIO int "SPI MISO GPIO number" - range EXAMPLE_GPIO_RANGE_MIN EXAMPLE_GPIO_RANGE_MAX + range ENV_GPIO_RANGE_MIN ENV_GPIO_IN_RANGE_MAX default 12 if IDF_TARGET_ESP32 default 13 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 default 2 if IDF_TARGET_ESP32C3 @@ -181,7 +172,7 @@ menu "Example Configuration" config EXAMPLE_ETH_SPI_CS0_GPIO int "SPI CS0 GPIO number for SPI Ethernet module #1" - range EXAMPLE_GPIO_RANGE_MIN EXAMPLE_GPIO_RANGE_MAX + range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX default 15 if IDF_TARGET_ESP32 default 10 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3 help @@ -190,7 +181,7 @@ menu "Example Configuration" config EXAMPLE_ETH_SPI_CS1_GPIO depends on EXAMPLE_SPI_ETHERNETS_NUM > 1 int "SPI CS1 GPIO number for SPI Ethernet module #2" - range EXAMPLE_GPIO_RANGE_MIN EXAMPLE_GPIO_RANGE_MAX + range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX default 32 if IDF_TARGET_ESP32 default 7 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 default 8 if IDF_TARGET_ESP32C3 @@ -199,7 +190,7 @@ menu "Example Configuration" config EXAMPLE_ETH_SPI_INT0_GPIO int "Interrupt GPIO number SPI Ethernet module #1" - range EXAMPLE_GPIO_RANGE_MIN EXAMPLE_GPIO_RANGE_MAX + range ENV_GPIO_RANGE_MIN ENV_GPIO_IN_RANGE_MAX default 4 if IDF_TARGET_ESP32 || IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3 help Set the GPIO number used by the first SPI Ethernet module interrupt line. @@ -207,7 +198,7 @@ menu "Example Configuration" config EXAMPLE_ETH_SPI_INT1_GPIO depends on EXAMPLE_SPI_ETHERNETS_NUM > 1 int "Interrupt GPIO number SPI Ethernet module #2" - range EXAMPLE_GPIO_RANGE_MIN EXAMPLE_GPIO_RANGE_MAX + range ENV_GPIO_RANGE_MIN ENV_GPIO_IN_RANGE_MAX default 33 if IDF_TARGET_ESP32 default 5 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3 help @@ -215,7 +206,7 @@ menu "Example Configuration" config EXAMPLE_ETH_SPI_PHY_RST0_GPIO int "PHY Reset GPIO number of SPI Ethernet Module #1" - range -1 EXAMPLE_GPIO_RANGE_MAX + range -1 ENV_GPIO_OUT_RANGE_MAX default -1 help Set the GPIO number used to reset PHY chip on the first SPI Ethernet module. @@ -224,7 +215,7 @@ menu "Example Configuration" config EXAMPLE_ETH_SPI_PHY_RST1_GPIO depends on EXAMPLE_SPI_ETHERNETS_NUM > 1 int "PHY Reset GPIO number of SPI Ethernet Module #2" - range -1 EXAMPLE_GPIO_RANGE_MAX + range -1 ENV_GPIO_OUT_RANGE_MAX default -1 help Set the GPIO number used to reset PHY chip on the second SPI Ethernet module. diff --git a/examples/ethernet/enc28j60/main/Kconfig.projbuild b/examples/ethernet/enc28j60/main/Kconfig.projbuild index c82b8a68ac..37bc799661 100644 --- a/examples/ethernet/enc28j60/main/Kconfig.projbuild +++ b/examples/ethernet/enc28j60/main/Kconfig.projbuild @@ -1,15 +1,6 @@ menu "Example Configuration" - config EXAMPLE_GPIO_RANGE_MIN - int - default 0 - - config EXAMPLE_GPIO_RANGE_MAX - int - default 33 if IDF_TARGET_ESP32 - default 46 if IDF_TARGET_ESP32S2 - default 19 if IDF_TARGET_ESP32C3 - default 48 if IDF_TARGET_ESP32S3 + orsource "$IDF_PATH/examples/common_components/env_caps/$IDF_TARGET/Kconfig.env_caps" config EXAMPLE_ENC28J60_SPI_HOST int "SPI Host Number" @@ -20,7 +11,7 @@ menu "Example Configuration" config EXAMPLE_ENC28J60_SCLK_GPIO int "SPI SCLK GPIO number" - range EXAMPLE_GPIO_RANGE_MIN EXAMPLE_GPIO_RANGE_MAX + range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX default 14 if IDF_TARGET_ESP32 default 12 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 default 6 if IDF_TARGET_ESP32C3 @@ -29,7 +20,7 @@ menu "Example Configuration" config EXAMPLE_ENC28J60_MOSI_GPIO int "SPI MOSI GPIO number" - range EXAMPLE_GPIO_RANGE_MIN EXAMPLE_GPIO_RANGE_MAX + range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX default 13 if IDF_TARGET_ESP32 default 11 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 default 7 if IDF_TARGET_ESP32C3 @@ -38,7 +29,7 @@ menu "Example Configuration" config EXAMPLE_ENC28J60_MISO_GPIO int "SPI MISO GPIO number" - range EXAMPLE_GPIO_RANGE_MIN EXAMPLE_GPIO_RANGE_MAX + range ENV_GPIO_RANGE_MIN ENV_GPIO_IN_RANGE_MAX default 12 if IDF_TARGET_ESP32 default 13 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 default 2 if IDF_TARGET_ESP32C3 @@ -47,7 +38,7 @@ menu "Example Configuration" config EXAMPLE_ENC28J60_CS_GPIO int "SPI CS GPIO number" - range EXAMPLE_GPIO_RANGE_MIN EXAMPLE_GPIO_RANGE_MAX + range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX default 15 if IDF_TARGET_ESP32 default 10 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3 help @@ -62,7 +53,7 @@ menu "Example Configuration" config EXAMPLE_ENC28J60_INT_GPIO int "Interrupt GPIO number" - range EXAMPLE_GPIO_RANGE_MIN EXAMPLE_GPIO_RANGE_MAX + range ENV_GPIO_RANGE_MIN ENV_GPIO_IN_RANGE_MAX default 4 if IDF_TARGET_ESP32 || IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3 help Set the GPIO number used by ENC28J60 interrupt. diff --git a/examples/ethernet/eth2ap/main/Kconfig.projbuild b/examples/ethernet/eth2ap/main/Kconfig.projbuild index 8e34e87f1b..56c4779e24 100644 --- a/examples/ethernet/eth2ap/main/Kconfig.projbuild +++ b/examples/ethernet/eth2ap/main/Kconfig.projbuild @@ -1,15 +1,6 @@ menu "Example Configuration" - config EXAMPLE_GPIO_RANGE_MIN - int - default 0 - - config EXAMPLE_GPIO_RANGE_MAX - int - default 33 if IDF_TARGET_ESP32 - default 46 if IDF_TARGET_ESP32S2 - default 19 if IDF_TARGET_ESP32C3 - default 48 if IDF_TARGET_ESP32S3 + orsource "$IDF_PATH/examples/common_components/env_caps/$IDF_TARGET/Kconfig.env_caps" config EXAMPLE_USE_SPI_ETHERNET bool @@ -103,14 +94,14 @@ menu "Example Configuration" config EXAMPLE_ETH_MDC_GPIO int "SMI MDC GPIO number" - range EXAMPLE_GPIO_RANGE_MIN EXAMPLE_GPIO_RANGE_MAX + range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX default 23 help Set the GPIO number used by SMI MDC. config EXAMPLE_ETH_MDIO_GPIO int "SMI MDIO GPIO number" - range EXAMPLE_GPIO_RANGE_MIN EXAMPLE_GPIO_RANGE_MAX + range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX default 18 help Set the GPIO number used by SMI MDIO. @@ -126,7 +117,7 @@ menu "Example Configuration" config EXAMPLE_ETH_SPI_SCLK_GPIO int "SPI SCLK GPIO number" - range EXAMPLE_GPIO_RANGE_MIN EXAMPLE_GPIO_RANGE_MAX + range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX default 14 if IDF_TARGET_ESP32 default 12 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 default 6 if IDF_TARGET_ESP32C3 @@ -135,7 +126,7 @@ menu "Example Configuration" config EXAMPLE_ETH_SPI_MOSI_GPIO int "SPI MOSI GPIO number" - range EXAMPLE_GPIO_RANGE_MIN EXAMPLE_GPIO_RANGE_MAX + range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX default 13 if IDF_TARGET_ESP32 default 11 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 default 7 if IDF_TARGET_ESP32C3 @@ -144,7 +135,7 @@ menu "Example Configuration" config EXAMPLE_ETH_SPI_MISO_GPIO int "SPI MISO GPIO number" - range EXAMPLE_GPIO_RANGE_MIN EXAMPLE_GPIO_RANGE_MAX + range ENV_GPIO_RANGE_MIN ENV_GPIO_IN_RANGE_MAX default 12 if IDF_TARGET_ESP32 default 13 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 default 2 if IDF_TARGET_ESP32C3 @@ -153,7 +144,7 @@ menu "Example Configuration" config EXAMPLE_ETH_SPI_CS_GPIO int "SPI CS GPIO number" - range EXAMPLE_GPIO_RANGE_MIN EXAMPLE_GPIO_RANGE_MAX + range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX default 15 if IDF_TARGET_ESP32 default 10 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3 help @@ -169,7 +160,7 @@ menu "Example Configuration" config EXAMPLE_ETH_SPI_INT_GPIO int "Interrupt GPIO number" - range EXAMPLE_GPIO_RANGE_MIN EXAMPLE_GPIO_RANGE_MAX + range ENV_GPIO_RANGE_MIN ENV_GPIO_IN_RANGE_MAX default 4 if IDF_TARGET_ESP32 || IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3 help Set the GPIO number used by the SPI Ethernet module interrupt line. @@ -177,7 +168,7 @@ menu "Example Configuration" config EXAMPLE_ETH_PHY_RST_GPIO int "PHY Reset GPIO number" - range -1 EXAMPLE_GPIO_RANGE_MAX + range -1 ENV_GPIO_OUT_RANGE_MAX default 5 help Set the GPIO number used to reset PHY chip. diff --git a/examples/ethernet/iperf/main/Kconfig.projbuild b/examples/ethernet/iperf/main/Kconfig.projbuild index 9089844018..10c453b32b 100644 --- a/examples/ethernet/iperf/main/Kconfig.projbuild +++ b/examples/ethernet/iperf/main/Kconfig.projbuild @@ -1,15 +1,6 @@ menu "Example Configuration" - config EXAMPLE_GPIO_RANGE_MIN - int - default 0 - - config EXAMPLE_GPIO_RANGE_MAX - int - default 33 if IDF_TARGET_ESP32 - default 46 if IDF_TARGET_ESP32S2 - default 19 if IDF_TARGET_ESP32C3 - default 48 if IDF_TARGET_ESP32S3 + orsource "$IDF_PATH/examples/common_components/env_caps/$IDF_TARGET/Kconfig.env_caps" config EXAMPLE_STORE_HISTORY bool "Store command history in flash" @@ -119,14 +110,14 @@ menu "Example Configuration" config EXAMPLE_ETH_MDC_GPIO int "SMI MDC GPIO number" - range EXAMPLE_GPIO_RANGE_MIN EXAMPLE_GPIO_RANGE_MAX + range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX default 23 help Set the GPIO number used by SMI MDC. config EXAMPLE_ETH_MDIO_GPIO int "SMI MDIO GPIO number" - range EXAMPLE_GPIO_RANGE_MIN EXAMPLE_GPIO_RANGE_MAX + range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX default 18 help Set the GPIO number used by SMI MDIO. @@ -142,7 +133,7 @@ menu "Example Configuration" config EXAMPLE_ETH_SPI_SCLK_GPIO int "SPI SCLK GPIO number" - range EXAMPLE_GPIO_RANGE_MIN EXAMPLE_GPIO_RANGE_MAX + range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX default 14 if IDF_TARGET_ESP32 default 12 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 default 6 if IDF_TARGET_ESP32C3 @@ -151,7 +142,7 @@ menu "Example Configuration" config EXAMPLE_ETH_SPI_MOSI_GPIO int "SPI MOSI GPIO number" - range EXAMPLE_GPIO_RANGE_MIN EXAMPLE_GPIO_RANGE_MAX + range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX default 13 if IDF_TARGET_ESP32 default 11 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 default 7 if IDF_TARGET_ESP32C3 @@ -160,7 +151,7 @@ menu "Example Configuration" config EXAMPLE_ETH_SPI_MISO_GPIO int "SPI MISO GPIO number" - range EXAMPLE_GPIO_RANGE_MIN EXAMPLE_GPIO_RANGE_MAX + range ENV_GPIO_RANGE_MIN ENV_GPIO_IN_RANGE_MAX default 12 if IDF_TARGET_ESP32 default 13 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 default 2 if IDF_TARGET_ESP32C3 @@ -169,7 +160,7 @@ menu "Example Configuration" config EXAMPLE_ETH_SPI_CS_GPIO int "SPI CS GPIO number" - range EXAMPLE_GPIO_RANGE_MIN EXAMPLE_GPIO_RANGE_MAX + range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX default 15 if IDF_TARGET_ESP32 default 10 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3 help @@ -186,7 +177,7 @@ menu "Example Configuration" config EXAMPLE_ETH_SPI_INT_GPIO int "Interrupt GPIO number" - range EXAMPLE_GPIO_RANGE_MIN EXAMPLE_GPIO_RANGE_MAX + range ENV_GPIO_RANGE_MIN ENV_GPIO_IN_RANGE_MAX default 4 if IDF_TARGET_ESP32 || IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3 help Set the GPIO number used by the SPI Ethernet module interrupt line. @@ -194,7 +185,7 @@ menu "Example Configuration" config EXAMPLE_ETH_PHY_RST_GPIO int "PHY Reset GPIO number" - range -1 EXAMPLE_GPIO_RANGE_MAX + range -1 ENV_GPIO_OUT_RANGE_MAX default 5 help Set the GPIO number used to reset PHY chip. diff --git a/examples/get-started/blink/main/Kconfig.projbuild b/examples/get-started/blink/main/Kconfig.projbuild index b7699706d4..43be4f448b 100644 --- a/examples/get-started/blink/main/Kconfig.projbuild +++ b/examples/get-started/blink/main/Kconfig.projbuild @@ -1,5 +1,7 @@ menu "Example Configuration" + orsource "$IDF_PATH/examples/common_components/env_caps/$IDF_TARGET/Kconfig.env_caps" + choice BLINK_LED prompt "Blink LED type" default BLINK_LED_GPIO if IDF_TARGET_ESP32 || IDF_TARGET_ESP32C2 @@ -15,7 +17,7 @@ menu "Example Configuration" config BLINK_GPIO int "Blink GPIO number" - range 0 48 + range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX default 8 if IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32H2 || IDF_TARGET_ESP32C2 default 18 if IDF_TARGET_ESP32S2 default 48 if IDF_TARGET_ESP32S3 diff --git a/examples/network/simple_sniffer/main/Kconfig.projbuild b/examples/network/simple_sniffer/main/Kconfig.projbuild index f5b51ffb6c..92f1630b9b 100644 --- a/examples/network/simple_sniffer/main/Kconfig.projbuild +++ b/examples/network/simple_sniffer/main/Kconfig.projbuild @@ -1,15 +1,6 @@ menu "Example Configuration" - config SNIFFER_GPIO_RANGE_MIN - int - default 0 - - config SNIFFER_GPIO_RANGE_MAX - int - default 33 if IDF_TARGET_ESP32 - default 46 if IDF_TARGET_ESP32S2 - default 19 if IDF_TARGET_ESP32C3 - default 48 if IDF_TARGET_ESP32S3 + orsource "$IDF_PATH/examples/common_components/env_caps/$IDF_TARGET/Kconfig.env_caps" config SNIFFER_STORE_HISTORY bool "Store command history into flash" @@ -192,14 +183,14 @@ menu "Example Configuration" config SNIFFER_ETH_MDC_GPIO int "SMI MDC GPIO number" - range SNIFFER_GPIO_RANGE_MIN SNIFFER_GPIO_RANGE_MAX + range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX default 23 help Set the GPIO number used by SMI MDC. config SNIFFER_ETH_MDIO_GPIO int "SMI MDIO GPIO number" - range SNIFFER_GPIO_RANGE_MIN SNIFFER_GPIO_RANGE_MAX + range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX default 18 help Set the GPIO number used by SMI MDIO. @@ -215,7 +206,7 @@ menu "Example Configuration" config SNIFFER_ETH_SPI_SCLK_GPIO int "SPI SCLK GPIO number" - range SNIFFER_GPIO_RANGE_MIN SNIFFER_GPIO_RANGE_MAX + range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX default 14 if IDF_TARGET_ESP32 default 12 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 default 6 if IDF_TARGET_ESP32C3 @@ -224,7 +215,7 @@ menu "Example Configuration" config SNIFFER_ETH_SPI_MOSI_GPIO int "SPI MOSI GPIO number" - range SNIFFER_GPIO_RANGE_MIN SNIFFER_GPIO_RANGE_MAX + range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX default 13 if IDF_TARGET_ESP32 default 11 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 default 7 if IDF_TARGET_ESP32C3 @@ -233,7 +224,7 @@ menu "Example Configuration" config SNIFFER_ETH_SPI_MISO_GPIO int "SPI MISO GPIO number" - range SNIFFER_GPIO_RANGE_MIN SNIFFER_GPIO_RANGE_MAX + range ENV_GPIO_RANGE_MIN ENV_GPIO_IN_RANGE_MAX default 12 if IDF_TARGET_ESP32 default 13 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 default 2 if IDF_TARGET_ESP32C3 @@ -242,7 +233,7 @@ menu "Example Configuration" config SNIFFER_ETH_SPI_CS_GPIO int "SPI CS GPIO number" - range SNIFFER_GPIO_RANGE_MIN SNIFFER_GPIO_RANGE_MAX + range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX default 15 if IDF_TARGET_ESP32 default 10 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3 help @@ -258,7 +249,7 @@ menu "Example Configuration" config SNIFFER_ETH_SPI_INT_GPIO int "Interrupt GPIO number" - range SNIFFER_GPIO_RANGE_MIN SNIFFER_GPIO_RANGE_MAX + range ENV_GPIO_RANGE_MIN ENV_GPIO_IN_RANGE_MAX default 4 if IDF_TARGET_ESP32 || IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3 help Set the GPIO number used by the SPI Ethernet module interrupt line. @@ -267,7 +258,7 @@ menu "Example Configuration" if !SNIFFER_NO_ETHERNET config SNIFFER_ETH_PHY_RST_GPIO int "PHY Reset GPIO number" - range -1 SNIFFER_GPIO_RANGE_MAX + range -1 ENV_GPIO_OUT_RANGE_MAX default 5 help Set the GPIO number used to reset PHY chip. diff --git a/examples/peripherals/gpio/generic_gpio/main/Kconfig.projbuild b/examples/peripherals/gpio/generic_gpio/main/Kconfig.projbuild index a68ca434fb..37e7b74ce0 100644 --- a/examples/peripherals/gpio/generic_gpio/main/Kconfig.projbuild +++ b/examples/peripherals/gpio/generic_gpio/main/Kconfig.projbuild @@ -1,7 +1,10 @@ menu "Example Configuration" + orsource "$IDF_PATH/examples/common_components/env_caps/$IDF_TARGET/Kconfig.env_caps" + config GPIO_OUTPUT_0 int "GPIO output pin 0" + range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX default 18 if IDF_TARGET_ESP32 || IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3 default 8 if IDF_TARGET_ESP32C2 || IDF_TARGET_ESP32H2 help @@ -9,6 +12,7 @@ menu "Example Configuration" config GPIO_OUTPUT_1 int "GPIO output pin 1" + range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX default 19 if IDF_TARGET_ESP32 || IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3 default 9 if IDF_TARGET_ESP32C2 || IDF_TARGET_ESP32H2 help @@ -16,12 +20,14 @@ menu "Example Configuration" config GPIO_INPUT_0 int "GPIO input pin 0" + range ENV_GPIO_RANGE_MIN ENV_GPIO_IN_RANGE_MAX default 4 help GPIO pin number to be used as GPIO_INPUT_IO_0. config GPIO_INPUT_1 int "GPIO input pin 1" + range ENV_GPIO_RANGE_MIN ENV_GPIO_IN_RANGE_MAX default 5 help GPIO pin number to be used as GPIO_INPUT_IO_1. diff --git a/examples/peripherals/twai/twai_alert_and_recovery/main/Kconfig.projbuild b/examples/peripherals/twai/twai_alert_and_recovery/main/Kconfig.projbuild index e71c1bf058..1f9d58c4dd 100644 --- a/examples/peripherals/twai/twai_alert_and_recovery/main/Kconfig.projbuild +++ b/examples/peripherals/twai/twai_alert_and_recovery/main/Kconfig.projbuild @@ -1,7 +1,10 @@ menu "Example Configuration" + orsource "$IDF_PATH/examples/common_components/env_caps/$IDF_TARGET/Kconfig.env_caps" + config EXAMPLE_TX_GPIO_NUM int "TX GPIO number" + range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX default 2 if IDF_TARGET_ESP32C3 default 20 if IDF_TARGET_ESP32S2 default 21 if IDF_TARGET_ESP32 @@ -12,6 +15,7 @@ menu "Example Configuration" config EXAMPLE_RX_GPIO_NUM int "RX GPIO number" + range ENV_GPIO_RANGE_MIN ENV_GPIO_IN_RANGE_MAX default 3 if IDF_TARGET_ESP32C3 default 21 if IDF_TARGET_ESP32S2 default 22 if IDF_TARGET_ESP32 diff --git a/examples/peripherals/twai/twai_self_test/main/Kconfig.projbuild b/examples/peripherals/twai/twai_self_test/main/Kconfig.projbuild index e71c1bf058..1f9d58c4dd 100644 --- a/examples/peripherals/twai/twai_self_test/main/Kconfig.projbuild +++ b/examples/peripherals/twai/twai_self_test/main/Kconfig.projbuild @@ -1,7 +1,10 @@ menu "Example Configuration" + orsource "$IDF_PATH/examples/common_components/env_caps/$IDF_TARGET/Kconfig.env_caps" + config EXAMPLE_TX_GPIO_NUM int "TX GPIO number" + range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX default 2 if IDF_TARGET_ESP32C3 default 20 if IDF_TARGET_ESP32S2 default 21 if IDF_TARGET_ESP32 @@ -12,6 +15,7 @@ menu "Example Configuration" config EXAMPLE_RX_GPIO_NUM int "RX GPIO number" + range ENV_GPIO_RANGE_MIN ENV_GPIO_IN_RANGE_MAX default 3 if IDF_TARGET_ESP32C3 default 21 if IDF_TARGET_ESP32S2 default 22 if IDF_TARGET_ESP32 diff --git a/examples/peripherals/uart/nmea0183_parser/main/Kconfig.projbuild b/examples/peripherals/uart/nmea0183_parser/main/Kconfig.projbuild index 32934afa51..f0a6071b89 100644 --- a/examples/peripherals/uart/nmea0183_parser/main/Kconfig.projbuild +++ b/examples/peripherals/uart/nmea0183_parser/main/Kconfig.projbuild @@ -1,13 +1,10 @@ menu "Example Configuration" + orsource "$IDF_PATH/examples/common_components/env_caps/$IDF_TARGET/Kconfig.env_caps" + config NMEA_PARSER_UART_RXD int "UART RXD pin number" - range 0 39 if IDF_TARGET_ESP32 - range 0 46 if IDF_TARGET_ESP32S2 - range 0 48 if IDF_TARGET_ESP32S3 - range 0 19 if IDF_TARGET_ESP32C3 - range 0 18 if IDF_TARGET_ESP32C2 - range 0 25 if IDF_TARGET_ESP32H2 + range ENV_GPIO_RANGE_MIN ENV_GPIO_IN_RANGE_MAX default 5 help GPIO number for UART RX pin. See UART documentation for more information diff --git a/examples/peripherals/uart/uart_echo/main/Kconfig.projbuild b/examples/peripherals/uart/uart_echo/main/Kconfig.projbuild index 45894ded36..23427866e4 100644 --- a/examples/peripherals/uart/uart_echo/main/Kconfig.projbuild +++ b/examples/peripherals/uart/uart_echo/main/Kconfig.projbuild @@ -1,5 +1,7 @@ menu "Echo Example Configuration" + orsource "$IDF_PATH/examples/common_components/env_caps/$IDF_TARGET/Kconfig.env_caps" + config EXAMPLE_UART_PORT_NUM int "UART port number" range 0 2 if IDF_TARGET_ESP32 || IDF_TARGET_ESP32S3 @@ -19,12 +21,7 @@ menu "Echo Example Configuration" config EXAMPLE_UART_RXD int "UART RXD pin number" - range 0 39 if IDF_TARGET_ESP32 - range 0 46 if IDF_TARGET_ESP32S2 - range 0 19 if IDF_TARGET_ESP32C3 - range 0 48 if IDF_TARGET_ESP32S3 - range 0 18 if IDF_TARGET_ESP32C2 - range 0 25 if IDF_TARGET_ESP32H2 + range ENV_GPIO_RANGE_MIN ENV_GPIO_IN_RANGE_MAX default 5 help GPIO number for UART RX pin. See UART documentation for more information @@ -32,12 +29,7 @@ menu "Echo Example Configuration" config EXAMPLE_UART_TXD int "UART TXD pin number" - range 0 33 if IDF_TARGET_ESP32 - range 0 45 if IDF_TARGET_ESP32S2 - range 0 19 if IDF_TARGET_ESP32C3 - range 0 48 if IDF_TARGET_ESP32S3 - range 0 18 if IDF_TARGET_ESP32C2 - range 0 25 if IDF_TARGET_ESP32H2 + range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX default 4 help GPIO number for UART TX pin. See UART documentation for more information diff --git a/examples/peripherals/uart/uart_echo_rs485/main/Kconfig.projbuild b/examples/peripherals/uart/uart_echo_rs485/main/Kconfig.projbuild index 9e25e07766..32f5148857 100644 --- a/examples/peripherals/uart/uart_echo_rs485/main/Kconfig.projbuild +++ b/examples/peripherals/uart/uart_echo_rs485/main/Kconfig.projbuild @@ -1,5 +1,7 @@ menu "Echo RS485 Example Configuration" + orsource "$IDF_PATH/examples/common_components/env_caps/$IDF_TARGET/Kconfig.env_caps" + config ECHO_UART_PORT_NUM int "UART port number" range 0 2 if IDF_TARGET_ESP32 || IDF_TARGET_ESP32S3 @@ -19,13 +21,8 @@ menu "Echo RS485 Example Configuration" config ECHO_UART_RXD int "UART RXD pin number" - range 0 39 if IDF_TARGET_ESP32 + range ENV_GPIO_RANGE_MIN ENV_GPIO_IN_RANGE_MAX default 22 if IDF_TARGET_ESP32 - range 0 46 if IDF_TARGET_ESP32S2 - range 0 48 if IDF_TARGET_ESP32S3 - range 0 19 if IDF_TARGET_ESP32C3 - range 0 18 if IDF_TARGET_ESP32C2 - range 0 25 if IDF_TARGET_ESP32H2 default 8 if !IDF_TARGET_ESP32 help GPIO number for UART RX pin. See UART documentation for more information @@ -33,13 +30,8 @@ menu "Echo RS485 Example Configuration" config ECHO_UART_TXD int "UART TXD pin number" - range 0 33 if IDF_TARGET_ESP32 + range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX default 23 if IDF_TARGET_ESP32 - range 0 45 if IDF_TARGET_ESP32S2 - range 0 48 if IDF_TARGET_ESP32S3 - range 0 19 if IDF_TARGET_ESP32C3 - range 0 18 if IDF_TARGET_ESP32C2 - range 0 25 if IDF_TARGET_ESP32H2 default 9 if !IDF_TARGET_ESP32 help GPIO number for UART TX pin. See UART documentation for more information @@ -47,13 +39,8 @@ menu "Echo RS485 Example Configuration" config ECHO_UART_RTS int "UART RTS pin number" - range 0 33 if IDF_TARGET_ESP32 + range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX default 18 if IDF_TARGET_ESP32 - range 0 45 if IDF_TARGET_ESP32S2 - range 0 48 if IDF_TARGET_ESP32S3 - range 0 19 if IDF_TARGET_ESP32C3 - range 0 18 if IDF_TARGET_ESP32C2 - range 0 25 if IDF_TARGET_ESP32H2 default 10 if !IDF_TARGET_ESP32 help GPIO number for UART RTS pin. This pin is connected to diff --git a/examples/protocols/mdns/main/Kconfig.projbuild b/examples/protocols/mdns/main/Kconfig.projbuild index b66e6f867a..18e1cc2097 100644 --- a/examples/protocols/mdns/main/Kconfig.projbuild +++ b/examples/protocols/mdns/main/Kconfig.projbuild @@ -1,11 +1,6 @@ menu "Example Configuration" - config MDNS_GPIO_RANGE_MAX - int - default 33 if IDF_TARGET_ESP32 - default 46 if IDF_TARGET_ESP32S2 - default 19 if IDF_TARGET_ESP32C3 - default 48 if IDF_TARGET_ESP32S3 + orsource "$IDF_PATH/examples/common_components/env_caps/$IDF_TARGET/Kconfig.env_caps" config MDNS_HOSTNAME string "mDNS Hostname" @@ -43,7 +38,7 @@ menu "Example Configuration" config MDNS_BUTTON_GPIO int "Button GPIO to trigger querries" - range 0 MDNS_GPIO_RANGE_MAX + range ENV_GPIO_RANGE_MIN ENV_GPIO_IN_RANGE_MAX default 0 help Set the GPIO number used as mDNS test button diff --git a/examples/protocols/modbus/serial/mb_master/main/Kconfig.projbuild b/examples/protocols/modbus/serial/mb_master/main/Kconfig.projbuild index b923e15ca4..76f0397ef2 100644 --- a/examples/protocols/modbus/serial/mb_master/main/Kconfig.projbuild +++ b/examples/protocols/modbus/serial/mb_master/main/Kconfig.projbuild @@ -1,5 +1,7 @@ menu "Modbus Example Configuration" + orsource "$IDF_PATH/examples/common_components/env_caps/$IDF_TARGET/Kconfig.env_caps" + config MB_UART_PORT_NUM int "UART port number" range 0 2 if IDF_TARGET_ESP32 || IDF_TARGET_ESP32S3 @@ -18,11 +20,8 @@ menu "Modbus Example Configuration" config MB_UART_RXD int "UART RXD pin number" - range 0 34 if IDF_TARGET_ESP32 + range ENV_GPIO_RANGE_MIN ENV_GPIO_IN_RANGE_MAX default 22 if IDF_TARGET_ESP32 - range 0 46 if IDF_TARGET_ESP32S2 - range 0 47 if IDF_TARGET_ESP32S3 - range 0 19 if IDF_TARGET_ESP32C3 default 8 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 || IDF_TARGET_ESP32C3 help GPIO number for UART RX pin. See UART documentation for more information @@ -30,11 +29,8 @@ menu "Modbus Example Configuration" config MB_UART_TXD int "UART TXD pin number" - range 0 34 if IDF_TARGET_ESP32 + range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX default 23 if IDF_TARGET_ESP32 - range 0 46 if IDF_TARGET_ESP32S2 - range 0 47 if IDF_TARGET_ESP32S3 - range 0 19 if IDF_TARGET_ESP32C3 default 9 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 || IDF_TARGET_ESP32C3 help GPIO number for UART TX pin. See UART documentation for more information @@ -42,11 +38,8 @@ menu "Modbus Example Configuration" config MB_UART_RTS int "UART RTS pin number" - range 0 34 if IDF_TARGET_ESP32 + range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX default 18 if IDF_TARGET_ESP32 - range 0 46 if IDF_TARGET_ESP32S2 - range 0 47 if IDF_TARGET_ESP32S3 - range 0 19 if IDF_TARGET_ESP32C3 default 10 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 || IDF_TARGET_ESP32C3 help GPIO number for UART RTS pin. This pin is connected to diff --git a/examples/protocols/modbus/serial/mb_slave/main/Kconfig.projbuild b/examples/protocols/modbus/serial/mb_slave/main/Kconfig.projbuild index 884a1b8b32..1d3baecbc2 100644 --- a/examples/protocols/modbus/serial/mb_slave/main/Kconfig.projbuild +++ b/examples/protocols/modbus/serial/mb_slave/main/Kconfig.projbuild @@ -1,5 +1,7 @@ menu "Modbus Example Configuration" + orsource "$IDF_PATH/examples/common_components/env_caps/$IDF_TARGET/Kconfig.env_caps" + config MB_UART_PORT_NUM int "UART port number" range 0 2 if IDF_TARGET_ESP32 || IDF_TARGET_ESP32S3 @@ -18,11 +20,8 @@ menu "Modbus Example Configuration" config MB_UART_RXD int "UART RXD pin number" - range 0 34 if IDF_TARGET_ESP32 + range ENV_GPIO_RANGE_MIN ENV_GPIO_IN_RANGE_MAX default 22 if IDF_TARGET_ESP32 - range 0 46 if IDF_TARGET_ESP32S2 - range 0 47 if IDF_TARGET_ESP32S3 - range 0 19 if IDF_TARGET_ESP32C3 default 8 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 || IDF_TARGET_ESP32C3 help GPIO number for UART RX pin. See UART documentation for more information @@ -30,11 +29,8 @@ menu "Modbus Example Configuration" config MB_UART_TXD int "UART TXD pin number" - range 0 34 if IDF_TARGET_ESP32 + range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX default 23 if IDF_TARGET_ESP32 - range 0 46 if IDF_TARGET_ESP32S2 - range 0 47 if IDF_TARGET_ESP32S3 - range 0 19 if IDF_TARGET_ESP32C3 default 9 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 || IDF_TARGET_ESP32C3 help GPIO number for UART TX pin. See UART documentation for more information @@ -42,11 +38,8 @@ menu "Modbus Example Configuration" config MB_UART_RTS int "UART RTS pin number" - range 0 34 if IDF_TARGET_ESP32 + range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX default 18 if IDF_TARGET_ESP32 - range 0 46 if IDF_TARGET_ESP32S2 - range 0 47 if IDF_TARGET_ESP32S3 - range 0 19 if IDF_TARGET_ESP32C3 default 10 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 || IDF_TARGET_ESP32C3 help GPIO number for UART RTS pin. This pin is connected to diff --git a/examples/system/gcov/main/Kconfig.projbuild b/examples/system/gcov/main/Kconfig.projbuild index 7fe6fb784e..2be1f9f0fd 100644 --- a/examples/system/gcov/main/Kconfig.projbuild +++ b/examples/system/gcov/main/Kconfig.projbuild @@ -1,8 +1,10 @@ menu "Example Configuration" + orsource "$IDF_PATH/examples/common_components/env_caps/$IDF_TARGET/Kconfig.env_caps" + config BLINK_GPIO int "Blink GPIO number" - range 0 48 + range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX default 8 if IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32H2 default 18 if IDF_TARGET_ESP32S2 default 48 if IDF_TARGET_ESP32S3 diff --git a/examples/system/ota/native_ota_example/main/Kconfig.projbuild b/examples/system/ota/native_ota_example/main/Kconfig.projbuild index 1036baa89e..ac9bb48a33 100644 --- a/examples/system/ota/native_ota_example/main/Kconfig.projbuild +++ b/examples/system/ota/native_ota_example/main/Kconfig.projbuild @@ -1,5 +1,7 @@ menu "Example Configuration" + orsource "$IDF_PATH/examples/common_components/env_caps/$IDF_TARGET/Kconfig.env_caps" + config EXAMPLE_FIRMWARE_UPG_URL string "Firmware Upgrade URL" default "https://192.168.2.106:8070/hello_world.bin" @@ -24,7 +26,7 @@ menu "Example Configuration" config EXAMPLE_GPIO_DIAGNOSTIC int "Number of the GPIO input for diagnostic" - range 0 39 + range ENV_GPIO_RANGE_MIN ENV_GPIO_IN_RANGE_MAX default 4 help Used to demonstrate how a rollback works.