diff options
Diffstat (limited to 'main/chip_temp.h')
| -rw-r--r-- | main/chip_temp.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/main/chip_temp.h b/main/chip_temp.h new file mode 100644 index 0000000..ef3e792 --- /dev/null +++ b/main/chip_temp.h @@ -0,0 +1,12 @@ +#pragma once + +#include "esp_err.h" + +// On-die temperature sensor (ESP32-P4 TSENS). Init once at boot; reads are +// cheap (~µs) and safe from any task. Note this is junction temperature — +// expect ~10-20°C above ambient under load; useful for trending and +// thermal-throttle debugging, not room temperature. +esp_err_t chip_temp_init(void); + +// Degrees Celsius, or NAN if the sensor isn't initialized / read failed. +float chip_temp_read(void); |
