From 5d4275fb75f1702dfb9fb59b782cd0772efdcfd5 Mon Sep 17 00:00:00 2001 From: "C.S.M" Date: Wed, 7 Aug 2024 11:08:23 +0800 Subject: [PATCH] feature(temperature_sensor): Add temperature sensor support on esp32c5 --- .../legacy_rtc_temp_driver/README.md | 4 +- .../pytest_legacy_temp_sensor_driver.py | 1 + .../efuse/esp32c5/esp_efuse_rtc_calib.c | 3 +- .../test_apps/temperature_sensor/README.md | 4 +- .../pytest_temperature_sensor.py | 3 +- .../include/hal/temperature_sensor_ll.h | 271 ++++++++++++++++++ .../esp32c5/include/soc/Kconfig.soc_caps.in | 20 ++ .../soc/esp32c5/include/soc/clk_tree_defs.h | 2 +- .../soc/esp32c5/include/soc/interrupts.h | 5 +- components/soc/esp32c5/include/soc/soc_caps.h | 10 +- .../soc/esp32c5/temperature_sensor_periph.c | 16 ++ docs/docs_not_updated/esp32c5.txt | 1 - .../temperature_sensor/temp_sensor/README.md | 4 +- .../temp_sensor/pytest_temp_sensor_example.py | 2 +- .../temp_sensor_monitor/README.md | 4 +- .../pytest_temp_sensor_monitor_example.py | 2 +- tools/test_apps/phy/.build-test-rules.yml | 2 +- .../phy/phy_tsens/pytest_phy_tsens.py | 1 - 18 files changed, 331 insertions(+), 24 deletions(-) create mode 100644 components/hal/esp32c5/include/hal/temperature_sensor_ll.h create mode 100644 components/soc/esp32c5/temperature_sensor_periph.c diff --git a/components/driver/test_apps/legacy_rtc_temp_driver/README.md b/components/driver/test_apps/legacy_rtc_temp_driver/README.md index 4fc69c16b6..3a9c73a780 100644 --- a/components/driver/test_apps/legacy_rtc_temp_driver/README.md +++ b/components/driver/test_apps/legacy_rtc_temp_driver/README.md @@ -1,2 +1,2 @@ -| Supported Targets | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | -| ----------------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | +| ----------------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | 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 index cf77604bda..ae8d5d0fe5 100644 --- 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 @@ -11,6 +11,7 @@ from pytest_embedded import Dut @pytest.mark.esp32c6 @pytest.mark.esp32h2 @pytest.mark.esp32p4 +@pytest.mark.esp32c5 @pytest.mark.generic @pytest.mark.parametrize('config', [ 'release', diff --git a/components/efuse/esp32c5/esp_efuse_rtc_calib.c b/components/efuse/esp32c5/esp_efuse_rtc_calib.c index e07e817a57..4e59366f55 100644 --- a/components/efuse/esp32c5/esp_efuse_rtc_calib.c +++ b/components/efuse/esp32c5/esp_efuse_rtc_calib.c @@ -49,9 +49,8 @@ esp_err_t esp_efuse_rtc_calib_get_cal_voltage(int version, uint32_t adc_unit, in esp_err_t esp_efuse_rtc_calib_get_tsens_val(float* tsens_cal) { - // TODO: [ESP32C5] IDF-8727 - abort(); // Currently calibration is not supported on ESP32-C5, IDF-5236 + // Allow no calibration *tsens_cal = 0; return ESP_OK; } diff --git a/components/esp_driver_tsens/test_apps/temperature_sensor/README.md b/components/esp_driver_tsens/test_apps/temperature_sensor/README.md index 4fc69c16b6..3a9c73a780 100644 --- a/components/esp_driver_tsens/test_apps/temperature_sensor/README.md +++ b/components/esp_driver_tsens/test_apps/temperature_sensor/README.md @@ -1,2 +1,2 @@ -| Supported Targets | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | -| ----------------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | +| ----------------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | diff --git a/components/esp_driver_tsens/test_apps/temperature_sensor/pytest_temperature_sensor.py b/components/esp_driver_tsens/test_apps/temperature_sensor/pytest_temperature_sensor.py index 996d370bfc..437164c0a8 100644 --- a/components/esp_driver_tsens/test_apps/temperature_sensor/pytest_temperature_sensor.py +++ b/components/esp_driver_tsens/test_apps/temperature_sensor/pytest_temperature_sensor.py @@ -1,6 +1,5 @@ # SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: CC0-1.0 - import pytest from pytest_embedded import Dut from pytest_embedded_idf.unity_tester import CaseTester @@ -13,6 +12,7 @@ from pytest_embedded_idf.unity_tester import CaseTester @pytest.mark.esp32c6 @pytest.mark.esp32h2 @pytest.mark.esp32p4 +@pytest.mark.esp32c5 @pytest.mark.generic @pytest.mark.parametrize('config', [ 'release', @@ -24,6 +24,7 @@ def test_temperature_sensor_driver(dut: Dut) -> None: @pytest.mark.esp32c6 @pytest.mark.esp32h2 @pytest.mark.esp32p4 +@pytest.mark.esp32c5 @pytest.mark.generic @pytest.mark.parametrize('config', [ 'iram_safe', diff --git a/components/hal/esp32c5/include/hal/temperature_sensor_ll.h b/components/hal/esp32c5/include/hal/temperature_sensor_ll.h new file mode 100644 index 0000000000..4c73df1a1f --- /dev/null +++ b/components/hal/esp32c5/include/hal/temperature_sensor_ll.h @@ -0,0 +1,271 @@ +/* + * SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/******************************************************************************* + * NOTICE + * The hal is not public api, don't use in application code. + * See readme.md in component/hal/readme.md + ******************************************************************************/ + +// The LL for temperature sensor + +#pragma once + +#include +#include +#include "hal/regi2c_ctrl.h" +#include "soc/regi2c_saradc.h" +#include "soc/apb_saradc_struct.h" +#include "soc/apb_saradc_reg.h" +#include "soc/pcr_struct.h" +#include "soc/soc.h" +#include "soc/soc_caps.h" +#include "soc/pcr_struct.h" +#include "soc/interrupts.h" +#include "soc/soc_etm_source.h" +#include "hal/temperature_sensor_types.h" +#include "hal/assert.h" +#include "hal/misc.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define TEMPERATURE_SENSOR_LL_ADC_FACTOR (0.4386) +#define TEMPERATURE_SENSOR_LL_DAC_FACTOR (27.88) +#define TEMPERATURE_SENSOR_LL_OFFSET_FACTOR (20.52) +#define TEMPERATURE_SENSOR_LL_MEASURE_MAX (125) +#define TEMPERATURE_SENSOR_LL_MEASURE_MIN (-40) + +#define TEMPERATURE_SENSOR_LL_INTR_MASK APB_SARADC_APB_SARADC_TSENS_INT_ST + +#define TEMPERATURE_SENSOR_LL_ETM_EVENT_TABLE(event) \ + (uint32_t [TEMPERATURE_SENSOR_EVENT_MAX]){ \ + [TEMPERATURE_SENSOR_EVENT_OVER_LIMIT] = TMPSNSR_EVT_OVER_LIMIT, \ + }[event] + +#define TEMPERATURE_SENSOR_LL_ETM_TASK_TABLE(task) \ + (uint32_t [TEMPERATURE_SENSOR_TASK_MAX]){ \ + [TEMPERATURE_SENSOR_TASK_START] = TMPSNSR_TASK_START_SAMPLE, \ + [TEMPERATURE_SENSOR_TASK_STOP] = TMPSNSR_TASK_STOP_SAMPLE, \ + }[task] + +typedef enum { + TEMPERATURE_SENSOR_LL_WAKE_ABSOLUTE = 0, + TEMPERATURE_SENSOR_LL_WAKE_DELTA = 1, +} temperature_sensor_ll_wakeup_mode_t; + +/** + * @brief Enable the temperature sensor power. + * + * @param enable true: enable the power. + */ +static inline void temperature_sensor_ll_enable(bool enable) +{ + APB_SARADC.saradc_apb_tsens_ctrl.saradc_tsens_pu = enable; +} + +/** + * @brief Enable the clock + */ +static inline void temperature_sensor_ll_bus_clk_enable(bool enable) +{ + PCR.tsens_clk_conf.tsens_clk_en = enable; +} + +/** + * @brief Reset the Temperature sensor module + */ +static inline void temperature_sensor_ll_reset_module(void) +{ + PCR.tsens_clk_conf.tsens_rst_en = 1; + PCR.tsens_clk_conf.tsens_rst_en = 0; +} + +/** + * @brief Select the clock source for temperature sensor. On ESP32-C6, temperautre sensor + * can use XTAL or FOSC. To make it convenience, suggest using XTAL all the time. + * + * @param clk_src refer to ``temperature_sensor_clk_src_t`` + */ +static inline void temperature_sensor_ll_clk_sel(temperature_sensor_clk_src_t clk_src) +{ + uint8_t clk_sel = 0; + switch (clk_src) { + case TEMPERATURE_SENSOR_CLK_SRC_XTAL: + clk_sel = 1; + break; + case TEMPERATURE_SENSOR_CLK_SRC_RC_FAST: + clk_sel = 0; + break; + default: + HAL_ASSERT(false); + break; + } + PCR.tsens_clk_conf.tsens_clk_sel = clk_sel; +} + +/** + * @brief Set the hardware range, you can refer to the table ``temperature_sensor_attributes`` + * + * @param tsens_dac ``reg_val`` in table ``temperature_sensor_attributes`` + */ +static inline void temperature_sensor_ll_set_range(uint32_t range) +{ + REGI2C_WRITE_MASK(I2C_SAR_ADC, I2C_SARADC_TSENS_DAC, range); +} + +/** + * @brief Get the raw value of temperature sensor. + * + * @return uint32_t raw_value + */ +__attribute__((always_inline)) +static inline uint32_t temperature_sensor_ll_get_raw_value(void) +{ + return HAL_FORCE_READ_U32_REG_FIELD(APB_SARADC.saradc_apb_tsens_ctrl, saradc_tsens_out); +} + +/** + * @brief Get the offset value of temperature sensor. + * + * @note This function is only used in legacy driver + * + * @return uint32_t offset value + */ +static inline uint32_t temperature_sensor_ll_get_offset(void) +{ + return REGI2C_READ_MASK(I2C_SAR_ADC, I2C_SARADC_TSENS_DAC); +} + +/** + * @brief Get the clock division factor value. + * + * @note This function is only used in legacy driver + * + * @return uint32_t clock division factor + */ +static inline uint32_t temperature_sensor_ll_get_clk_div(void) +{ + return HAL_FORCE_READ_U32_REG_FIELD(APB_SARADC.saradc_apb_tsens_ctrl, saradc_tsens_clk_div); +} + +/** + * @brief Set the clock division factor value, actually this has no impact on temperature sensor. + * Suggest just keep it as default value 6. + * + * @note This function is only used in legacy driver + * + * @param clk_div clock division factor, range from 1-10 + */ +static inline void temperature_sensor_ll_set_clk_div(uint8_t clk_div) +{ + HAL_FORCE_MODIFY_U32_REG_FIELD(APB_SARADC.saradc_apb_tsens_ctrl, saradc_tsens_clk_div, clk_div); +} + +/** + * @brief Choose the wake-up mode for temperature sensor + * + * @note ESP32-C6 does not support difference mode. + * + * @param mode 0: Absolute value mode. 1: Difference mode. + */ +static inline void temperature_sensor_ll_wakeup_mode(temperature_sensor_ll_wakeup_mode_t mode) +{ + APB_SARADC.tsens_wake.saradc_wakeup_mode = mode; +} + +/** + * @brief Get temperature sensor interrupt/wakeup in which reason + * + * @return uint8_t 0: temperature value lower than low threshold 1: otherwise, higher than high threshold. + */ +__attribute__((always_inline)) +static inline uint8_t temperature_sensor_ll_get_wakeup_reason(void) +{ + return APB_SARADC.tsens_wake.saradc_wakeup_over_upper_th; +} + +/** + * @brief Configure whether to enable temperature sensor wake up + * + * @param en true: enable, false: disable. + */ +static inline void temperature_sensor_ll_wakeup_enable(bool en) +{ + APB_SARADC.tsens_wake.saradc_wakeup_en = en; +} + +/** + * @brief Configures the low threshold for temperature sensor to wakeup + * + * @param th_low low threshold value. + */ +static inline void temperature_sensor_ll_set_th_low_val(uint8_t th_low) +{ + HAL_FORCE_MODIFY_U32_REG_FIELD(APB_SARADC.tsens_wake, saradc_wakeup_th_low, th_low); +} + +/** + * @brief Configures the high threshold for temperature sensor to wakeup + * + * @param th_high high threshold value. + */ +static inline void temperature_sensor_ll_set_th_high_val(uint8_t th_high) +{ + HAL_FORCE_MODIFY_U32_REG_FIELD(APB_SARADC.tsens_wake, saradc_wakeup_th_high, th_high); +} + +/** + * @brief Enable temperature sensor interrupt + * + * @param enable true: enable. false: disable + */ +static inline void temperature_sensor_ll_enable_intr(bool enable) +{ + APB_SARADC.saradc_int_ena.saradc_apb_saradc_tsens_int_ena = enable; +} + +/** + * @brief Clear temperature sensor interrupt + */ +__attribute__((always_inline)) +static inline void temperature_sensor_ll_clear_intr(void) +{ + APB_SARADC.saradc_int_clr.saradc_apb_saradc_tsens_int_clr = 1; +} + +/** + * @brief Get temperature sensor interrupt status. + */ +static inline volatile void *temperature_sensor_ll_get_intr_status(void) +{ + return &APB_SARADC.saradc_int_st; +} + +/** + * @brief Configure whether to enable hardware sampling + * + * @param en true: enable, false: disable + */ +static inline void temperature_sensor_ll_sample_enable(bool en) +{ + APB_SARADC.tsens_sample.saradc_tsens_sample_en = en; +} + +/** + * @brief Configures the hardware sampling rate + * + * @param rate sampling rate + */ +static inline void temperature_sensor_ll_set_sample_rate(uint16_t rate) +{ + HAL_FORCE_MODIFY_U32_REG_FIELD(APB_SARADC.tsens_sample, saradc_tsens_sample_rate, rate); +} + +#ifdef __cplusplus +} +#endif diff --git a/components/soc/esp32c5/include/soc/Kconfig.soc_caps.in b/components/soc/esp32c5/include/soc/Kconfig.soc_caps.in index 781d1930b8..fddcad0d96 100644 --- a/components/soc/esp32c5/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32c5/include/soc/Kconfig.soc_caps.in @@ -51,6 +51,10 @@ config SOC_USB_SERIAL_JTAG_SUPPORTED bool default y +config SOC_TEMP_SENSOR_SUPPORTED + bool + default y + config SOC_WIFI_SUPPORTED bool default y @@ -315,6 +319,10 @@ config SOC_ADC_RTC_MAX_BITWIDTH int default 12 +config SOC_ADC_TEMPERATURE_SHARE_INTR + bool + default y + config SOC_ADC_SHARED_POWER bool default y @@ -1191,6 +1199,18 @@ config SOC_RCC_IS_INDEPENDENT bool default y +config SOC_TEMPERATURE_SENSOR_SUPPORT_FAST_RC + bool + default y + +config SOC_TEMPERATURE_SENSOR_SUPPORT_XTAL + bool + default y + +config SOC_TEMPERATURE_SENSOR_INTR_SUPPORT + bool + default y + config SOC_WIFI_HW_TSF bool default y diff --git a/components/soc/esp32c5/include/soc/clk_tree_defs.h b/components/soc/esp32c5/include/soc/clk_tree_defs.h index 12a1823ba3..375d118fe9 100644 --- a/components/soc/esp32c5/include/soc/clk_tree_defs.h +++ b/components/soc/esp32c5/include/soc/clk_tree_defs.h @@ -218,7 +218,7 @@ typedef enum { /** * @brief Type of Temp Sensor clock source */ -typedef enum { // TODO: [ESP32C5] IDF-8727 (inherit from C6) +typedef enum { TEMPERATURE_SENSOR_CLK_SRC_XTAL = SOC_MOD_CLK_XTAL, /*!< Select XTAL as the source clock */ TEMPERATURE_SENSOR_CLK_SRC_RC_FAST = SOC_MOD_CLK_RC_FAST, /*!< Select RC_FAST as the source clock */ TEMPERATURE_SENSOR_CLK_SRC_DEFAULT = SOC_MOD_CLK_XTAL, /*!< Select XTAL as the default choice */ diff --git a/components/soc/esp32c5/include/soc/interrupts.h b/components/soc/esp32c5/include/soc/interrupts.h index a66ab66242..f4411dfc34 100644 --- a/components/soc/esp32c5/include/soc/interrupts.h +++ b/components/soc/esp32c5/include/soc/interrupts.h @@ -77,8 +77,9 @@ typedef enum { ETS_SYSTIMER_TARGET0_INTR_SOURCE, /**< interrupt of system timer 0 */ ETS_SYSTIMER_TARGET1_INTR_SOURCE, /**< interrupt of system timer 1 */ ETS_SYSTIMER_TARGET2_INTR_SOURCE, /**< interrupt of system timer 2 */ - ETS_APB_ADC_INTR_SOURCE, /**< interrupt of APB ADC, LEVEL*/ - ETS_MCPWM0_INTR_SOURCE, /**< interrupt of MCPWM0, LEVEL*/ + ETS_APB_ADC_INTR_SOURCE = 62, /**< interrupt of APB ADC, LEVEL*/ + ETS_TEMPERATURE_SENSOR_INTR_SOURCE = ETS_APB_ADC_INTR_SOURCE, + ETS_MCPWM0_INTR_SOURCE = 63, /**< interrupt of MCPWM0, LEVEL*/ ETS_PCNT_INTR_SOURCE, ETS_PARL_IO_TX_INTR_SOURCE, ETS_PARL_IO_RX_INTR_SOURCE, diff --git a/components/soc/esp32c5/include/soc/soc_caps.h b/components/soc/esp32c5/include/soc/soc_caps.h index fb2ef45c3b..1770b1b980 100644 --- a/components/soc/esp32c5/include/soc/soc_caps.h +++ b/components/soc/esp32c5/include/soc/soc_caps.h @@ -30,7 +30,7 @@ #define SOC_PARLIO_SUPPORTED 1 #define SOC_ASYNC_MEMCPY_SUPPORTED 1 #define SOC_USB_SERIAL_JTAG_SUPPORTED 1 -// #define SOC_TEMP_SENSOR_SUPPORTED 1 // TODO: [ESP32C5] IDF-8727 +#define SOC_TEMP_SENSOR_SUPPORTED 1 #define SOC_WIFI_SUPPORTED 1 #define SOC_SUPPORTS_SECURE_DL_MODE 1 #define SOC_LP_CORE_SUPPORTED 1 @@ -131,7 +131,7 @@ // #define SOC_ADC_CALIB_CHAN_COMPENS_SUPPORTED (1) /*!< support channel compensation to the HW offset calibration */ /*!< Interrupt */ -// #define SOC_ADC_TEMPERATURE_SHARE_INTR (1) // TODO: [ESP32C5] IDF-8727 +#define SOC_ADC_TEMPERATURE_SHARE_INTR (1) /*!< ADC power control is shared by PWDET */ #define SOC_ADC_SHARED_POWER 1 @@ -567,9 +567,9 @@ #define SOC_RCC_IS_INDEPENDENT 1 /*!< Reset and Clock Control is independent, thanks to the PCR registers */ /*-------------------------- Temperature Sensor CAPS -------------------------------------*/ -// #define SOC_TEMPERATURE_SENSOR_SUPPORT_FAST_RC (1) -// #define SOC_TEMPERATURE_SENSOR_SUPPORT_XTAL (1) -// #define SOC_TEMPERATURE_SENSOR_INTR_SUPPORT (1) +#define SOC_TEMPERATURE_SENSOR_SUPPORT_FAST_RC (1) +#define SOC_TEMPERATURE_SENSOR_SUPPORT_XTAL (1) +#define SOC_TEMPERATURE_SENSOR_INTR_SUPPORT (1) /*------------------------------------ WI-FI CAPS ------------------------------------*/ #define SOC_WIFI_HW_TSF (1) /*!< Support hardware TSF */ diff --git a/components/soc/esp32c5/temperature_sensor_periph.c b/components/soc/esp32c5/temperature_sensor_periph.c new file mode 100644 index 0000000000..b0b6cfef7e --- /dev/null +++ b/components/soc/esp32c5/temperature_sensor_periph.c @@ -0,0 +1,16 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "soc/temperature_sensor_periph.h" + +const temperature_sensor_attribute_t temperature_sensor_attributes[TEMPERATURE_SENSOR_ATTR_RANGE_NUM] = { + /*Offset reg_val min max error */ + {-2, 5, 50, 125, 3}, + {-1, 7, 20, 100, 2}, + { 0, 15, -10, 80, 1}, + { 1, 11, -30, 50, 2}, + { 2, 10, -40, 20, 3}, +}; diff --git a/docs/docs_not_updated/esp32c5.txt b/docs/docs_not_updated/esp32c5.txt index c0f5823ee3..ed2c12c62f 100644 --- a/docs/docs_not_updated/esp32c5.txt +++ b/docs/docs_not_updated/esp32c5.txt @@ -72,7 +72,6 @@ api-reference/peripherals/gptimer.rst api-reference/peripherals/touch_element.rst api-reference/peripherals/lcd.rst api-reference/peripherals/ana_cmpr.rst -api-reference/peripherals/temp_sensor.rst api-reference/peripherals/spi_features.rst api-reference/peripherals/spi_flash/spi_flash_concurrency.rst api-reference/peripherals/spi_flash/spi_flash_override_driver.rst diff --git a/examples/peripherals/temperature_sensor/temp_sensor/README.md b/examples/peripherals/temperature_sensor/temp_sensor/README.md index e798628a4b..dbae55c30f 100644 --- a/examples/peripherals/temperature_sensor/temp_sensor/README.md +++ b/examples/peripherals/temperature_sensor/temp_sensor/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | -| ----------------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | +| ----------------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | # Temperature Sensor Example diff --git a/examples/peripherals/temperature_sensor/temp_sensor/pytest_temp_sensor_example.py b/examples/peripherals/temperature_sensor/temp_sensor/pytest_temp_sensor_example.py index 04b1372570..00ff68d768 100644 --- a/examples/peripherals/temperature_sensor/temp_sensor/pytest_temp_sensor_example.py +++ b/examples/peripherals/temperature_sensor/temp_sensor/pytest_temp_sensor_example.py @@ -1,6 +1,5 @@ # SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: CC0-1.0 - import pytest from pytest_embedded.dut import Dut @@ -12,6 +11,7 @@ from pytest_embedded.dut import Dut @pytest.mark.esp32c6 @pytest.mark.esp32h2 @pytest.mark.esp32p4 +@pytest.mark.esp32c5 @pytest.mark.generic def test_temp_sensor_example(dut: Dut) -> None: dut.expect_exact('Install temperature sensor') diff --git a/examples/peripherals/temperature_sensor/temp_sensor_monitor/README.md b/examples/peripherals/temperature_sensor/temp_sensor_monitor/README.md index a1f921bd81..a8b6ae1367 100644 --- a/examples/peripherals/temperature_sensor/temp_sensor_monitor/README.md +++ b/examples/peripherals/temperature_sensor/temp_sensor_monitor/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32-C6 | ESP32-H2 | ESP32-P4 | -| ----------------- | -------- | -------- | -------- | +| Supported Targets | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | +| ----------------- | -------- | -------- | -------- | -------- | # Temperature Sensor Interrupt Example diff --git a/examples/peripherals/temperature_sensor/temp_sensor_monitor/pytest_temp_sensor_monitor_example.py b/examples/peripherals/temperature_sensor/temp_sensor_monitor/pytest_temp_sensor_monitor_example.py index e952831878..375605701a 100644 --- a/examples/peripherals/temperature_sensor/temp_sensor_monitor/pytest_temp_sensor_monitor_example.py +++ b/examples/peripherals/temperature_sensor/temp_sensor_monitor/pytest_temp_sensor_monitor_example.py @@ -1,6 +1,5 @@ # SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: CC0-1.0 - import pytest from pytest_embedded.dut import Dut @@ -8,6 +7,7 @@ from pytest_embedded.dut import Dut @pytest.mark.esp32c6 @pytest.mark.esp32h2 @pytest.mark.esp32p4 +@pytest.mark.esp32c5 @pytest.mark.generic def test_temp_sensor_monitor_example(dut: Dut) -> None: dut.expect_exact('Install temperature sensor') diff --git a/tools/test_apps/phy/.build-test-rules.yml b/tools/test_apps/phy/.build-test-rules.yml index 7e7e924396..b7d0fdb4e2 100644 --- a/tools/test_apps/phy/.build-test-rules.yml +++ b/tools/test_apps/phy/.build-test-rules.yml @@ -9,7 +9,7 @@ tools/test_apps/phy/phy_multi_init_data_test: tools/test_apps/phy/phy_tsens: disable: - - if: SOC_WIFI_SUPPORTED != 1 or SOC_TEMP_SENSOR_SUPPORTED != 1 + - if: (SOC_WIFI_SUPPORTED != 1 or SOC_TEMP_SENSOR_SUPPORTED != 1) or SOC_LIGHT_SLEEP_SUPPORTED != 1 depends_components: - hal - driver diff --git a/tools/test_apps/phy/phy_tsens/pytest_phy_tsens.py b/tools/test_apps/phy/phy_tsens/pytest_phy_tsens.py index 5c19ea60ef..5b95b97134 100644 --- a/tools/test_apps/phy/phy_tsens/pytest_phy_tsens.py +++ b/tools/test_apps/phy/phy_tsens/pytest_phy_tsens.py @@ -1,6 +1,5 @@ # SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: Apache-2.0 - import random import string from typing import Tuple