mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-09 04:25:32 +00:00
feat(temperature_sensor): Add temperature sensor support on esp32p4
This commit is contained in:
@@ -48,11 +48,28 @@ static inline void temperature_sensor_ll_enable(bool enable)
|
||||
/**
|
||||
* @brief Enable the clock
|
||||
*/
|
||||
static inline void temperature_sensor_ll_clk_enable(bool enable)
|
||||
static inline void temperature_sensor_ll_bus_clk_enable(bool enable)
|
||||
{
|
||||
SENS.sar_peri_clk_gate_conf.tsens_clk_en = enable;
|
||||
}
|
||||
|
||||
/// use a macro to wrap the function, force the caller to use it in a critical section
|
||||
/// the critical section needs to declare the __DECLARE_RCC_ATOMIC_ENV variable in advance
|
||||
#define temperature_sensor_ll_bus_clk_enable(...) do {(void)__DECLARE_RCC_ATOMIC_ENV; temperature_sensor_ll_bus_clk_enable(__VA_ARGS__);} while(0)
|
||||
|
||||
/**
|
||||
* @brief Enable the clock
|
||||
*/
|
||||
static inline void temperature_sensor_ll_reset_module(void)
|
||||
{
|
||||
SENS.sar_peri_reset_conf.tsens_reset = 1;
|
||||
SENS.sar_peri_reset_conf.tsens_reset = 0;
|
||||
}
|
||||
|
||||
/// use a macro to wrap the function, force the caller to use it in a critical section
|
||||
/// the critical section needs to declare the __DECLARE_RCC_ATOMIC_ENV variable in advance
|
||||
#define temperature_sensor_ll_reset_module(...) do {(void)__DECLARE_RCC_ATOMIC_ENV; temperature_sensor_ll_reset_module(__VA_ARGS__);} while(0)
|
||||
|
||||
/**
|
||||
* @brief Choose the clock. No need to choose the clock source on ESP32-S3. ESP32-S3
|
||||
* can use RTC clock.
|
||||
|
Reference in New Issue
Block a user