esp32/modesp32: Add mcu_temperature() function for C3/S2/S3 devices.

For ESP32C3/S2/S3 IDFv5 exposes new internal temperature API which is
different to the base ESP32, IDFv4.

Thanks to @robert-hh for cleaner code and testing sensor capability in
these devices.

See discussion #10443.

Signed-off-by: Rick Sorensen <rick.sorensen@gmail.com>
This commit is contained in:
Rick Sorensen
2023-12-26 12:57:46 -06:00
committed by Damien George
parent 595f86155a
commit 63c30a2dfc
2 changed files with 28 additions and 0 deletions

View File

@@ -67,6 +67,12 @@ Note that the temperature sensor in the ESP32 will typically read higher than
ambient due to the IC getting warm while it runs. This effect can be minimised
by reading the temperature sensor immediately after waking up from sleep.
ESP32C3, ESP32S2, and ESP32S3 also have an internal temperature sensor available.
It is implemented a bit differently to the ESP32 and returns the temperature in
Celsius::
esp32.mcu_temperature() # read the internal temperature of the MCU, in Celsius
Networking
----------