1
0
forked from me/IronOS
Files
IronOS/source/Core/Drivers/TipThermoModel.h
Ben V. Brown 1f6a3ad167 Pinecil uart (#830)
* Creating uart debug handler

* Simpler get raw uV tip

* Update Setup.cpp

* Debug out working. Moved Logo

Need to update docs around logos before merging this in

* Add in current pwm level + fix signed int

* Update moving logo page for pinecil by 64k

* Update TipThermoModel.h
2021-02-02 19:53:19 +11:00

34 lines
996 B
C++

/*
* TipThermoModel.h
*
* Created on: 7 Oct 2019
* Author: ralim
*/
#ifndef SRC_TIPTHERMOMODEL_H_
#define SRC_TIPTHERMOMODEL_H_
#include "BSP.h"
#include "stdint.h"
class TipThermoModel {
public:
// These are the main two functions
static uint32_t getTipInC(bool sampleNow = false);
static uint32_t getTipInF(bool sampleNow = false);
// Calculates the maximum temperature can can be read by the ADC range
static uint32_t getTipMaxInC();
static uint32_t convertTipRawADCToDegC(uint16_t rawADC);
static uint32_t convertTipRawADCToDegF(uint16_t rawADC);
// Returns the uV of the tip reading before the op-amp compensating for pullups
static uint32_t convertTipRawADCTouV(uint16_t rawADC,bool skipCalOffset=false);
static uint32_t convertCtoF(uint32_t degC);
static uint32_t convertFtoC(uint32_t degF);
private:
static uint32_t convertuVToDegC(uint32_t tipuVDelta);
static uint32_t convertuVToDegF(uint32_t tipuVDelta);
};
#endif /* SRC_TIPTHERMOMODEL_H_ */