#ifndef BIWAK_TMP117_HPP
#define BIWAK_TMP117_HPP
//-----------------------------------------------------------------------------
///
/// \brief  QT GUI for showing TMP117 sensor values
///
/// \date   20220502
/// \author Maximilian Seesslen <development@seesslen.net>
///
//-----------------------------------------------------------------------------

#include <biwak/i2c_slave.h>

class CTmp117: public CI2cSlave
{
private:
   //int m_file;
   static constexpr uint8_t regTemperature=0x00;
   static constexpr uint8_t regConfig=0x01;
   uint16_t m_config;

public:
   CTmp117( CI2c &i2cBus, int address = 0x48 );

   uint16_t readRaw(uint8_t reg);
   uint16_t getRawTemperature();
   int convertTemperature(int16_t raw);
   float convertTemperature_f(int16_t raw);
   int getTemperature();
   float getTemperature_f();
   void writeConfig(uint16_t conf);
};


//---fin----------------------------------------------------------------------
#endif // ? ! BIWAK_TMP117_HPP
