/****************************************************************************
 Title	:	TERMINAL FOR VISUALIZATION AND CONTROL CONDITIONS IN HOUSE
 Author	:	Patrik Szalay <xszala01@stud.feec.vutbr.cz>
 File	:	lm75.h
 Software:	CodeWarrior Development Studio Version: 10.6 Build Id:140329
 Target	:	MC9S08LH64
*****************************************************************************/
#ifndef LM75_H_
#define LM75_H_

#include "iiclib.h"
#include <hidef.h>
#include "derivative.h"
#include "temp_meas.h"


/* LM75 Pointer register definition */
#define LM75_TEMP_REG 0x00
#define LM75_CONF_REG 0x01
#define LM75_THYST_REG 0x02
#define LM75_TOS_REG 0x03

/* LM75 Configuration register definition */
#define LM75_OS_F_QUE_MASK 24
#define LM75_OS_POL_MASK 4
#define LM75_OS_COMP_INT_MASK 2
#define LM75_SHUTDOWN_MASK 1

#define LM75_TEMP_SIGN_MASK 0x80

void lm75_set_conf(ADDRESS add, unsigned char ConfR, char* data);

#ifdef __NO_FLOAT__
	decimal lm75_readTemp_decimal(ADDRESS add, char* data);
#else
	float lm75_readTemp_float(unsigned char addr);
#endif
char lm75_readTemp_char(ADDRESS add, char* data);
unsigned char lm75_readConfig(ADDRESS add, char* data);

#endif /* LM75_H_ */
