diff --git a/cpu/esp32/Makefile.include b/cpu/esp32/Makefile.include index 3ad8e4d909..39732eb09b 100644 --- a/cpu/esp32/Makefile.include +++ b/cpu/esp32/Makefile.include @@ -98,6 +98,10 @@ ifneq (,$(filter esp_idf_spi_flash,$(USEMODULE))) INCLUDES += -I$(ESP32_SDK_DIR)/components/spi_flash/include endif +ifneq (,$(filter esp_idf_usb,$(USEMODULE))) + INCLUDES += -I$(ESP32_SDK_DIR)/components/usb/include +endif + ifneq (,$(filter esp_wifi_any,$(USEMODULE))) INCLUDES += -I$(ESP32_SDK_DIR)/components/bootloader_support/include INCLUDES += -I$(ESP32_SDK_DIR)/components/esp_eth/include diff --git a/cpu/esp32/esp-idf/Kconfig b/cpu/esp32/esp-idf/Kconfig index f2622529c1..7702960912 100644 --- a/cpu/esp32/esp-idf/Kconfig +++ b/cpu/esp32/esp-idf/Kconfig @@ -28,5 +28,6 @@ rsource "heap/Kconfig" rsource "nvs_flash/Kconfig" rsource "spi_flash/Kconfig" rsource "spi_ram/Kconfig" +rsource "usb/Kconfig" rsource "wifi/Kconfig" rsource "wpa_supplicant/Kconfig" diff --git a/cpu/esp32/esp-idf/Makefile b/cpu/esp32/esp-idf/Makefile index fe07dade5f..21ccf13245 100644 --- a/cpu/esp32/esp-idf/Makefile +++ b/cpu/esp32/esp-idf/Makefile @@ -48,6 +48,10 @@ ifneq (,$(filter esp_idf_spi_ram,$(USEMODULE))) DIRS += spi_ram endif +ifneq (,$(filter esp_idf_usb,$(USEMODULE))) + DIRS += usb +endif + ifneq (,$(filter esp_idf_wifi,$(USEMODULE))) DIRS += wifi endif diff --git a/cpu/esp32/esp-idf/usb/Kconfig b/cpu/esp32/esp-idf/usb/Kconfig new file mode 100644 index 0000000000..db41973f8f --- /dev/null +++ b/cpu/esp32/esp-idf/usb/Kconfig @@ -0,0 +1,14 @@ +# Copyright (c) 2022 Gunar Schorcht +# +# This file is subject to the terms and conditions of the GNU Lesser +# General Public License v2.1. See the file LICENSE in the top level +# directory for more details. +# + +config MODULE_ESP_IDF_USB + bool + depends on TEST_KCONFIG + depends on MODULE_ESP_IDF + default y if MODULE_PERIPH_USBDEV + help + ESP-IDF code for USB. diff --git a/cpu/esp32/esp-idf/usb/Makefile b/cpu/esp32/esp-idf/usb/Makefile new file mode 100644 index 0000000000..3261f5fc13 --- /dev/null +++ b/cpu/esp32/esp-idf/usb/Makefile @@ -0,0 +1,17 @@ +MODULE = esp_idf_usb + +# source files to be compiled for this module +ESP32_SDK_SRC = \ + components/hal/usb_hal.c \ + components/hal/usb_phy_hal.c \ + components/soc/$(CPU_FAM)/usb_periph.c \ + components/soc/$(CPU_FAM)/usb_phy_periph.c \ + components/usb/usb_phy.c \ + # + +include $(RIOTBASE)/Makefile.base + +ESP32_SDK_BIN = $(BINDIR)/$(MODULE) + +include ../esp_idf.mk +include ../esp_idf_cflags.mk