rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Functions | Variables
init_thermistors.cpp File Reference

Functions

static CCM_OPTIONAL FunctionalSensor clt (SensorType::Clt, MS2NT(10))
 
static CCM_OPTIONAL FunctionalSensor iat (SensorType::Iat, MS2NT(10))
 
static CCM_OPTIONAL FunctionalSensor aux1 (SensorType::AuxTemp1, MS2NT(10))
 
static CCM_OPTIONAL FunctionalSensor aux2 (SensorType::AuxTemp2, MS2NT(10))
 
static CCM_OPTIONAL FunctionalSensor oilTempSensor (SensorType::OilTemperature, MS2NT(10))
 
static CCM_OPTIONAL FunctionalSensor fuelTempSensor (SensorType::FuelTemperature, MS2NT(10))
 
static CCM_OPTIONAL FunctionalSensor ambientTempSensor (SensorType::AmbientTemperature, MS2NT(10))
 
static CCM_OPTIONAL FunctionalSensor compressorDischargeTemp (SensorType::CompressorDischargeTemperature, MS2NT(10))
 
static void validateThermistorConfig (const char *msg, thermistor_conf_s &cfg)
 
static SensorConverterconfigureTempSensorFunction (const char *msg, thermistor_conf_s &cfg, FuncPair &p, bool isLinear, bool isPulldown)
 
static void configTherm (const char *msg, FunctionalSensor &sensor, FuncPair &p, ThermistorConf &p_config, bool isLinear, bool isPulldown)
 
static void configureTempSensor (const char *msg, FunctionalSensor &sensor, FuncPair &p, ThermistorConf &p_config, bool isLinear, bool isPulldown=false)
 
void initThermistors ()
 
void deinitThermistors ()
 

Variables

static FuncPair fclt
 
static FuncPair fiat
 
static FuncPair faux1
 
static FuncPair faux2
 
static FuncPair foil
 
static FuncPair ffuel
 
static FuncPair fambient
 
static FuncPair fcdt
 

Function Documentation

◆ ambientTempSensor()

static CCM_OPTIONAL FunctionalSensor ambientTempSensor ( SensorType::AmbientTemperature  ,
MS2NT(10)   
)
static

Referenced by deinitThermistors(), and initThermistors().

Here is the caller graph for this function:

◆ aux1()

static CCM_OPTIONAL FunctionalSensor aux1 ( SensorType::AuxTemp1  ,
MS2NT(10)   
)
static

Referenced by deinitThermistors(), and initThermistors().

Here is the caller graph for this function:

◆ aux2()

static CCM_OPTIONAL FunctionalSensor aux2 ( SensorType::AuxTemp2  ,
MS2NT(10)   
)
static

Referenced by deinitThermistors(), and initThermistors().

Here is the caller graph for this function:

◆ clt()

static CCM_OPTIONAL FunctionalSensor clt ( SensorType::Clt  ,
MS2NT(10)   
)
static

◆ compressorDischargeTemp()

static CCM_OPTIONAL FunctionalSensor compressorDischargeTemp ( SensorType::CompressorDischargeTemperature  ,
MS2NT(10)   
)
static

Referenced by deinitThermistors(), and initThermistors().

Here is the caller graph for this function:

◆ configTherm()

static void configTherm ( const char msg,
FunctionalSensor sensor,
FuncPair &  p,
ThermistorConf p_config,
bool  isLinear,
bool  isPulldown 
)
static

Definition at line 53 of file init_thermistors.cpp.

58 {
59 // nothing to do if no channel
60 if (!isAdcChannelValid(p_config.adcChannel)) {
61 return;
62 }
63
64 // Configure the conversion function for this sensor
65 sensor.setFunction(configureTempSensorFunction(msg, p_config.config, p, isLinear, isPulldown));
66}
bool isAdcChannelValid(adc_channel_e hwChannel)
Definition adc_inputs.h:23
static Lps25Sensor sensor(device)
static SensorConverter & configureTempSensorFunction(const char *msg, thermistor_conf_s &cfg, FuncPair &p, bool isLinear, bool isPulldown)

Referenced by configureTempSensor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ configureTempSensor()

static void configureTempSensor ( const char msg,
FunctionalSensor sensor,
FuncPair &  p,
ThermistorConf p_config,
bool  isLinear,
bool  isPulldown = false 
)
static

Definition at line 68 of file init_thermistors.cpp.

73 {
74 auto channel = p_config.adcChannel;
75
76 // Only register if we have a sensor
78 return;
79 }
80
81 configTherm(msg, sensor, p, p_config, isLinear, isPulldown);
82
83 // Register & subscribe
86}
uint16_t channel
Definition adc_inputs.h:104
static AdcSubscriptionEntry * SubscribeSensor(FunctionalSensorBase &sensor, adc_channel_e channel, float lowpassCutoffHZ, float voltsPerAdcVolt=0.0f)
bool Register()
Definition sensor.cpp:131
static void configTherm(const char *msg, FunctionalSensor &sensor, FuncPair &p, ThermistorConf &p_config, bool isLinear, bool isPulldown)

Referenced by initThermistors().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ configureTempSensorFunction()

static SensorConverter & configureTempSensorFunction ( const char msg,
thermistor_conf_s cfg,
FuncPair &  p,
bool  isLinear,
bool  isPulldown 
)
static

Definition at line 37 of file init_thermistors.cpp.

