#ifndef __DEBUG_H__
#define __DEBUG_H__

#endif

#ifndef __SHTC3_H__
#define __SHTC3_H__

#include <stdlib.h>
#include <stdint.h>
#include "control_comm.h"
#include <stdbool.h>



typedef enum{
  READ_ID            		= 0xEFC8, // command: read ID register
  SOFT_RESET         		= 0x805D, // soft reset
  SLEEP              		= 0xB098, // sleep
  WAKEUP             		= 0x3517, // wakeup
  MEAS_T_RH_POLLING  		= 0x7866, // meas. read T first, clock stretching disabled
  MEAS_T_RH_CLOCKSTR 		= 0x7CA2, // meas. read T first, clock stretching enabled
  MEAS_T_RH_NOCLOCKSTR 		= 0x7688, // meas. read T first, clock stretching enabled
  MEAS_T_RH_POLLING_LPM		= 0x609C,
  MEAS_T_RH_CLOCKSTR_LPM	= 0x6458,
  MEAS_RH_T_POLLING_LPM		= 0x44DE,
  MEAS_RH_T_CLOCKSTR_LPM	= 0x401A,
  MEAS_RH_T_POLLING  		= 0x58E0, // meas. read RH first, clock stretching disabled
  MEAS_RH_T_CLOCKSTR 		= 0x5C24  // meas. read RH first, clock stretching enabled
}etCommands;

typedef enum
{
	SHTC3_NO_ERROR       = 0x00, // no error
	SHTC3_ACK_ERROR      = 0x01, // no acknowledgment error
	SHTC3_CHECKSUM_ERROR = 0x02, // checksum mismatch error
	SHTC3_TIMEOUT_ERROR  = 0x04, // timeout error
	SHTC3_PARM_ERROR     = 0x80, // parameter out of range error
}GetError;


void SHTC3_Init(u8 i2cAddress);
u32 SHTC3_ReadID(u16* id);
u32 SHTC3_GetTempAndHumi(s16* temperature, u16* humidity, bool lowPowerEnable);
u32 SHTC3_SoftReset(void);
u32 SHTC3_GetTemp(s16* temperature);

#define  SHTC3_GET_TEMP(X)    SHTC3_GetTemp(X)
#endif 


