feat(tsens): graduate temperature sensor hal component

This commit is contained in:
laokaiyao
2026-01-29 10:05:47 +08:00
parent 7c1e88e3d4
commit 2cb958a9e3
35 changed files with 126 additions and 91 deletions
@@ -1,44 +0,0 @@
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <stdint.h>
#include <stdbool.h>
#include "soc/soc_caps.h"
#ifdef __cplusplus
extern "C" {
#endif
#if SOC_TEMP_SENSOR_SUPPORTED
/**
* @brief Get raw temperature value with range management
*
* @param range_changed Pointer to store whether range was changed (can be NULL)
*
* @return Temperature sensor raw value
*/
int16_t temperature_sensor_hal_get_degree(bool *range_changed);
/**
* @brief Initialize temperature sensor HAL
*/
void temperature_sensor_hal_init(void);
/**
* @brief Sync temperature sensor index from main layer to HAL layer
*
* @param tsens_idx Temperature sensor index to sync
*/
void temperature_sensor_hal_sync_tsens_idx(uint8_t tsens_idx);
#endif // SOC_TEMP_SENSOR_SUPPORTED
#ifdef __cplusplus
}
#endif
@@ -1,44 +0,0 @@
/*
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include "soc/clk_tree_defs.h"
#include "soc/soc_caps.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief temperature sensor clock source
*/
#if SOC_TEMP_SENSOR_SUPPORTED
typedef soc_periph_temperature_sensor_clk_src_t temperature_sensor_clk_src_t;
#else
typedef int temperature_sensor_clk_src_t;
#endif // SOC_TEMP_SENSOR_SUPPORTED
/**
* @brief temperature sensor event types enum
*/
typedef enum {
TEMPERATURE_SENSOR_EVENT_OVER_LIMIT, /*!< Temperature sensor over limit event */
TEMPERATURE_SENSOR_EVENT_MAX, /*!< Maximum number of temperature sensor events */
} temperature_sensor_etm_event_type_t;
/**
* @brief temperature sensor task types enum
*/
typedef enum {
TEMPERATURE_SENSOR_TASK_START, /*!< Temperature sensor start task */
TEMPERATURE_SENSOR_TASK_STOP, /*!< Temperature sensor stop task */
TEMPERATURE_SENSOR_TASK_MAX, /*!< Maximum number of temperature sensor tasks */
} temperature_sensor_etm_task_type_t;
#ifdef __cplusplus
}
#endif