The tcDspThermBase class is a virtual base class to provide consistent access to various thermistor devices. More...
#include <core/DspThermBase.h>
Public Member Functions | |
tcDspThermBase (float anVref, unsigned int anAdcBits, float anFeedbackR, float anBeta) | |
This constructor is used to initialize the thermistor base class. | |
virtual | ~tcDspThermBase () |
Destructor. | |
virtual void | SetSensorVal (unsigned short anVal) |
This routine updates the sensor's current value, and computes the matching temperature. | |
virtual float | GetSensorTemp (void) |
This routine returns a given sensor's current temperature, in deg-C. | |
virtual void | GetThermoParams (float &arT0, float &arRt0, float &arVin) |
This routine returns the current constants in use by the Thermistor derived class. | |
virtual bool | SetThermoParams (float anT0=0.0f, float anRt0=0.0f, float anVin=0.0f) |
This routine may be used to update the constants in use by the Thermistor derived class. | |
Static Public Attributes | |
static const int | gnKelvinToCentigrade = 273 |
Conversion from deg-K to deg-C. | |
Protected Member Functions | |
virtual void | ComputeTemp (void)=0 |
Protected Attributes | |
SEM_Handle | mhMutex |
Serial access across threads. | |
unsigned int | mnAdcSteps |
ADC data range. | |
float | mnVReference |
Reference voltage. | |
float | mnFeebackR |
feedback resistor value (ohms) | |
float | mnBeta |
thermistor beta value | |
unsigned short | mnAdcCount |
last-known ADC count | |
float | mnTempDegC |
last computed temperature (deg-C) | |
float | mnT0 |
Temperature T0 (in deg-K). | |
float | mnRt0 |
Resistance @ T0. | |
float | mnVin |
Thermistor input voltage. |
The tcDspThermBase class is a virtual base class to provide consistent access to various thermistor devices.
It provides functions for converting ADC counts into temperatures and storing the last-known values.
tcDspThermBase::tcDspThermBase | ( | float | anVref, | |
unsigned int | anAdcBits, | |||
float | anFeedbackR, | |||
float | anBeta | |||
) |
This constructor is used to initialize the thermistor base class.
[in] | anVref | Reference voltage for the thermistor. |
[in] | anAdcBits | Number of bits returned by ADC. |
[in] | anFeedbackR | Feedback resistor value. |
[in] | anBeta | Thermistor Beta value. |
tcDspThermBase::~tcDspThermBase | ( | ) | [virtual] |
Destructor.
void tcDspThermBase::SetSensorVal | ( | unsigned short | anVal | ) | [virtual] |
This routine updates the sensor's current value, and computes the matching temperature.
[in] | anVal | Latest ADC value. |
float tcDspThermBase::GetSensorTemp | ( | void | ) | [virtual] |
This routine returns a given sensor's current temperature, in deg-C.
void tcDspThermBase::GetThermoParams | ( | float & | arT0, | |
float & | arRt0, | |||
float & | arVin | |||
) | [virtual] |
This routine returns the current constants in use by the Thermistor derived class.
It is provided mainly for situations where fine tuning of the default parameters may be required.
[in] | arT0 | Reference to T0 temperature (deg-K) |
[in] | arRt0 | Reference to resistance at T0 (ohms) |
[in] | arVin | Reference to thermistor input voltage (volts) |
bool tcDspThermBase::SetThermoParams | ( | float | anT0 = 0.0f , |
|
float | anRt0 = 0.0f , |
|||
float | anVin = 0.0f | |||
) | [virtual] |
This routine may be used to update the constants in use by the Thermistor derived class.
It is provided mainly for situations where fine tuning of the default parameters may be required.
[in] | anT0 | New T0 temperature (deg-K) |
[in] | anRt0 | New resistance at T0 (ohms) |
[in] | anVin | New thermistor input voltage (volts) |
virtual void MityDSP::tcDspThermBase::ComputeTemp | ( | void | ) | [protected, pure virtual] |
const int MityDSP::tcDspThermBase::gnKelvinToCentigrade = 273 [static] |
Conversion from deg-K to deg-C.
SEM_Handle MityDSP::tcDspThermBase::mhMutex [protected] |
Serial access across threads.
unsigned int MityDSP::tcDspThermBase::mnAdcSteps [protected] |
ADC data range.
float MityDSP::tcDspThermBase::mnVReference [protected] |
Reference voltage.
float MityDSP::tcDspThermBase::mnFeebackR [protected] |
feedback resistor value (ohms)
float MityDSP::tcDspThermBase::mnBeta [protected] |
thermistor beta value
unsigned short MityDSP::tcDspThermBase::mnAdcCount [protected] |
last-known ADC count
float MityDSP::tcDspThermBase::mnTempDegC [protected] |
last computed temperature (deg-C)
float MityDSP::tcDspThermBase::mnT0 [protected] |
Temperature T0 (in deg-K).
float MityDSP::tcDspThermBase::mnRt0 [protected] |
Resistance @ T0.
float MityDSP::tcDspThermBase::mnVin [protected] |
Thermistor input voltage.