diff --git a/cpu/esp32/esp-idf/Kconfig b/cpu/esp32/esp-idf/Kconfig index 86b10841dd..f2622529c1 100644 --- a/cpu/esp32/esp-idf/Kconfig +++ b/cpu/esp32/esp-idf/Kconfig @@ -18,6 +18,7 @@ config MODULE_ESP_IDF Espressif IoT Development Framework. rsource "adc/Kconfig" +rsource "ble/Kconfig" rsource "common/Kconfig" rsource "efuse/Kconfig" rsource "eth/Kconfig" diff --git a/cpu/esp32/esp-idf/Makefile b/cpu/esp32/esp-idf/Makefile index 9dccfe8d6c..fe07dade5f 100644 --- a/cpu/esp32/esp-idf/Makefile +++ b/cpu/esp32/esp-idf/Makefile @@ -8,6 +8,10 @@ ifneq (,$(filter esp_idf_adc,$(USEMODULE))) DIRS += adc endif +ifneq (,$(filter esp_idf_ble,$(USEMODULE))) + DIRS += ble +endif + ifneq (,$(filter esp_idf_common,$(USEMODULE))) DIRS += common endif diff --git a/cpu/esp32/esp-idf/ble/Kconfig b/cpu/esp32/esp-idf/ble/Kconfig new file mode 100644 index 0000000000..1bca53ea6f --- /dev/null +++ b/cpu/esp32/esp-idf/ble/Kconfig @@ -0,0 +1,16 @@ +# 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_BLE + bool + depends on TEST_KCONFIG + depends on MODULE_ESP_IDF + + default y if MODULE_ESP_BLE + + help + ESP-IDF code for Bluetooth LE interface. diff --git a/cpu/esp32/esp-idf/ble/Makefile b/cpu/esp32/esp-idf/ble/Makefile new file mode 100644 index 0000000000..d0e1a4baa6 --- /dev/null +++ b/cpu/esp32/esp-idf/ble/Makefile @@ -0,0 +1,34 @@ +MODULE = esp_idf_ble + +# source files to be compiled for this module +ESP32_SDK_SRC = \ + components/bt/controller/$(CPU_FAM)/bt.c \ + # + +ifeq (,$(filter esp_idf_wifi,$(USEMODULE))) + ESP32_SDK_SRC += \ + components/esp_hw_support/port/$(CPU_FAM)/dport_access.c \ + components/esp_phy/src/phy_init.c \ + components/esp_wifi/src/wifi_init.c \ + # +endif + +INCLUDES += -I$(ESP32_SDK_DIR)/components/esp_event/include +INCLUDES += -I$(ESP32_SDK_DIR)/components/esp_netif/include +INCLUDES += -I$(ESP32_SDK_DIR)/components/esp_phy/include +INCLUDES += -I$(ESP32_SDK_DIR)/components/esp_phy/$(CPU_FAM)/include +INCLUDES += -I$(ESP32_SDK_DIR)/components/esp_wifi/include +INCLUDES += -I$(ESP32_SDK_DIR)/components/nvs_flash/include + +INCLUDES += -I$(ESP32_SDK_DIR)/components/wpa_supplicant/esp_supplicant/include +INCLUDES += -I$(ESP32_SDK_DIR)/components/tcpip_adapter/include + +CFLAGS += -Wno-cast-function-type +CFLAGS += -Wno-implicit-fallthrough + +include $(RIOTBASE)/Makefile.base + +ESP32_SDK_BIN = $(BINDIR)/$(MODULE) + +include ../esp_idf.mk +include ../esp_idf_cflags.mk diff --git a/cpu/esp32/esp-idf/nvs_flash/Makefile b/cpu/esp32/esp-idf/nvs_flash/Makefile index f7fbae5155..aa45b59000 100644 --- a/cpu/esp32/esp-idf/nvs_flash/Makefile +++ b/cpu/esp32/esp-idf/nvs_flash/Makefile @@ -18,6 +18,7 @@ ESP32_SDK_SRCXX = \ # additional include pathes required by this module INCLUDES += -I$(ESP32_SDK_DIR)/components/esp_rom/include +INCLUDES += -I$(ESP32_SDK_DIR)/components/nvs_flash/include include $(RIOTBASE)/Makefile.base