Chapter 2. API Reference
Return
• ESP_OK Success
Parameters
• tsens:
esp_err_t
temp_sensor_start(void)
Start temperature sensor measure.
Return
• ESP_OK Success
• ESP_ERR_INVALID_ARG
esp_err_t
temp_sensor_stop(void)
Stop temperature sensor measure.
Return
• ESP_OK Success
esp_err_t
temp_sensor_read_raw(uint32_t *tsens_out)
Read temperature sensor raw data.
Return
• ESP_OK Success
• ESP_ERR_INVALID_ARG tsens_out is NULL
• ESP_ERR_INVALID_STATE temperature sensor dont start
Parameters
• tsens_out: Pointer to raw data, Range: 0 ~ 255
esp_err_t
temp_sensor_read_celsius(float *celsius)
Read temperature sensor data that is converted to degrees Celsius.
Note Should not be called from interrupt.
Return
• ESP_OK Success
• ESP_ERR_INVALID_ARG ARG is NULL.
• ESP_ERR_INVALID_STATE The ambient temperature is out of range.
Parameters
• celsius: The measure output value.
Structures
struct temp_sensor_config_t
Configuration for temperature sensor reading.
Public Members
temp_sensor_dac_offset_t
The temperature measurement range is configured with a built-in temperature offset DAC.
uint8_t clk_div
Default: 6
Macros
TSENS_CONFIG_DEFAULT()
temperature sensor default setting.
Enumerations
enum temp_sensor_dac_offset_t
temperature sensor range option.
Values:
Espressif Systems
dac_offset
396
Submit Document Feedback
Release v4.4
Need help?
Do you have a question about the ESP32-S2 and is the answer not in the manual?