HF Interface Wrapper 0.1.0-dev
Embedded C++ hardware abstraction layer
Loading...
Searching...
No Matches
StmTemperature.h File Reference

STM32 Temperature sensor — reads the internal temp sensor via ADC or an external sensor via a user-supplied ADC handle + conversion function. More...

#include "BaseTemperature.h"
#include "StmTypes.h"
Include dependency graph for StmTemperature.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  hf_stm32_temp_sensor_config_t
 STM32 Temperature sensor configuration. More...
 
class  StmTemperature
 STM32 Temperature sensor implementation. More...
 

Typedefs

using hf_stm32_temp_convert_fn = float(*)(hf_u32_t raw_adc_count, hf_u8_t resolution_bits)
 User-supplied function to convert a raw ADC count to Celsius.
 

Detailed Description

STM32 Temperature sensor — reads the internal temp sensor via ADC or an external sensor via a user-supplied ADC handle + conversion function.

Author
HardFOC
Date
2025

Typedef Documentation

◆ hf_stm32_temp_convert_fn

using hf_stm32_temp_convert_fn = float(*)(hf_u32_t raw_adc_count, hf_u8_t resolution_bits)

User-supplied function to convert a raw ADC count to Celsius.

For the STM32 internal sensor the typical formula is: T(°C) = ((V_SENSE – V_25) / Avg_Slope) + 25 but calibration constants differ per family (see RM).

For external NTC / PTC / thermocouple channels the user provides their own linearisation function.