mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-29 21:48:39 +00:00
temperature_sensor: Add new interface and reference counts so that phy and driver can use together
This commit is contained in:
@@ -8,6 +8,9 @@
|
||||
#include "esp_attr.h"
|
||||
#include "esp_private/regi2c_ctrl.h"
|
||||
#include "esp_private/sar_periph_ctrl.h"
|
||||
#include "esp_private/sar_periph_ctrl.h"
|
||||
#include "freertos/FreeRTOS.h"
|
||||
|
||||
|
||||
/*
|
||||
* This file is used to override the hooks provided by the PHY lib for some system features.
|
||||
@@ -58,3 +61,17 @@ void phy_set_pwdet_power(bool en)
|
||||
sar_periph_ctrl_pwdet_power_release();
|
||||
}
|
||||
}
|
||||
|
||||
void phy_set_tsens_power(bool en)
|
||||
{
|
||||
if (en) {
|
||||
temperature_sensor_power_acquire();
|
||||
} else {
|
||||
temperature_sensor_power_release();
|
||||
}
|
||||
}
|
||||
|
||||
int16_t phy_get_tsens_value(void)
|
||||
{
|
||||
return temp_sensor_get_raw_value(NULL);
|
||||
}
|
||||
|
Reference in New Issue
Block a user