27 if (cfg.tempC_1 >= cfg.tempC_2 ||
28 cfg.tempC_2 >= cfg.tempC_3) {
38 thermistor_conf_s& cfg, FuncPair& p,
bool isLinear,
bool isPulldown) {
40 p.linear.configure(cfg.resistance_1, cfg.tempC_1, cfg.resistance_2, cfg.tempC_2, -50, 250);
46 p.thermistor.get<
resist>().configure(5.0f, cfg.bias_resistor, isPulldown);
47 p.thermistor.get<
therm>().configure(cfg);
56 ThermistorConf &p_config,
71 ThermistorConf &p_config,
73 bool isPulldown =
false) {
74 auto channel = p_config.adcChannel;
static AdcSubscriptionEntry * SubscribeSensor(FunctionalSensorBase &sensor, adc_channel_e channel, float lowpassCutoffHZ, float voltsPerAdcVolt=0.0f)
static void UnsubscribeSensor(FunctionalSensorBase &sensor)
Class for sensors that convert from some raw floating point value (ex: voltage, frequency,...
static constexpr engine_configuration_s * engineConfiguration
void firmwareError(ObdCode code, const char *fmt,...)
static Lps25Sensor sensor(device)
static CCM_OPTIONAL FunctionalSensor fuelTempSensor(SensorType::FuelTemperature, MS2NT(10))
static CCM_OPTIONAL FunctionalSensor aux2(SensorType::AuxTemp2, MS2NT(10))
static void configureTempSensor(const char *msg, FunctionalSensor &sensor, FuncPair &p, ThermistorConf &p_config, bool isLinear, bool isPulldown=false)
static void configTherm(const char *msg, FunctionalSensor &sensor, FuncPair &p, ThermistorConf &p_config, bool isLinear, bool isPulldown)
static SensorConverter & configureTempSensorFunction(const char *msg, thermistor_conf_s &cfg, FuncPair &p, bool isLinear, bool isPulldown)
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))
static void validateThermistorConfig(const char *msg, thermistor_conf_s &cfg)
@ CompressorDischargeTemperature
static chibios_rt::Mailbox< CompositeBuffer *, BUFFER_COUNT > freeBuffers CCM_OPTIONAL