#ifdef __cplusplus
extern "C" {
#endif

#ifdef LM95245_EXPORTS
#define LM95245_API __declspec(dllexport)
#else
#define LM95245_API __declspec(dllimport)
#endif

#include <windows.h>

LM95245_API typedef struct {						
	CHAR	LclTempMSB;	//OUT signed local temperatures -55 to +125 C
	double	LclTempLSB;	//OUT signed local temperatures < 1 and > 0
	CHAR	RemTempMSB;	//OUT signed temperatures -55 to +125 C
	double	RemTempLSB;	//OUT signed temperatures < 1 and > 0
	UCHAR	uRemTempMSB;		//OUT unsigned remote temperatures 0-255 C
    double	uRemTempLSB;		//OUT remote temperatures < 1 and > 0
	UCHAR	Selection;		//IN selection of which register to read/write 
	UCHAR	Value;			//IN value to write to a register. OUT return a result
	UCHAR	Error;			//OUT device error
} tLM95245Values, *ptLM95245Values;


double ConvertLSBValue(UCHAR value,BOOL FilterEnabled);
DWORD  SmbError(LPCWSTR msg, tLM95245Values  *pTemperature,  UCHAR SmbStatus);
DWORD   IsFilter(tLM95245Values  *pTemperature);

LM95245_API DWORD LM95245Init();
LM95245_API DWORD LM95245DeInit();
LM95245_API DWORD LM95245TempGet (UCHAR Sensor,tLM95245Values  *pTemperature /* location to store the temperature */);

LM95245_API DWORD LM95245TempLimitGet (tLM95245Values  *pTemperature);

LM95245_API DWORD LM95245TempLimitSet (tLM95245Values  *pTemperature);

LM95245_API DWORD LM95245TempFilterEnable (BOOL Mode,  tLM95245Values  *pTemperature);

LM95245_API DWORD LM95245StatusReg1Get (tLM95245Values  *pDeviceValues);

LM95245_API DWORD LM95245StatusReg2Get (tLM95245Values  *pDeviceValues);




#ifdef __cplusplus
}
#endif
