mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 11:10:54 +03:00
feat(usb_device_example): Create per-target sdkconfig.defaults
This commit is contained in:
@@ -59,7 +59,8 @@ GPIOs and SD bus settings can be configured in two ways:
|
|||||||
- Select "SDMMC CARD" for "Storage Media Used"
|
- Select "SDMMC CARD" for "Storage Media Used"
|
||||||
- Select "SD/MMC bus width" — "4 lines (D0 - D3)" or "1 line (D0)" (see `CONFIG_EXAMPLE_SDMMC_BUS_WIDTH_1`)
|
- Select "SD/MMC bus width" — "4 lines (D0 - D3)" or "1 line (D0)" (see `CONFIG_EXAMPLE_SDMMC_BUS_WIDTH_1`)
|
||||||
- On ESP32-S3 and ESP32-P4: set the GPIO numbers for the SD card interface
|
- On ESP32-S3 and ESP32-P4: set the GPIO numbers for the SD card interface
|
||||||
2. In the source code: See the initialization of ``sdmmc_slot_config_t slot_config`` structure in the example code.
|
2. Using target-specific defaults: Pin and LDO defaults for each chip are in ``sdkconfig.defaults.esp32s3``, ``sdkconfig.defaults.esp32p4``, and ``sdkconfig.defaults.esp32s31``. These are applied automatically when you set the target with ``idf.py set-target``.
|
||||||
|
3. In the source code: See the initialization of ``sdmmc_slot_config_t slot_config`` structure in the example code.
|
||||||
|
|
||||||
By default, this example uses 4-line SD mode, utilizing 6 pins: CLK, CMD, D0 - D3.
|
By default, this example uses 4-line SD mode, utilizing 6 pins: CLK, CMD, D0 - D3.
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ menu "TinyUSB MSC Example Configuration"
|
|||||||
|
|
||||||
config EXAMPLE_STORAGE_MEDIA_SDMMC
|
config EXAMPLE_STORAGE_MEDIA_SDMMC
|
||||||
bool "SDMMC CARD"
|
bool "SDMMC CARD"
|
||||||
depends on IDF_TARGET_ESP32S3 || IDF_TARGET_ESP32P4 || IDF_TARGET_ESP32S31
|
depends on SOC_SDMMC_HOST_SUPPORTED
|
||||||
endchoice
|
endchoice
|
||||||
|
|
||||||
if EXAMPLE_STORAGE_MEDIA_SDMMC
|
if EXAMPLE_STORAGE_MEDIA_SDMMC
|
||||||
@@ -39,40 +39,34 @@ menu "TinyUSB MSC Example Configuration"
|
|||||||
config EXAMPLE_PIN_CMD
|
config EXAMPLE_PIN_CMD
|
||||||
int "CMD GPIO number"
|
int "CMD GPIO number"
|
||||||
range ENV_GPIO_RANGE_MIN ENV_GPIO_IN_RANGE_MAX
|
range ENV_GPIO_RANGE_MIN ENV_GPIO_IN_RANGE_MAX
|
||||||
default 35 if IDF_TARGET_ESP32S3
|
default 35
|
||||||
default 44 if IDF_TARGET_ESP32P4
|
|
||||||
|
|
||||||
config EXAMPLE_PIN_CLK
|
config EXAMPLE_PIN_CLK
|
||||||
int "CLK GPIO number"
|
int "CLK GPIO number"
|
||||||
range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX
|
range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX
|
||||||
default 36 if IDF_TARGET_ESP32S3
|
default 36
|
||||||
default 43 if IDF_TARGET_ESP32P4
|
|
||||||
|
|
||||||
config EXAMPLE_PIN_D0
|
config EXAMPLE_PIN_D0
|
||||||
int "D0 GPIO number"
|
int "D0 GPIO number"
|
||||||
range ENV_GPIO_RANGE_MIN ENV_GPIO_IN_RANGE_MAX
|
range ENV_GPIO_RANGE_MIN ENV_GPIO_IN_RANGE_MAX
|
||||||
default 37 if IDF_TARGET_ESP32S3
|
default 37
|
||||||
default 39 if IDF_TARGET_ESP32P4
|
|
||||||
|
|
||||||
if EXAMPLE_SDMMC_BUS_WIDTH_4
|
if EXAMPLE_SDMMC_BUS_WIDTH_4
|
||||||
|
|
||||||
config EXAMPLE_PIN_D1
|
config EXAMPLE_PIN_D1
|
||||||
int "D1 GPIO number"
|
int "D1 GPIO number"
|
||||||
range ENV_GPIO_RANGE_MIN ENV_GPIO_IN_RANGE_MAX
|
range ENV_GPIO_RANGE_MIN ENV_GPIO_IN_RANGE_MAX
|
||||||
default 38 if IDF_TARGET_ESP32S3
|
default 38
|
||||||
default 40 if IDF_TARGET_ESP32P4
|
|
||||||
|
|
||||||
config EXAMPLE_PIN_D2
|
config EXAMPLE_PIN_D2
|
||||||
int "D2 GPIO number"
|
int "D2 GPIO number"
|
||||||
range ENV_GPIO_RANGE_MIN ENV_GPIO_IN_RANGE_MAX
|
range ENV_GPIO_RANGE_MIN ENV_GPIO_IN_RANGE_MAX
|
||||||
default 33 if IDF_TARGET_ESP32S3
|
default 33
|
||||||
default 41 if IDF_TARGET_ESP32P4
|
|
||||||
|
|
||||||
config EXAMPLE_PIN_D3
|
config EXAMPLE_PIN_D3
|
||||||
int "D3 GPIO number"
|
int "D3 GPIO number"
|
||||||
range ENV_GPIO_RANGE_MIN ENV_GPIO_IN_RANGE_MAX
|
range ENV_GPIO_RANGE_MIN ENV_GPIO_IN_RANGE_MAX
|
||||||
default 34 if IDF_TARGET_ESP32S3
|
default 34
|
||||||
default 42 if IDF_TARGET_ESP32P4
|
|
||||||
|
|
||||||
endif # EXAMPLE_SDMMC_BUS_WIDTH_4
|
endif # EXAMPLE_SDMMC_BUS_WIDTH_4
|
||||||
|
|
||||||
@@ -81,7 +75,6 @@ menu "TinyUSB MSC Example Configuration"
|
|||||||
config EXAMPLE_SD_PWR_CTRL_LDO_INTERNAL_IO
|
config EXAMPLE_SD_PWR_CTRL_LDO_INTERNAL_IO
|
||||||
depends on SOC_SDMMC_IO_POWER_EXTERNAL || SOC_SDMMC_IO_UHS_POWER_EXTERNAL
|
depends on SOC_SDMMC_IO_POWER_EXTERNAL || SOC_SDMMC_IO_UHS_POWER_EXTERNAL
|
||||||
bool "SDMMC powered by internal LDO"
|
bool "SDMMC powered by internal LDO"
|
||||||
default y
|
|
||||||
help
|
help
|
||||||
Enable when internal LDO of an ESP32 is used as a power supply for SD card. Specify the LDO IO.
|
Enable when internal LDO of an ESP32 is used as a power supply for SD card. Specify the LDO IO.
|
||||||
Disable when external power supply is used as a power supply for SD card.
|
Disable when external power supply is used as a power supply for SD card.
|
||||||
@@ -90,8 +83,7 @@ menu "TinyUSB MSC Example Configuration"
|
|||||||
depends on SOC_SDMMC_IO_POWER_EXTERNAL || SOC_SDMMC_IO_UHS_POWER_EXTERNAL
|
depends on SOC_SDMMC_IO_POWER_EXTERNAL || SOC_SDMMC_IO_UHS_POWER_EXTERNAL
|
||||||
depends on EXAMPLE_SD_PWR_CTRL_LDO_INTERNAL_IO
|
depends on EXAMPLE_SD_PWR_CTRL_LDO_INTERNAL_IO
|
||||||
int "LDO IO"
|
int "LDO IO"
|
||||||
default 4 if IDF_TARGET_ESP32P4
|
default 1
|
||||||
default 1 if IDF_TARGET_ESP32S31
|
|
||||||
help
|
help
|
||||||
There are several IOs in ESP32 SD card capable targets which are in "SD card IO" power domain.
|
There are several IOs in ESP32 SD card capable targets which are in "SD card IO" power domain.
|
||||||
Power has to be supplied to this power domain externally (from outside the chip) via one of the pins.
|
Power has to be supplied to this power domain externally (from outside the chip) via one of the pins.
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
CONFIG_EXAMPLE_PIN_CMD=44
|
||||||
|
CONFIG_EXAMPLE_PIN_CLK=43
|
||||||
|
CONFIG_EXAMPLE_PIN_D0=39
|
||||||
|
CONFIG_EXAMPLE_PIN_D1=40
|
||||||
|
CONFIG_EXAMPLE_PIN_D2=41
|
||||||
|
CONFIG_EXAMPLE_PIN_D3=42
|
||||||
|
CONFIG_EXAMPLE_SD_PWR_CTRL_LDO_INTERNAL_IO=y
|
||||||
|
CONFIG_EXAMPLE_SD_PWR_CTRL_LDO_IO_ID=4
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
CONFIG_EXAMPLE_PIN_CMD=35
|
||||||
|
CONFIG_EXAMPLE_PIN_CLK=36
|
||||||
|
CONFIG_EXAMPLE_PIN_D0=37
|
||||||
|
CONFIG_EXAMPLE_PIN_D1=38
|
||||||
|
CONFIG_EXAMPLE_PIN_D2=33
|
||||||
|
CONFIG_EXAMPLE_PIN_D3=34
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
CONFIG_EXAMPLE_SD_PWR_CTRL_LDO_INTERNAL_IO=y
|
||||||
|
CONFIG_EXAMPLE_SD_PWR_CTRL_LDO_IO_ID=1
|
||||||
Reference in New Issue
Block a user