Explorar el Código

hw_support: move rtc_ctrl from driver to hw_support

morris hace 3 años
padre
commit
9ab4abfb46

+ 10 - 9
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)

+ 8 - 0
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"

+ 1 - 1
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"
 

+ 1 - 1
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"
 

+ 1 - 1
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"

+ 1 - 1
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"

+ 0 - 0
components/driver/dedic_gpio.c → components/driver/gpio/dedic_gpio.c


+ 0 - 0
components/driver/gpio.c → components/driver/gpio/gpio.c


+ 0 - 0
components/driver/rtc_io.c → components/driver/gpio/rtc_io.c


+ 0 - 0
components/driver/sigmadelta.c → components/driver/gpio/sigmadelta_gpio.c


+ 1 - 1
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"

+ 1 - 0
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"

+ 0 - 0
components/driver/include/driver/rtc_cntl.h → components/esp_hw_support/include/esp_private/rtc_ctrl.h


+ 1 - 1
components/driver/rtc_module.c → 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

+ 0 - 1
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")

+ 1 - 1
components/esp_system/port/brownout.c

@@ -10,7 +10,7 @@
 #include <stdbool.h>
 
 #include "esp_private/system_internal.h"
-#include "driver/rtc_cntl.h"
+#include "esp_private/rtc_ctrl.h"
 
 #include "esp_rom_sys.h"
 

+ 2 - 2
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"

+ 2 - 2
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*/

+ 2 - 2
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*/

+ 5 - 0
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
 -------------------