|
|
|
@ -14,8 +14,8 @@ class TSYS01 {
@@ -14,8 +14,8 @@ class TSYS01 {
|
|
|
|
|
public: |
|
|
|
|
|
|
|
|
|
bool init(uint8_t bus); |
|
|
|
|
float temperature(void) { return _temperature; } // temperature in degrees C
|
|
|
|
|
bool healthy(void) { // do we have a valid temperature reading?
|
|
|
|
|
float temperature(void) const { return _temperature; } // temperature in degrees C
|
|
|
|
|
bool healthy(void) const { // do we have a valid temperature reading?
|
|
|
|
|
return _healthy; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -25,11 +25,11 @@ private:
@@ -25,11 +25,11 @@ private:
|
|
|
|
|
float _temperature; // degrees C
|
|
|
|
|
bool _healthy; // we have a valid temperature reading to report
|
|
|
|
|
uint16_t _k[5]; // internal calibration for temperature calculation
|
|
|
|
|
bool _reset(void); // reset device
|
|
|
|
|
bool _reset(void) const; // reset device
|
|
|
|
|
bool _read_prom(void); // read (relevant) internal calibration registers into _k
|
|
|
|
|
bool _convert(void); // begin an ADC conversion (min:7.40ms typ:8.22ms max:9.04ms)
|
|
|
|
|
uint32_t _read_adc(void); |
|
|
|
|
uint16_t _read_prom_word(uint8_t word); |
|
|
|
|
bool _convert(void) const; // begin an ADC conversion (min:7.40ms typ:8.22ms max:9.04ms)
|
|
|
|
|
uint32_t _read_adc(void) const; |
|
|
|
|
uint16_t _read_prom_word(uint8_t word) const; |
|
|
|
|
void _timer(void); // update the temperature, called at 20Hz
|
|
|
|
|
void _calculate(uint32_t adc); // calculate temperature using adc reading and internal calibration
|
|
|
|
|
}; |
|
|
|
|