rusefi/firmware/controllers/sensors/thermistors.h

43 lines
1.3 KiB
C
Raw Normal View History

2015-07-10 06:01:56 -07:00
/**
* @file thermistors.h
*
* @date Feb 17, 2013
2020-01-13 18:57:43 -08:00
* @author Andrey Belomutskiy, (c) 2012-2020
2015-07-10 06:01:56 -07:00
*/
2020-01-20 22:40:11 -08:00
#pragma once
2015-07-10 06:01:56 -07:00
2018-09-16 19:26:57 -07:00
#include "global.h"
2015-07-10 06:01:56 -07:00
#define KELV 273.15f
#include "engine.h"
/**
* Vout=r2/(r1+r2)*Vin
*/
float getR1InVoltageDividor(float Vout, float Vin, float r2);
float getR2InVoltageDividor(float Vout, float Vin, float r1);
float getTempK(float resistance);
/**
* converts Kelvin temperature into Celsius temperature
*/
#define convertKelvinToCelcius(tempK) ((tempK) - KELV)
#define convertCelsiusToKelvin(tempC) ((tempC) + KELV)
float convertCelciustoF(float tempC);
float convertFtoCelcius(float tempF);
2016-12-23 11:01:45 -08:00
float getKelvinTemperature(float resistance, ThermistorMath *tm);
float getResistance(ThermistorConf *cfg, float voltage);
2019-06-19 18:24:09 -07:00
temperature_t getTemperatureC(ThermistorConf *cfg, ThermistorMath *tm, bool useLinear DECLARE_ENGINE_PARAMETER_SUFFIX);
temperature_t getCoolantTemperatureM(DECLARE_ENGINE_PARAMETER_SIGNATURE);
temperature_t getIntakeAirTemperatureM(DECLARE_ENGINE_PARAMETER_SIGNATURE);
2017-05-15 20:33:22 -07:00
void initThermistors(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX);
2015-07-10 06:01:56 -07:00
void setCommonNTCSensor(ThermistorConf *thermistorConf, float pullup);
void setDodgeSensor(ThermistorConf *thermistorConf, float pullup);
void set10K_4050K(ThermistorConf *thermistorConf, float pullup);
2015-07-10 06:01:56 -07:00