#ifdef __cplusplus
extern "C" {
#endif

#ifdef LM73_EXPORTS
#define LM73_API __declspec(dllexport)
#else
#define LM73_API __declspec(dllimport)
#endif

#ifdef _DEBUG
#define LOGGING 0x1
#else
#define LOGGING 0x0
#endif


#include <windows.h>

LM73_API typedef struct {						
	double	Temperature;	//OUT signed LM73 temperatures -40 to +150 C
	FLOAT   inTemperature;	//IN temperature to write to a register
	UCHAR	Selection;		//IN selection of which register to read/write 
	UCHAR	Value;			//IN value to write to a register. OUT return a result other than temperature
	UCHAR	Error;			//OUT device error
} tLM73Values, *ptLM73Values;

WORD   ConvertInputValue(float inValue);
double ConvertLSBValue(WORD value, DWORD resolution);
DWORD  LM73SmbError(LPCWSTR msg, tLM73Values  *pDeviceValues, UCHAR SmbStatus);
DWORD  IsFilter(tLM73Values  *pDeviceValues);

LM73_API DWORD LM73Init();
LM73_API DWORD LM73DeInit();
LM73_API DWORD LM73TempGet (tLM73Values  *pDeviceValues);
LM73_API DWORD LM73TempLimitGet (tLM73Values  *pDeviceValues);
LM73_API DWORD LM73TempLimitSet (tLM73Values  *pDeviceValues);
LM73_API DWORD LM73TempResolutionGet(tLM73Values  *pDeviceValues);
LM73_API DWORD LM73TempResolutionSet(tLM73Values  *pDeviceValues);
LM73_API DWORD LM73TempStatusGet(tLM73Values  *pDeviceValues);
LM73_API DWORD LM73TempAlertSet(tLM73Values  *pDeviceValues);
LM73_API DWORD LM73TempIsAlertEnabled(tLM73Values  *pDeviceValues);



#ifdef __cplusplus
}
#endif