38 {
39 if (isLinear) {
40 p.linear.configure(cfg.resistance_1, cfg.tempC_1, cfg.resistance_2, cfg.tempC_2, -50, 250);
41
42 return p.linear;
43 } else /* sensor is thermistor */ {
45
46 p.thermistor.get<resist>().configure(5.0f, cfg.bias_resistor, isPulldown);
47 p.thermistor.get<therm>().configure(cfg);
48
49 return p.thermistor;
50 }
51}
static void validateThermistorConfig(const char *msg, thermistor_conf_s &cfg)

Referenced by configTherm().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ deinitThermistors()

void deinitThermistors ( )

Definition at line 142 of file init_thermistors.cpp.

142 {
151}
static void UnsubscribeSensor(FunctionalSensorBase &sensor)
static constexpr engine_configuration_s * engineConfiguration
static CCM_OPTIONAL FunctionalSensor fuelTempSensor(SensorType::FuelTemperature, MS2NT(10))
static CCM_OPTIONAL FunctionalSensor aux2(SensorType::AuxTemp2, MS2NT(10))
static CCM_OPTIONAL FunctionalSensor compressorDischargeTemp(SensorType::CompressorDischargeTemperature, MS2NT(10))
static CCM_OPTIONAL FunctionalSensor iat(SensorType::Iat, MS2NT(10))
static CCM_OPTIONAL FunctionalSensor aux1(SensorType::AuxTemp1, MS2NT(10))
static CCM_OPTIONAL FunctionalSensor ambientTempSensor(SensorType::AmbientTemperature, MS2NT(10))
static CCM_OPTIONAL FunctionalSensor clt(SensorType::Clt, MS2NT(10))
static CCM_OPTIONAL FunctionalSensor oilTempSensor(SensorType::OilTemperature, MS2NT(10))

Referenced by stopSensors().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fuelTempSensor()

static CCM_OPTIONAL FunctionalSensor fuelTempSensor ( SensorType::FuelTemperature  ,
MS2NT(10)   
)
static

Referenced by deinitThermistors(), and initThermistors().

Here is the caller graph for this function:

◆ iat()

static CCM_OPTIONAL FunctionalSensor iat ( SensorType::Iat  ,
MS2NT(10)   
)
static

◆ initThermistors()

void initThermistors ( )

Definition at line 88 of file init_thermistors.cpp.

88 {
91 clt,
92 fclt,
96
98 iat,
99 fiat,
103 }
104
105 configureTempSensor("oil temp",
107 faux2,
109 false);
110
111 configureTempSensor("fuel temp",
113 ffuel,
115 false);
116
117 configureTempSensor("ambient temp",
119 fambient,
121 false);
122
123 configureTempSensor("compressor discharge temp",
125 fcdt,
127 false);
128
129 configureTempSensor("aux1",
130 aux1,
131 faux1,
133 false);
134
135 configureTempSensor("aux2",
136 aux2,
137 faux2,
139 false);
140}
static FuncPair fiat
static void configureTempSensor(const char *msg, FunctionalSensor &sensor, FuncPair &p, ThermistorConf &p_config, bool isLinear, bool isPulldown=false)
static FuncPair ffuel
static FuncPair fcdt
static FuncPair fambient
static FuncPair faux1
static FuncPair fclt
static FuncPair faux2

Referenced by sensorStartUpOrReconfiguration().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ oilTempSensor()

static CCM_OPTIONAL FunctionalSensor oilTempSensor ( SensorType::OilTemperature  ,
MS2NT(10)   
)
static

Referenced by deinitThermistors(), and initThermistors().

Here is the caller graph for this function:

◆ validateThermistorConfig()

static void validateThermistorConfig ( const char msg,
thermistor_conf_s cfg 
)
static

Definition at line 26 of file init_thermistors.cpp.

26 {
27 if (cfg.tempC_1 >= cfg.tempC_2 ||
28 cfg.tempC_2 >= cfg.tempC_3) {
29 firmwareError(ObdCode::OBD_ThermistorConfig, "Invalid thermistor %s configuration: please check that temperatures are in the ascending order %f %f %f",
30 msg,
31 (float)cfg.tempC_1,
32 (float)cfg.tempC_2,
33 (float)cfg.tempC_3);
34 }
35}
void firmwareError(ObdCode code, const char *fmt,...)
@ OBD_ThermistorConfig

Referenced by configureTempSensorFunction().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ fambient

FuncPair fambient
static

Definition at line 24 of file init_thermistors.cpp.

Referenced by initThermistors().

◆ faux1

FuncPair faux1
static

Definition at line 24 of file init_thermistors.cpp.

Referenced by initThermistors().

◆ faux2

FuncPair faux2
static

Definition at line 24 of file init_thermistors.cpp.

Referenced by initThermistors().

◆ fcdt

FuncPair fcdt
static

Definition at line 24 of file init_thermistors.cpp.

Referenced by initThermistors().

◆ fclt

FuncPair fclt
static

Definition at line 24 of file init_thermistors.cpp.

Referenced by initThermistors().

◆ ffuel

FuncPair ffuel
static

Definition at line 24 of file init_thermistors.cpp.

Referenced by initThermistors().

◆ fiat

FuncPair fiat
static

Definition at line 24 of file init_thermistors.cpp.

Referenced by initThermistors().

◆ foil

FuncPair foil
static

Definition at line 24 of file init_thermistors.cpp.

Go to the source code of this file.