mirror of
https://github.com/espressif/esp-idf
synced 2025-03-09 17:19:09 -04:00
Merge branch 'feature/usb_device_examples_p4_prep' into 'master'
USB Device examples: prerequisite and refactoring for esp32p4 See merge request espressif/esp-idf!28339
This commit is contained in:
commit
6f053704dc
@ -3,7 +3,7 @@
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* SPDX-FileContributor: 2022-2023 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileContributor: 2022-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
@ -61,7 +61,7 @@ static const uint8_t s_midi_cfg_desc[] = {
|
||||
TUD_CONFIG_DESCRIPTOR(1, ITF_COUNT, 0, TUSB_DESCRIPTOR_TOTAL_LEN, 0, 100),
|
||||
|
||||
// Interface number, string index, EP Out & EP In address, EP size
|
||||
TUD_MIDI_DESCRIPTOR(ITF_NUM_MIDI, 4, EPNUM_MIDI, (0x80 | EPNUM_MIDI), 64),
|
||||
TUD_MIDI_DESCRIPTOR(ITF_NUM_MIDI, 4, EPNUM_MIDI, (0x80 | EPNUM_MIDI), TUD_OPT_HIGH_SPEED ? 512 : 64),
|
||||
};
|
||||
|
||||
static void midi_task_read_example(void *arg)
|
||||
|
@ -1,4 +1,6 @@
|
||||
menu "USB Dev MSC Example Configuration"
|
||||
menu "TinyUSB MSC Example Configuration"
|
||||
|
||||
orsource "$IDF_PATH/examples/common_components/env_caps/$IDF_TARGET/Kconfig.env_caps"
|
||||
|
||||
choice EXAMPLE_STORAGE_MEDIA
|
||||
prompt "Storage Media Used"
|
||||
@ -9,12 +11,12 @@ menu "USB Dev MSC Example Configuration"
|
||||
config EXAMPLE_STORAGE_MEDIA_SPIFLASH
|
||||
bool "SPI FLASH"
|
||||
|
||||
config EXAMPLE_STORAGE_MEDIA_SDMMCCARD
|
||||
config EXAMPLE_STORAGE_MEDIA_SDMMC
|
||||
bool "SDMMC CARD"
|
||||
depends on IDF_TARGET_ESP32S3
|
||||
depends on IDF_TARGET_ESP32S3 || IDF_TARGET_ESP32P4
|
||||
endchoice
|
||||
|
||||
if EXAMPLE_STORAGE_MEDIA_SDMMCCARD
|
||||
if EXAMPLE_STORAGE_MEDIA_SDMMC
|
||||
|
||||
choice EXAMPLE_SDMMC_BUS_WIDTH
|
||||
prompt "SD/MMC bus width"
|
||||
@ -36,34 +38,46 @@ menu "USB Dev MSC Example Configuration"
|
||||
|
||||
config EXAMPLE_PIN_CMD
|
||||
int "CMD GPIO number"
|
||||
range ENV_GPIO_RANGE_MIN ENV_GPIO_IN_RANGE_MAX
|
||||
default 35 if IDF_TARGET_ESP32S3
|
||||
default 44 if IDF_TARGET_ESP32P4
|
||||
|
||||
config EXAMPLE_PIN_CLK
|
||||
int "CLK GPIO number"
|
||||
range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX
|
||||
default 36 if IDF_TARGET_ESP32S3
|
||||
default 43 if IDF_TARGET_ESP32P4
|
||||
|
||||
config EXAMPLE_PIN_D0
|
||||
int "D0 GPIO number"
|
||||
range ENV_GPIO_RANGE_MIN ENV_GPIO_IN_RANGE_MAX
|
||||
default 37 if IDF_TARGET_ESP32S3
|
||||
default 39 if IDF_TARGET_ESP32P4
|
||||
|
||||
if EXAMPLE_SDMMC_BUS_WIDTH_4
|
||||
|
||||
config EXAMPLE_PIN_D1
|
||||
int "D1 GPIO number"
|
||||
range ENV_GPIO_RANGE_MIN ENV_GPIO_IN_RANGE_MAX
|
||||
default 38 if IDF_TARGET_ESP32S3
|
||||
default 40 if IDF_TARGET_ESP32P4
|
||||
|
||||
config EXAMPLE_PIN_D2
|
||||
int "D2 GPIO number"
|
||||
range ENV_GPIO_RANGE_MIN ENV_GPIO_IN_RANGE_MAX
|
||||
default 33 if IDF_TARGET_ESP32S3
|
||||
default 41 if IDF_TARGET_ESP32P4
|
||||
|
||||
config EXAMPLE_PIN_D3
|
||||
int "D3 GPIO number"
|
||||
range ENV_GPIO_RANGE_MIN ENV_GPIO_IN_RANGE_MAX
|
||||
default 34 if IDF_TARGET_ESP32S3
|
||||
default 42 if IDF_TARGET_ESP32P4
|
||||
|
||||
endif # EXAMPLE_SDMMC_BUS_WIDTH_4
|
||||
|
||||
endif # SOC_SDMMC_USE_GPIO_MATRIX
|
||||
|
||||
endif # EXAMPLE_STORAGE_MEDIA_SDMMCCARD
|
||||
endif # EXAMPLE_STORAGE_MEDIA_SDMMC
|
||||
|
||||
endmenu
|
||||
|
@ -19,7 +19,7 @@
|
||||
#include "driver/gpio.h"
|
||||
#include "tinyusb.h"
|
||||
#include "tusb_msc_storage.h"
|
||||
#ifdef CONFIG_EXAMPLE_STORAGE_MEDIA_SDMMCCARD
|
||||
#ifdef CONFIG_EXAMPLE_STORAGE_MEDIA_SDMMC
|
||||
#include "diskio_impl.h"
|
||||
#include "diskio_sdmmc.h"
|
||||
#endif
|
||||
|
@ -1,2 +1,2 @@
|
||||
CONFIG_IDF_TARGET="esp32s3"
|
||||
CONFIG_EXAMPLE_STORAGE_MEDIA_SDMMCCARD=y
|
||||
CONFIG_EXAMPLE_STORAGE_MEDIA_SDMMC=y
|
||||
|
Loading…
x
Reference in New Issue
Block a user