diff --git a/components/driver/CMakeLists.txt b/components/driver/CMakeLists.txt index d22d3f09af..e64af28e18 100644 --- a/components/driver/CMakeLists.txt +++ b/components/driver/CMakeLists.txt @@ -1,12 +1,11 @@ idf_build_get_property(target IDF_TARGET) set(srcs - "gpio.c" + "gpio/gpio.c" + "gpio/rtc_io.c" "gptimer.c" "i2c.c" "ledc.c" - "rtc_io.c" - "rtc_module.c" "sdspi_crc.c" "sdspi_host.c" "sdspi_transaction.c" @@ -39,11 +38,11 @@ if(CONFIG_SOC_GDMA_SUPPORTED) endif() if(CONFIG_SOC_DEDICATED_GPIO_SUPPORTED) - list(APPEND srcs "dedic_gpio.c") + list(APPEND srcs "gpio/dedic_gpio.c") endif() if(CONFIG_SOC_SIGMADELTA_SUPPORTED) - list(APPEND srcs "sigmadelta.c") + list(APPEND srcs "gpio/sigmadelta_gpio.c") endif() if(CONFIG_SOC_RMT_SUPPORTED) @@ -71,6 +70,10 @@ if(CONFIG_SOC_TWAI_SUPPORTED) list(APPEND srcs "twai.c") endif() +if(CONFIG_SOC_USB_SERIAL_JTAG_SUPPORTED) + list(APPEND srcs "usb_serial_jtag.c") +endif() + if(CONFIG_SOC_SPI_SUPPORT_SLAVE_HD_VER2) list(APPEND srcs "spi_slave_hd.c") endif() @@ -96,14 +99,12 @@ if(IDF_TARGET STREQUAL "esp32s2") endif() if(${target} STREQUAL "esp32s3") - list(APPEND srcs "usb_serial_jtag.c" - "touch_sensor_common.c" + list(APPEND srcs "touch_sensor_common.c" "esp32s3/touch_sensor.c") endif() if(IDF_TARGET STREQUAL "esp32c3") - list(APPEND srcs "usb_serial_jtag.c" - "esp32c3/adc2_init_cal.c") + list(APPEND srcs "esp32c3/adc2_init_cal.c") endif() if(BOOTLOADER_BUILD) diff --git a/components/driver/deprecated/driver/rtc_cntl.h b/components/driver/deprecated/driver/rtc_cntl.h new file mode 100644 index 0000000000..3bf2a5d8cf --- /dev/null +++ b/components/driver/deprecated/driver/rtc_cntl.h @@ -0,0 +1,8 @@ +/* + * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +#pragma once +#warning driver/rtc_cntl.h header is no longer used, and will be removed in future versions. +#include "esp_private/rtc_ctrl.h" diff --git a/components/driver/esp32/adc.c b/components/driver/esp32/adc.c index aa062030ce..4a3d6c1584 100644 --- a/components/driver/esp32/adc.c +++ b/components/driver/esp32/adc.c @@ -18,7 +18,7 @@ #include "freertos/timers.h" #include "esp_intr_alloc.h" #include "driver/rtc_io.h" -#include "driver/rtc_cntl.h" +#include "esp_private/rtc_ctrl.h" #include "driver/gpio.h" #include "driver/adc.h" diff --git a/components/driver/esp32/touch_sensor.c b/components/driver/esp32/touch_sensor.c index 5266f84c0d..674e61766c 100644 --- a/components/driver/esp32/touch_sensor.c +++ b/components/driver/esp32/touch_sensor.c @@ -19,7 +19,7 @@ #include "esp_intr_alloc.h" #include "driver/rtc_io.h" #include "driver/touch_pad.h" -#include "driver/rtc_cntl.h" +#include "esp_private/rtc_ctrl.h" #include "driver/gpio.h" #include "esp_check.h" diff --git a/components/driver/esp32s2/touch_sensor.c b/components/driver/esp32s2/touch_sensor.c index 4cf4f639d6..cbf99e263c 100644 --- a/components/driver/esp32s2/touch_sensor.c +++ b/components/driver/esp32s2/touch_sensor.c @@ -17,7 +17,7 @@ #include "esp_intr_alloc.h" #include "driver/rtc_io.h" #include "driver/touch_pad.h" -#include "driver/rtc_cntl.h" +#include "esp_private/rtc_ctrl.h" #include "driver/gpio.h" #include "sdkconfig.h" #include "esp_check.h" diff --git a/components/driver/esp32s3/touch_sensor.c b/components/driver/esp32s3/touch_sensor.c index 0c836e7185..e3d485951e 100644 --- a/components/driver/esp32s3/touch_sensor.c +++ b/components/driver/esp32s3/touch_sensor.c @@ -17,7 +17,7 @@ #include "esp_intr_alloc.h" #include "driver/rtc_io.h" #include "driver/touch_pad.h" -#include "driver/rtc_cntl.h" +#include "esp_private/rtc_ctrl.h" #include "driver/gpio.h" #include "sdkconfig.h" #include "esp_check.h" diff --git a/components/driver/dedic_gpio.c b/components/driver/gpio/dedic_gpio.c similarity index 100% rename from components/driver/dedic_gpio.c rename to components/driver/gpio/dedic_gpio.c diff --git a/components/driver/gpio.c b/components/driver/gpio/gpio.c similarity index 100% rename from components/driver/gpio.c rename to components/driver/gpio/gpio.c diff --git a/components/driver/rtc_io.c b/components/driver/gpio/rtc_io.c similarity index 100% rename from components/driver/rtc_io.c rename to components/driver/gpio/rtc_io.c diff --git a/components/driver/sigmadelta.c b/components/driver/gpio/sigmadelta_gpio.c similarity index 100% rename from components/driver/sigmadelta.c rename to components/driver/gpio/sigmadelta_gpio.c diff --git a/components/driver/touch_sensor_common.c b/components/driver/touch_sensor_common.c index 9566abcdf4..790b467f91 100644 --- a/components/driver/touch_sensor_common.c +++ b/components/driver/touch_sensor_common.c @@ -17,7 +17,7 @@ #include "esp_intr_alloc.h" #include "driver/rtc_io.h" #include "driver/touch_pad.h" -#include "driver/rtc_cntl.h" +#include "esp_private/rtc_ctrl.h" #include "driver/gpio.h" #include "hal/touch_sensor_types.h" #include "hal/touch_sensor_hal.h" diff --git a/components/esp_hw_support/CMakeLists.txt b/components/esp_hw_support/CMakeLists.txt index b2578a4b98..0d06027eab 100644 --- a/components/esp_hw_support/CMakeLists.txt +++ b/components/esp_hw_support/CMakeLists.txt @@ -12,6 +12,7 @@ if(NOT BOOTLOADER_BUILD) "intr_alloc.c" "mac_addr.c" "periph_ctrl.c" + "rtc_module.c" "sleep_modes.c" "sleep_gpio.c" "sleep_mac_bb.c" diff --git a/components/driver/include/driver/rtc_cntl.h b/components/esp_hw_support/include/esp_private/rtc_ctrl.h similarity index 100% rename from components/driver/include/driver/rtc_cntl.h rename to components/esp_hw_support/include/esp_private/rtc_ctrl.h diff --git a/components/driver/rtc_module.c b/components/esp_hw_support/rtc_module.c similarity index 99% rename from components/driver/rtc_module.c rename to components/esp_hw_support/rtc_module.c index 628ed44372..76bdd26e8c 100644 --- a/components/driver/rtc_module.c +++ b/components/esp_hw_support/rtc_module.c @@ -18,7 +18,7 @@ #include "freertos/timers.h" #include "esp_intr_alloc.h" #include "sys/lock.h" -#include "driver/rtc_cntl.h" +#include "esp_private/rtc_ctrl.h" #ifndef NDEBUG // Enable built-in checks in queue.h in debug builds diff --git a/components/esp_system/CMakeLists.txt b/components/esp_system/CMakeLists.txt index 5bd2af9ab6..fb0cfd6c8f 100644 --- a/components/esp_system/CMakeLists.txt +++ b/components/esp_system/CMakeLists.txt @@ -41,7 +41,6 @@ else() # should be removable once using component init functions # link-time registration is used. # [refactor-todo] requires "driver" for headers: - # - rtc_cntl.h # - spi_common_internal.h pthread bootloader_support efuse driver LDFRAGMENTS "linker.lf" "app.lf") diff --git a/components/esp_system/port/brownout.c b/components/esp_system/port/brownout.c index 3f8500a58c..21ec6800be 100644 --- a/components/esp_system/port/brownout.c +++ b/components/esp_system/port/brownout.c @@ -10,7 +10,7 @@ #include #include "esp_private/system_internal.h" -#include "driver/rtc_cntl.h" +#include "esp_private/rtc_ctrl.h" #include "esp_rom_sys.h" diff --git a/components/esp_system/xt_wdt.c b/components/esp_system/xt_wdt.c index d3828df47c..67d9977fb8 100644 --- a/components/esp_system/xt_wdt.c +++ b/components/esp_system/xt_wdt.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -17,7 +17,7 @@ #if SOC_XT_WDT_SUPPORTED -#include "driver/rtc_cntl.h" +#include "esp_private/rtc_ctrl.h" #include "hal/xt_wdt_hal.h" #include "hal/xt_wdt_ll.h" #include "soc/rtc.h" diff --git a/components/soc/esp32c3/include/soc/periph_defs.h b/components/soc/esp32c3/include/soc/periph_defs.h index df5d4fbc07..0ff884736c 100644 --- a/components/soc/esp32c3/include/soc/periph_defs.h +++ b/components/soc/esp32c3/include/soc/periph_defs.h @@ -68,8 +68,8 @@ typedef enum { ETS_UART1_INTR_SOURCE, /**< interrupt of UART1, level*/ ETS_LEDC_INTR_SOURCE, /**< interrupt of LED PWM, level*/ ETS_EFUSE_INTR_SOURCE, /**< interrupt of efuse, level, not likely to use*/ - ETS_TWAI_INTR_SOURCE, /**< interrupt of can, level*/ - ETS_USB_SERIAL_JTAG_INTR_SOURCE, /**< interrupt of USB, level*/ + ETS_TWAI_INTR_SOURCE, /**< interrupt of can, level*/ + ETS_USB_SERIAL_JTAG_INTR_SOURCE, /**< interrupt of USJ, level*/ ETS_RTC_CORE_INTR_SOURCE, /**< interrupt of rtc core, level, include rtc watchdog*/ ETS_RMT_INTR_SOURCE, /**< interrupt of remote controller, level*/ ETS_I2C_EXT0_INTR_SOURCE, /**< interrupt of I2C controller1, level*/ diff --git a/components/soc/esp32h2/include/soc/periph_defs.h b/components/soc/esp32h2/include/soc/periph_defs.h index f475efb3a6..007744d75d 100644 --- a/components/soc/esp32h2/include/soc/periph_defs.h +++ b/components/soc/esp32h2/include/soc/periph_defs.h @@ -68,8 +68,8 @@ typedef enum { ETS_UART1_INTR_SOURCE, /**< interrupt of UART1, level*/ ETS_LEDC_INTR_SOURCE, /**< interrupt of LED PWM, level*/ ETS_EFUSE_INTR_SOURCE, /**< interrupt of efuse, level, not likely to use*/ - ETS_TWAI_INTR_SOURCE, /**< interrupt of twai, level*/ - ETS_USB_INTR_SOURCE, /**< interrupt of USB, level*/ + ETS_TWAI_INTR_SOURCE, /**< interrupt of twai, level*/ + ETS_USB_SERIAL_JTAG_INTR_SOURCE, /**< interrupt of USJ, level*/ ETS_RTC_CORE_INTR_SOURCE, /**< interrupt of rtc core, level, include rtc watchdog*/ ETS_RMT_INTR_SOURCE, /**< interrupt of remote controller, level*/ ETS_I2C_EXT0_INTR_SOURCE, /**< interrupt of I2C controller1, level*/ diff --git a/docs/en/migration-guides/peripherals.rst b/docs/en/migration-guides/peripherals.rst index 12ab72a558..14aa10c140 100644 --- a/docs/en/migration-guides/peripherals.rst +++ b/docs/en/migration-guides/peripherals.rst @@ -8,6 +8,11 @@ As usual, peripheral clock gating is still handled by driver itself, users don't However, for advanced users who implement their own drivers based on ``hal`` and ``soc`` components, the previous clock gating include path has been changed from ``driver/periph_ctrl.h`` to ``esp_private/periph_ctrl.h``. +RTC Subsystem Control +--------------------- + +RTC control APIs have been moved from ``driver/rtc_cntl.h`` to ``esp_private/rtc_ctrl.h``. + SPI Flash Interface -------------------