62 #define BETA_KELVIN (273.15f)
76 #if BETA_POSITION_IN_RESISTOR_DIVIDER_IS_R_1 == true
77 #define BETA_ADC_VOLTAGE_V_MAX_V \
78 (float)((BETA_RESISTOR_DIVIDER_SUPPLY_VOLTAGE_V * BETA_ResistanceFromTemperature(1400)) / (BETA_ResistanceFromTemperature(1400) + BETA_RESISTOR_DIVIDER_RESISTANCE_R_1_R_2_Ohm))
79 #define BETA_ADC_VOLTAGE_V_MIN_V \
80 (float)((BETA_RESISTOR_DIVIDER_SUPPLY_VOLTAGE_V * BETA_ResistanceFromTemperature(-400)) / (BETA_ResistanceFromTemperature(-400) + BETA_RESISTOR_DIVIDER_RESISTANCE_R_1_R_2_Ohm))
82 #define BETA_ADC_VOLTAGE_V_MIN_V \
83 (float)((BETA_RESISTOR_DIVIDER_SUPPLY_VOLTAGE_V * BETA_ResistanceFromTemperature(1400)) / (BETA_ResistanceFromTemperature(1400) + BETA_RESISTOR_DIVIDER_RESISTANCE_R_1_R_2_Ohm))
84 #define BETA_ADC_VOLTAGE_V_MAX_V \
85 (float)((BETA_RESISTOR_DIVIDER_SUPPLY_VOLTAGE_V * BETA_ResistanceFromTemperature(-400)) / (BETA_ResistanceFromTemperature(-400) + BETA_RESISTOR_DIVIDER_RESISTANCE_R_1_R_2_Ohm))
96 int16_t temperature_ddegC = 0;
97 float resistance_Ohm = 0.0;
98 float adcVoltage_V = (float)adcVoltage_mV / 1000.0f;
103 temperature_ddegC = INT16_MIN;
106 temperature_ddegC = INT16_MAX;
109 #if BETA_POSITION_IN_RESISTOR_DIVIDER_IS_R_1 == true
123 return temperature_ddegC;
127 int16_t temperature_ddegC = 0;
128 if (resistance_Ohm > 0.0f) {
132 temperature_ddegC = (int16_t)(10.0f * temperature_degC);
135 temperature_ddegC = INT16_MIN;
137 return temperature_ddegC;
141 float resistance_Ohm = 0.0f;
145 return resistance_Ohm;
int16_t BETA_TemperatureFromResistance(float resistance_Ohm)
returns temperature corresponding to NTC resistance
float BETA_ResistanceFromTemperature(int16_t temperature_ddegC)
returns NTC resistance corresponding to temperature, used to compute Vmin and Vmax of the divider
#define BETA_ADC_VOLTAGE_V_MAX_V
int16_t BETA_GetTemperatureFromBeta(uint16_t adcVoltage_mV)
returns temperature based on measured ADC voltage
#define BETA_ADC_VOLTAGE_V_MIN_V
Resistive divider used for measuring temperature.
#define BETA_RESISTOR_DIVIDER_RESISTANCE_R_1_R_2_Ohm
#define BETA_BETACOEFFICIENT
#define BETA_RESISTOR_DIVIDER_SUPPLY_VOLTAGE_V
math library for often used math functions