/*
 * author: jimbo
 * date: 2019-03-21
 * version: 1.00
 * e-mail:  zhangbo@storlead.com
 * brief: LM73 driver
 */

#include "bmc_main.h"
#include "i2c_api.h"
/* 
 ** sensor name: LM73_1
 ** brief: temporary 
 **/
int lm73_1_init(hal_t *phal)
{
        printf("init lm73!\n");
        return 0;
}

int lm73_1_write(hal_t *phal)
{
        printf("write lm73!\n");
        return 0;
}

int lm73_1_read(hal_t *phal)
{
        I2C_DEV_T i2c_dev;
//	printf("read lm73!\n");
	uint8_t pData[2];
	i2c_dev.bus = I2C3;
	I2C_Master_Receiver(&i2c_dev,0x94,pData,0x00,0x02);
        *phal->pbyte = pData[0];

        return 0;
}

/* 
 *  ** sensor name: LM73_2
 *   ** brief: temporary 
 *    **/
int lm73_2_init(hal_t *phal)
{
        printf("init lm73!\n");
        return 0;
}

int lm73_2_write(hal_t *phal)
{
        printf("write lm73!\n");
        return 0;
}

int lm73_2_read(hal_t *phal)
{
	I2C_DEV_T i2c_dev;
//        printf("read lm73!\n");
	uint8_t pData[2];
        i2c_dev.bus = I2C3;
        I2C_Master_Receiver(&i2c_dev,0x92,pData,0x00,0x02);
        *phal->pbyte = pData[0];
        return 0;
}

