rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
controllers
sensors
converters
thermistor_func.h
Go to the documentation of this file.
1
/**
2
* @author Matthew Kennedy, (c) 2019
3
*
4
* A function to convert resistance to thermistor temperature (NTC). Uses the
5
* Steinhart-Hart equation to avoid having to compute many logarithms at runtime.
6
*/
7
8
#pragma once
9
10
#include "
generated_lookup_engine_configuration.h
"
11
#include "
sensor_converter_func.h
"
12
#include "
resistance_func.h
"
13
#include "
func_chain.h
"
14
15
class
ThermistorFunc
final :
public
SensorConverter
{
16
public
:
17
SensorResult
convert
(
float
ohms)
const override
;
18
19
void
configure
(
thermistor_conf_s
&cfg);
20
21
void
showInfo
(
float
testRawValue)
const override
;
22
23
// Steinhart-Hart coefficients
24
float
m_a
= 0;
25
float
m_b
= 0;
26
float
m_c
= 0;
27
};
28
29
using
resist
=
ResistanceFunc
;
30
using
therm
=
ThermistorFunc
;
31
32
typedef
FuncChain<resist, therm>
thermistor_t
;
FuncChain
Definition
func_chain.h:94
ResistanceFunc
Definition
resistance_func.h:13
ThermistorFunc
Definition
thermistor_func.h:15
ThermistorFunc::showInfo
void showInfo(float testRawValue) const override
Definition
sensor_info_printing.cpp:98
ThermistorFunc::configure
void configure(thermistor_conf_s &cfg)
Definition
thermistor_func.cpp:42
ThermistorFunc::m_a
float m_a
Definition
thermistor_func.h:24
ThermistorFunc::convert
SensorResult convert(float ohms) const override
Definition
thermistor_func.cpp:11
ThermistorFunc::m_b
float m_b
Definition
thermistor_func.h:25
ThermistorFunc::m_c
float m_c
Definition
thermistor_func.h:26
func_chain.h
generated_lookup_engine_configuration.h
resistance_func.h
SensorResult
expected< float > SensorResult
Definition
sensor.h:46
sensor_converter_func.h
SensorConverter
Definition
sensor_converter_func.h:5
thermistor_conf_s
Thermistor known values.
Definition
engine_configuration_generated_structures_alphax-2chan.h:455
thermistor_t
FuncChain< resist, therm > thermistor_t
Definition
thermistor_func.h:32
Generated on Fri Sep 26 2025 00:10:15 for rusEFI by
1.9.8