diff --git a/components/driver/CMakeLists.txt b/components/driver/CMakeLists.txt index 1919eaa5f8..8bb1696cb5 100644 --- a/components/driver/CMakeLists.txt +++ b/components/driver/CMakeLists.txt @@ -45,11 +45,6 @@ if(CONFIG_SOC_SDM_SUPPORTED) list(APPEND srcs "deprecated/sigma_delta_legacy.c") endif() -# Temperature Sensor related source files -if(CONFIG_SOC_TEMP_SENSOR_SUPPORTED) - list(APPEND srcs "deprecated/rtc_temperature_legacy.c") -endif() - # Touch Sensor related source files if(CONFIG_SOC_TOUCH_SENSOR_SUPPORTED) if(CONFIG_SOC_TOUCH_SENSOR_VERSION LESS 3) diff --git a/components/driver/Kconfig b/components/driver/Kconfig index f577eda254..d2e1d4cb91 100644 --- a/components/driver/Kconfig +++ b/components/driver/Kconfig @@ -145,23 +145,6 @@ menu "Driver Configurations" This configuration option allows the user to bypass the conflict check mechanism with legacy code. endmenu # Legacy SDM Driver Configurationss - menu "Legacy Temperature Sensor Driver Configurations" - depends on SOC_TEMP_SENSOR_SUPPORTED - config TEMP_SENSOR_SUPPRESS_DEPRECATE_WARN - bool "Suppress legacy driver deprecated warning" - default n - help - whether to suppress the deprecation warnings when using legacy temperature sensor driver - (driver/temp_sensor.h). If you want to continue using the legacy driver, - and don't want to see related deprecation warnings, you can enable this option. - - config TEMP_SENSOR_SKIP_LEGACY_CONFLICT_CHECK - bool "Skip legacy conflict check" - default n - help - This configuration option allows the user to bypass the conflict check mechanism with legacy code. - endmenu # Legacy Temperature Sensor Driver Configurationss - menu "Legacy Touch Sensor Driver Configurations" depends on SOC_TOUCH_SENSOR_SUPPORTED config TOUCH_SUPPRESS_DEPRECATE_WARN diff --git a/components/driver/deprecated/driver/temp_sensor.h b/components/driver/deprecated/driver/temp_sensor.h deleted file mode 100644 index 546a9cc43d..0000000000 --- a/components/driver/deprecated/driver/temp_sensor.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2010-2021 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#pragma once - -#include -#include "sdkconfig.h" -#include "esp_err.h" -#include "driver/temp_sensor_types_legacy.h" - -#if !CONFIG_TEMP_SENSOR_SUPPRESS_DEPRECATE_WARN -#warning "legacy temperature sensor driver is deprecated, please migrate to driver/temperature_sensor.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Set parameter of temperature sensor. - * @param tsens - * @return - * - ESP_OK Success - */ -esp_err_t temp_sensor_set_config(temp_sensor_config_t tsens); - -/** - * @brief Get parameter of temperature sensor. - * @param tsens - * @return - * - ESP_OK Success - */ -esp_err_t temp_sensor_get_config(temp_sensor_config_t *tsens); - -/** - * @brief Start temperature sensor measure. - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_STATE if temperature sensor is started already. - */ -esp_err_t temp_sensor_start(void); - -/** - * @brief Stop temperature sensor measure. - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_STATE if temperature sensor is stopped already. - */ -esp_err_t temp_sensor_stop(void); - -/** - * @brief Read temperature sensor raw data. - * @param tsens_out Pointer to raw data, Range: 0 ~ 255 - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG `tsens_out` is NULL - * - ESP_ERR_INVALID_STATE temperature sensor dont start - */ -esp_err_t temp_sensor_read_raw(uint32_t *tsens_out); - -/** - * @brief Read temperature sensor data that is converted to degrees Celsius. - * @note Should not be called from interrupt. - * @param celsius The measure output value. - * @return - * - ESP_OK Success - * - ESP_ERR_INVALID_ARG ARG is NULL. - * - ESP_ERR_INVALID_STATE The ambient temperature is out of range. - */ -esp_err_t temp_sensor_read_celsius(float *celsius); - -#ifdef __cplusplus -} -#endif diff --git a/components/driver/deprecated/driver/temp_sensor_types_legacy.h b/components/driver/deprecated/driver/temp_sensor_types_legacy.h deleted file mode 100644 index 842a6263c4..0000000000 --- a/components/driver/deprecated/driver/temp_sensor_types_legacy.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2010-2021 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#pragma once - -#include -#include "esp_err.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum { - TSENS_DAC_L0 = 0, /*!< offset = -2, measure range: 50℃ ~ 125℃, error < 3℃. */ - TSENS_DAC_L1, /*!< offset = -1, measure range: 20℃ ~ 100℃, error < 2℃. */ - TSENS_DAC_L2, /*!< offset = 0, measure range:-10℃ ~ 80℃, error < 1℃. */ - TSENS_DAC_L3, /*!< offset = 1, measure range:-30℃ ~ 50℃, error < 2℃. */ - TSENS_DAC_L4, /*!< offset = 2, measure range:-40℃ ~ 20℃, error < 3℃. */ - TSENS_DAC_MAX, - TSENS_DAC_DEFAULT = TSENS_DAC_L2, -} temp_sensor_dac_offset_t; - -/** - * @brief Configuration for temperature sensor reading - */ -typedef struct { - temp_sensor_dac_offset_t dac_offset; /*!< The temperature measurement range is configured with a built-in temperature offset DAC. */ - uint8_t clk_div; /*!< Default: 6 */ -} temp_sensor_config_t; - -#define TSENS_CONFIG_DEFAULT() {.dac_offset = TSENS_DAC_L2, \ - .clk_div = 6} - -#ifdef __cplusplus -} -#endif diff --git a/components/driver/deprecated/rtc_temperature_legacy.c b/components/driver/deprecated/rtc_temperature_legacy.c deleted file mode 100644 index 459ff79481..0000000000 --- a/components/driver/deprecated/rtc_temperature_legacy.c +++ /dev/null @@ -1,179 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2016-2024 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include -#include "sdkconfig.h" -#include "esp_types.h" -#include "esp_log.h" -#include "esp_check.h" -#include "esp_compiler.h" -#include "freertos/FreeRTOS.h" -#include "esp_private/regi2c_ctrl.h" -#include "soc/regi2c_saradc.h" -#include "esp_efuse_rtc_calib.h" -#include "hal/temperature_sensor_ll.h" -#include "driver/temp_sensor_types_legacy.h" -#include "esp_private/periph_ctrl.h" -#include "esp_private/sar_periph_ctrl.h" - -static const char *TAG = "tsens"; - -#define TSENS_ADC_FACTOR (0.4386) -#define TSENS_DAC_FACTOR (27.88) -#define TSENS_SYS_OFFSET (20.52) - -typedef struct { - int index; - int offset; - int reg_val; - int range_min; - int range_max; - int error_max; -} tsens_dac_offset_t; - -static const tsens_dac_offset_t dac_offset[TSENS_DAC_MAX] = { - /* DAC Offset reg_val min max error */ - {TSENS_DAC_L0, -2, 5, 50, 125, 3}, - {TSENS_DAC_L1, -1, 7, 20, 100, 2}, - {TSENS_DAC_L2, 0, 15, -10, 80, 1}, - {TSENS_DAC_L3, 1, 11, -30, 50, 2}, - {TSENS_DAC_L4, 2, 10, -40, 20, 3}, -}; - -typedef enum { - TSENS_HW_STATE_UNCONFIGURED, - TSENS_HW_STATE_CONFIGURED, - TSENS_HW_STATE_STARTED, -} tsens_hw_state_t; - -static tsens_hw_state_t tsens_hw_state = TSENS_HW_STATE_UNCONFIGURED; - -static float s_deltaT = NAN; // Unused number -static int s_tsens_range; - -esp_err_t temp_sensor_set_config(temp_sensor_config_t tsens) -{ - esp_err_t err = ESP_OK; - if (tsens_hw_state == TSENS_HW_STATE_STARTED) { - ESP_LOGE(TAG, "Do not configure the temp sensor when it's running!"); - err = ESP_ERR_INVALID_STATE; - } - temperature_sensor_ll_set_clk_div(tsens.clk_div); - temp_sensor_sync_tsens_idx(tsens.dac_offset); - s_tsens_range = dac_offset[tsens.dac_offset].reg_val; - ESP_LOGI(TAG, "Config range [%d°C ~ %d°C], error < %d°C", - dac_offset[tsens.dac_offset].range_min, - dac_offset[tsens.dac_offset].range_max, - dac_offset[tsens.dac_offset].error_max); - tsens_hw_state = TSENS_HW_STATE_CONFIGURED; - return err; -} - -esp_err_t temp_sensor_get_config(temp_sensor_config_t *tsens) -{ - ESP_RETURN_ON_FALSE(tsens != NULL, ESP_ERR_INVALID_ARG, TAG, "no tsens specified"); - tsens->dac_offset = temperature_sensor_ll_get_offset(); - for (int i = TSENS_DAC_L0; i < TSENS_DAC_MAX; i++) { - if ((int)tsens->dac_offset == dac_offset[i].reg_val) { - tsens->dac_offset = dac_offset[i].index; - break; - } - } - tsens->clk_div = temperature_sensor_ll_get_clk_div(); - return ESP_OK; -} - -esp_err_t temp_sensor_start(void) -{ - esp_err_t err = ESP_OK; - if (tsens_hw_state != TSENS_HW_STATE_CONFIGURED) { - ESP_LOGE(TAG, "Is already running or not be configured"); - err = ESP_ERR_INVALID_STATE; - } - temperature_sensor_power_acquire(); - temperature_sensor_ll_set_range(s_tsens_range); - temperature_sensor_ll_clk_sel(TEMPERATURE_SENSOR_CLK_SRC_DEFAULT); - tsens_hw_state = TSENS_HW_STATE_STARTED; - return err; -} - -esp_err_t temp_sensor_stop(void) -{ - temperature_sensor_power_release(); - tsens_hw_state = TSENS_HW_STATE_CONFIGURED; - return ESP_OK; -} - -esp_err_t temp_sensor_read_raw(uint32_t *tsens_out) -{ - ESP_RETURN_ON_FALSE(tsens_out != NULL, ESP_ERR_INVALID_ARG, TAG, "no tsens_out specified"); - if (tsens_hw_state != TSENS_HW_STATE_STARTED) { - ESP_LOGE(TAG, "Has not been started"); - return ESP_ERR_INVALID_STATE; - } - ESP_COMPILER_DIAGNOSTIC_PUSH_IGNORE("-Wanalyzer-use-of-uninitialized-value") // False-positive detection. TODO GCC-366 - *tsens_out = temperature_sensor_ll_get_raw_value(); - ESP_COMPILER_DIAGNOSTIC_POP("-Wanalyzer-use-of-uninitialized-value") - return ESP_OK; -} - -static esp_err_t read_delta_t_from_efuse(void) -{ - ESP_RETURN_ON_ERROR(esp_efuse_rtc_calib_get_tsens_val(&s_deltaT), TAG, "Calibration error"); - ESP_LOGD(TAG, "s_deltaT = %f", s_deltaT); - return ESP_OK; -} - -static float parse_temp_sensor_raw_value(uint32_t tsens_raw) -{ - if (isnan(s_deltaT)) { //suggests that the value is not initialized - read_delta_t_from_efuse(); - } - float result = tsens_raw - s_deltaT / 10.0; - return result; -} - -esp_err_t temp_sensor_read_celsius(float *celsius) -{ - ESP_RETURN_ON_FALSE(celsius != NULL, ESP_ERR_INVALID_ARG, TAG, "celsius points to nothing"); - if (tsens_hw_state != TSENS_HW_STATE_STARTED) { - ESP_LOGE(TAG, "Has not been started"); - return ESP_ERR_INVALID_STATE; - } - temp_sensor_config_t tsens; - temp_sensor_get_config(&tsens); - bool range_changed; - uint16_t tsens_out = temp_sensor_get_raw_value(&range_changed); - *celsius = parse_temp_sensor_raw_value(tsens_out); - if (*celsius < TEMPERATURE_SENSOR_LL_MEASURE_MIN || *celsius > TEMPERATURE_SENSOR_LL_MEASURE_MAX) { - ESP_LOGE(TAG, "Exceeding temperature measure range."); - return ESP_ERR_INVALID_STATE; - } - if (range_changed) { - temp_sensor_get_config(&tsens); - } - return ESP_OK; -} - -#if !CONFIG_TEMP_SENSOR_SKIP_LEGACY_CONFLICT_CHECK -/** - * @brief This function will be called during start up, to check that this legacy temp sensor driver is not running along with the new driver - */ -__attribute__((constructor)) -static void check_legacy_temp_sensor_driver_conflict(void) -{ - // This function was declared as weak here. temperature_sensor driver has one implementation. - // So if temperature_sensor driver is not linked in, then `temperature_sensor_install()` should be NULL at runtime. - extern __attribute__((weak)) esp_err_t temperature_sensor_install(const void *tsens_config, void **ret_tsens); - if ((void *)temperature_sensor_install != NULL) { - ESP_EARLY_LOGE(TAG, "CONFLICT! driver_ng is not allowed to be used with the legacy driver"); - abort(); - } - ESP_EARLY_LOGW(TAG, "legacy driver is deprecated, please migrate to `driver/temperature_sensor.h`"); -} -#endif //CONFIG_TEMP_SENSOR_SKIP_LEGACY_CONFLICT_CHECK diff --git a/components/driver/test_apps/.build-test-rules.yml b/components/driver/test_apps/.build-test-rules.yml index 87ea3c7bf8..f82656e047 100644 --- a/components/driver/test_apps/.build-test-rules.yml +++ b/components/driver/test_apps/.build-test-rules.yml @@ -34,10 +34,6 @@ components/driver/test_apps/legacy_rmt_driver: depends_filepatterns: - components/driver/deprecated/**/*rmt* -components/driver/test_apps/legacy_rtc_temp_driver: - disable: - - if: SOC_TEMP_SENSOR_SUPPORTED != 1 - components/driver/test_apps/legacy_sigma_delta_driver: disable: - if: SOC_SDM_SUPPORTED != 1 diff --git a/components/driver/test_apps/legacy_rtc_temp_driver/CMakeLists.txt b/components/driver/test_apps/legacy_rtc_temp_driver/CMakeLists.txt deleted file mode 100644 index 16950e2f79..0000000000 --- a/components/driver/test_apps/legacy_rtc_temp_driver/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -# This is the project CMakeLists.txt file for the test subproject -cmake_minimum_required(VERSION 3.16) - -# "Trim" the build. Include the minimal set of components, main, and anything it depends on. -set(COMPONENTS main) - -include($ENV{IDF_PATH}/tools/cmake/project.cmake) -project(legacy_rtc_temp_driver_test) diff --git a/components/driver/test_apps/legacy_rtc_temp_driver/README.md b/components/driver/test_apps/legacy_rtc_temp_driver/README.md deleted file mode 100644 index cc9654f295..0000000000 --- a/components/driver/test_apps/legacy_rtc_temp_driver/README.md +++ /dev/null @@ -1,2 +0,0 @@ -| Supported Targets | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-C61 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | -| ----------------- | -------- | -------- | -------- | -------- | --------- | -------- | -------- | -------- | -------- | diff --git a/components/driver/test_apps/legacy_rtc_temp_driver/main/CMakeLists.txt b/components/driver/test_apps/legacy_rtc_temp_driver/main/CMakeLists.txt deleted file mode 100644 index 82b110f259..0000000000 --- a/components/driver/test_apps/legacy_rtc_temp_driver/main/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -set(srcs "test_app_main.c" - "test_rtc_temp_driver.c") - -# In order for the cases defined by `TEST_CASE` to be linked into the final elf, -# the component can be registered as WHOLE_ARCHIVE -idf_component_register(SRCS ${srcs} - PRIV_REQUIRES unity driver - WHOLE_ARCHIVE) diff --git a/components/driver/test_apps/legacy_rtc_temp_driver/main/test_app_main.c b/components/driver/test_apps/legacy_rtc_temp_driver/main/test_app_main.c deleted file mode 100644 index 183a88ae3c..0000000000 --- a/components/driver/test_apps/legacy_rtc_temp_driver/main/test_app_main.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "unity.h" -#include "unity_test_runner.h" -#include "esp_heap_caps.h" - -#define TEST_MEMORY_LEAK_THRESHOLD (-600) - -static size_t before_free_8bit; -static size_t before_free_32bit; - -static void check_leak(size_t before_free, size_t after_free, const char *type) -{ - ssize_t delta = after_free - before_free; - printf("MALLOC_CAP_%s: Before %u bytes free, After %u bytes free (delta %d)\n", type, before_free, after_free, delta); - TEST_ASSERT_MESSAGE(delta >= TEST_MEMORY_LEAK_THRESHOLD, "memory leak"); -} - -void setUp(void) -{ - before_free_8bit = heap_caps_get_free_size(MALLOC_CAP_8BIT); - before_free_32bit = heap_caps_get_free_size(MALLOC_CAP_32BIT); -} - -void tearDown(void) -{ - size_t after_free_8bit = heap_caps_get_free_size(MALLOC_CAP_8BIT); - size_t after_free_32bit = heap_caps_get_free_size(MALLOC_CAP_32BIT); - check_leak(before_free_8bit, after_free_8bit, "8BIT"); - check_leak(before_free_32bit, after_free_32bit, "32BIT"); -} - -void app_main(void) -{ - unity_run_menu(); -} diff --git a/components/driver/test_apps/legacy_rtc_temp_driver/main/test_rtc_temp_driver.c b/components/driver/test_apps/legacy_rtc_temp_driver/main/test_rtc_temp_driver.c deleted file mode 100644 index da5c4e96e2..0000000000 --- a/components/driver/test_apps/legacy_rtc_temp_driver/main/test_rtc_temp_driver.c +++ /dev/null @@ -1,66 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ -#include -#include -#include "esp_log.h" -#include "unity.h" -#include "driver/temp_sensor.h" - -TEST_CASE("Temperature_legacy_workflow_test", "[hw_timer]") -{ - printf("Initializing Temperature sensor\n"); - float tsens_out; - temp_sensor_config_t temp_sensor = TSENS_CONFIG_DEFAULT(); - TEST_ESP_OK(temp_sensor_get_config(&temp_sensor)); - printf("default dac %d, clk_div %d\n", temp_sensor.dac_offset, temp_sensor.clk_div); - temp_sensor.dac_offset = TSENS_DAC_DEFAULT; // DEFAULT: range:-10℃ ~ 80℃, error < 1℃. - TEST_ESP_OK(temp_sensor_set_config(temp_sensor)); - TEST_ESP_OK(temp_sensor_start()); - printf("Temperature sensor started\n"); - TEST_ESP_OK(temp_sensor_read_celsius(&tsens_out)); - printf("Temperature out celsius %f°C\n", tsens_out); - TEST_ESP_OK(temp_sensor_stop()); -#if !CONFIG_IDF_TARGET_ESP32H2 // disable on eps32h2, seems have some issues on esp32h2 - temp_sensor.dac_offset = TSENS_DAC_L3; - TEST_ESP_OK(temp_sensor_set_config(temp_sensor)); - TEST_ESP_OK(temp_sensor_start()); - printf("Temperature sensor started again\n"); - TEST_ESP_OK(temp_sensor_read_celsius(&tsens_out)); - printf("Temperature out celsius %f°C\n", tsens_out); - TEST_ESP_OK(temp_sensor_stop()); -#endif -} - -TEST_CASE("Temperature legacy double start error cause test", "[temperature_sensor]") -{ - printf("Initializing Temperature sensor\n"); - temp_sensor_config_t temp_sensor = TSENS_CONFIG_DEFAULT(); - TEST_ESP_OK(temp_sensor_set_config(temp_sensor)); - TEST_ESP_OK(temp_sensor_start()); - TEST_ESP_ERR(ESP_ERR_INVALID_STATE, temp_sensor_start()); - TEST_ESP_OK(temp_sensor_stop()); -} - -TEST_CASE("Temperature legacy double Start-Stop test", "[temperature_sensor]") -{ - printf("Initializing Temperature sensor\n"); - float tsens_out; - temp_sensor_config_t temp_sensor = TSENS_CONFIG_DEFAULT(); - TEST_ESP_OK(temp_sensor_get_config(&temp_sensor)); - printf("default dac %d, clk_div %d\n", temp_sensor.dac_offset, temp_sensor.clk_div); - temp_sensor.dac_offset = TSENS_DAC_DEFAULT; // DEFAULT: range:-10℃ ~ 80℃, error < 1℃. - TEST_ESP_OK(temp_sensor_set_config(temp_sensor)); - TEST_ESP_OK(temp_sensor_start()); - printf("Temperature sensor started\n"); - TEST_ESP_OK(temp_sensor_read_celsius(&tsens_out)); - printf("Temperature out celsius %f°C\n", tsens_out); - TEST_ESP_OK(temp_sensor_stop()); - TEST_ESP_OK(temp_sensor_start()); - printf("Temperature sensor started again\n"); - TEST_ESP_OK(temp_sensor_read_celsius(&tsens_out)); - printf("Temperature out celsius %f°C\n", tsens_out); - TEST_ESP_OK(temp_sensor_stop()); -} diff --git a/components/driver/test_apps/legacy_rtc_temp_driver/pytest_legacy_temp_sensor_driver.py b/components/driver/test_apps/legacy_rtc_temp_driver/pytest_legacy_temp_sensor_driver.py deleted file mode 100644 index 47646ffe48..0000000000 --- a/components/driver/test_apps/legacy_rtc_temp_driver/pytest_legacy_temp_sensor_driver.py +++ /dev/null @@ -1,22 +0,0 @@ -# SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD -# SPDX-License-Identifier: CC0-1.0 -import pytest -from pytest_embedded import Dut -from pytest_embedded_idf.utils import idf_parametrize - - -@pytest.mark.generic -@pytest.mark.parametrize( - 'config', - [ - 'release', - ], - indirect=True, -) -@idf_parametrize( - 'target', - ['esp32s2', 'esp32c3', 'esp32s3', 'esp32c2', 'esp32c6', 'esp32h2', 'esp32p4', 'esp32c5', 'esp32c61'], - indirect=['target'], -) -def test_legacy_temp_sensor_driver(dut: Dut) -> None: - dut.run_all_single_board_cases(timeout=120) diff --git a/components/driver/test_apps/legacy_rtc_temp_driver/sdkconfig.ci.release b/components/driver/test_apps/legacy_rtc_temp_driver/sdkconfig.ci.release deleted file mode 100644 index 91d93f163e..0000000000 --- a/components/driver/test_apps/legacy_rtc_temp_driver/sdkconfig.ci.release +++ /dev/null @@ -1,5 +0,0 @@ -CONFIG_PM_ENABLE=y -CONFIG_FREERTOS_USE_TICKLESS_IDLE=y -CONFIG_COMPILER_OPTIMIZATION_SIZE=y -CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y -CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT=y diff --git a/components/driver/test_apps/legacy_rtc_temp_driver/sdkconfig.defaults b/components/driver/test_apps/legacy_rtc_temp_driver/sdkconfig.defaults deleted file mode 100644 index f8fdd36201..0000000000 --- a/components/driver/test_apps/legacy_rtc_temp_driver/sdkconfig.defaults +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_ESP_TASK_WDT_EN=n -CONFIG_TEMP_SENSOR_SUPPRESS_DEPRECATE_WARN=y diff --git a/docs/en/migration-guides/release-5.x/5.0/peripherals.rst b/docs/en/migration-guides/release-5.x/5.0/peripherals.rst index 7f6ebae7af..54267bba62 100644 --- a/docs/en/migration-guides/release-5.x/5.0/peripherals.rst +++ b/docs/en/migration-guides/release-5.x/5.0/peripherals.rst @@ -294,12 +294,14 @@ LEDC .. only:: SOC_TEMP_SENSOR_SUPPORTED - Temperature Sensor Driver - ------------------------- + .. _deprecate_tsens_legacy_driver: + + Legacy Temperature Sensor Driver is Deprecated + ---------------------------------------------- The temperature sensor driver has been redesigned and it is recommended to use the new driver. However, the old driver is still available but cannot be used with the new driver simultaneously. - The new driver can be included via ``driver/temperature_sensor.h``. The old driver is still available in the previous include path ``driver/temp_sensor.h``. However, including ``driver/temp_sensor.h`` triggers the build warning below by default. The warning can be suppressed by enabling the menuconfig option :ref:`CONFIG_TEMP_SENSOR_SUPPRESS_DEPRECATE_WARN`. + The new driver can be included via ``driver/temperature_sensor.h``. The old driver is still available in the previous include path ``driver/temp_sensor.h``. However, including ``driver/temp_sensor.h`` triggers the build warning below by default. The warning can be suppressed by enabling the menuconfig option ``CONFIG_TEMP_SENSOR_SUPPRESS_DEPRECATE_WARN``. .. code-block:: text diff --git a/docs/en/migration-guides/release-6.x/6.0/peripherals.rst b/docs/en/migration-guides/release-6.x/6.0/peripherals.rst index 01755deac1..c1b84a2592 100644 --- a/docs/en/migration-guides/release-6.x/6.0/peripherals.rst +++ b/docs/en/migration-guides/release-6.x/6.0/peripherals.rst @@ -88,3 +88,10 @@ SDMMC ------------------------------------ The legacy DAC driver ``driver/dac.h`` is deprecated since version 5.1 (see :ref:`deprecate_dac_legacy_driver`). Starting from version 6.0, the legacy driver is completely removed. The new driver is placed in the :component:`esp_driver_dac`, and the header file path is ``driver/dac_oneshot.h``, ``driver/dac_continuous.h`` and ``driver/dac_cosine.h``. + +.. only:: SOC_TEMP_SENSOR_SUPPORTED + + Legacy Temperature Senor Driver is Removed + ------------------------------------------ + + The legacy temperature sensor driver ``driver/temp_sensor.h`` is deprecated since version 5.0 (see :ref:`deprecate_tsens_legacy_driver`). Starting from version 6.0, the legacy driver is completely removed. The new driver is placed in the :component:`esp_driver_tsens`, and the header file path is ``driver/temperature_sensor.h``. diff --git a/docs/zh_CN/migration-guides/release-5.x/5.0/peripherals.rst b/docs/zh_CN/migration-guides/release-5.x/5.0/peripherals.rst index 8744f530cd..b74468bf7d 100644 --- a/docs/zh_CN/migration-guides/release-5.x/5.0/peripherals.rst +++ b/docs/zh_CN/migration-guides/release-5.x/5.0/peripherals.rst @@ -294,12 +294,14 @@ LEDC .. only:: SOC_TEMP_SENSOR_SUPPORTED - 温度传感器驱动 + .. _deprecate_tsens_legacy_driver: + + 旧版温度传感器驱动已被弃用 ------------------------------------------------------------ 温度传感器的驱动已更新,推荐用户使用新驱动。旧版驱动仍然可用,但是无法与新驱动同时使用。 - 新驱动的头文件引用路径为 ``driver/temperature_sensor.h``。旧版驱动仍然可用,保留在引用路径 ``driver/temp_sensor.h`` 中。但是,引用路径 ``driver/temp_sensor.h`` 会默认触发如下编译警告,可通过设置 Kconfig 选项 :ref:`CONFIG_TEMP_SENSOR_SUPPRESS_DEPRECATE_WARN` 来关闭该警告。 + 新驱动的头文件引用路径为 ``driver/temperature_sensor.h``。旧版驱动仍然可用,保留在引用路径 ``driver/temp_sensor.h`` 中。但是,引用路径 ``driver/temp_sensor.h`` 会默认触发如下编译警告,可通过设置 Kconfig 选项 ``CONFIG_TEMP_SENSOR_SUPPRESS_DEPRECATE_WARN`` 来关闭该警告。 .. code-block:: text diff --git a/docs/zh_CN/migration-guides/release-6.x/6.0/peripherals.rst b/docs/zh_CN/migration-guides/release-6.x/6.0/peripherals.rst index ce9f518f4b..188017191b 100644 --- a/docs/zh_CN/migration-guides/release-6.x/6.0/peripherals.rst +++ b/docs/zh_CN/migration-guides/release-6.x/6.0/peripherals.rst @@ -88,3 +88,10 @@ SDMMC ---------------------- 旧版的 DAC 驱动 ``driver/dac.h`` 在 5.1 的版本中就已经被弃用(请参考 :ref:`deprecate_dac_legacy_driver`)。从 6.0 版本开始,旧版驱动被完全移除。新驱动位于 :component:`esp_driver_dac` 组件中,头文件引用路径为 ``driver/dac_oneshot.h``, ``driver/dac_continuous.h`` 和 ``driver/dac_cosine.h``。 + +.. only:: SOC_TEMP_SENSOR_SUPPORTED + + 旧版温度传感器驱动被移除 + ------------------------------------ + + 旧版的温度传感器驱动 ``driver/temp_sensor.h`` 在 5.1 的版本中就已经被弃用(请参考 :ref:`deprecate_tsens_legacy_driver`)。从 6.0 版本开始,旧版驱动被完全移除。新驱动位于 :component:`esp_driver_tsens` 组件中,头文件引用路径为 ``driver/temperature_sensor.h``。