diff --git a/components/esp_driver_tsens/src/temperature_sensor.c b/components/esp_driver_tsens/src/temperature_sensor.c index 2146c84751..22faa43d76 100644 --- a/components/esp_driver_tsens/src/temperature_sensor.c +++ b/components/esp_driver_tsens/src/temperature_sensor.c @@ -177,6 +177,10 @@ esp_err_t temperature_sensor_enable(temperature_sensor_handle_t tsens) temperature_sensor_ll_clk_sel(tsens->clk_src); temperature_sensor_power_acquire(); + // After enabling/reseting the temperature sensor, + // the output value gradually approaches the true temperature + // value as the measurement time increases. 300us is recommended. + esp_rom_delay_us(300); tsens->fsm = TEMP_SENSOR_FSM_ENABLE; return ESP_OK; } diff --git a/components/esp_hw_support/sar_periph_ctrl_common.c b/components/esp_hw_support/sar_periph_ctrl_common.c index f13ca42869..4e64ee0cc1 100644 --- a/components/esp_hw_support/sar_periph_ctrl_common.c +++ b/components/esp_hw_support/sar_periph_ctrl_common.c @@ -45,7 +45,7 @@ void temperature_sensor_power_acquire(void) s_temperature_sensor_power_cnt++; if (s_temperature_sensor_power_cnt == 1) { regi2c_saradc_enable(); -#if !SOC_TEMPERATURE_SENSOR_IS_INDEPENDENT_FROM_ADC +#if !SOC_TSENS_IS_INDEPENDENT_FROM_ADC adc_apb_periph_claim(); #endif TSENS_RCC_ATOMIC() { @@ -55,10 +55,6 @@ void temperature_sensor_power_acquire(void) temperature_sensor_ll_enable(true); } portEXIT_CRITICAL(&rtc_spinlock); - // After enabling/reseting the temperature sensor, - // the output value gradually approaches the true temperature - // value as the measurement time increases. 300us is recommended. - esp_rom_delay_us(300); } void temperature_sensor_power_release(void) @@ -75,7 +71,7 @@ void temperature_sensor_power_release(void) TSENS_RCC_ATOMIC() { temperature_sensor_ll_bus_clk_enable(false); } -#if !SOC_TEMPERATURE_SENSOR_IS_INDEPENDENT_FROM_ADC +#if !SOC_TSENS_IS_INDEPENDENT_FROM_ADC adc_apb_periph_free(); #endif regi2c_saradc_disable(); diff --git a/components/soc/esp32p4/include/soc/Kconfig.soc_caps.in b/components/soc/esp32p4/include/soc/Kconfig.soc_caps.in index 8644c0c61a..29bbcfbf3e 100644 --- a/components/soc/esp32p4/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32p4/include/soc/Kconfig.soc_caps.in @@ -1339,7 +1339,7 @@ config SOC_TEMPERATURE_SENSOR_INTR_SUPPORT bool default y -config SOC_TEMPERATURE_SENSOR_IS_INDEPENDENT_FROM_ADC +config SOC_TSENS_IS_INDEPENDENT_FROM_ADC bool default y diff --git a/components/soc/esp32p4/include/soc/soc_caps.h b/components/soc/esp32p4/include/soc/soc_caps.h index f4391a6324..03bdc5d309 100644 --- a/components/soc/esp32p4/include/soc/soc_caps.h +++ b/components/soc/esp32p4/include/soc/soc_caps.h @@ -577,7 +577,7 @@ /*-------------------------- Temperature Sensor CAPS -------------------------------------*/ #define SOC_TEMPERATURE_SENSOR_LP_PLL_SUPPORT (1) #define SOC_TEMPERATURE_SENSOR_INTR_SUPPORT (1) -#define SOC_TEMPERATURE_SENSOR_IS_INDEPENDENT_FROM_ADC (1) /*!< Temperature sensor is a separate module, not share regs with ADC */ +#define SOC_TSENS_IS_INDEPENDENT_FROM_ADC (1) /*!< Temperature sensor is a separate module, not share regs with ADC */ /*-------------------------- Memory CAPS --------------------------*/ #define SOC_MEM_TCM_SUPPORTED (1)