#ifndef HIH6130_INC
#define HIH6130_INC			1

#include	<msc_config.h>

/* Routines to access HIH6130 Temp/Humidity Sensor with I2C Interface */

// HIH6130 I2C ADDRESS BYTES
#define HIH6130_ADDR_WR  	0x4E
#define HIH6130_ADDR_RD   	0x4F

// HIH6130 STATUS CODES
#define HIH6130_VALID_DATA	1
#define HIH6130_STALE_DATA	2 
#define HIH6130_CMD_MODE 	3

// HIH6130 I2C FULL SCALE COUNTS
#define HIH6130_FS_CTS  	0x3FFE  //2^14 - 2

// HIH6130 prototypes
int HIH6130_ReadTempHumidity(float *Temp, float *Humi);
int HIH6130_ReadSensor(ushort *T_cts, ushort *H_cts, uchar *Status);
float calc_dewpoint(float h, float t);

#endif