

#include "Light_Sensor.h"
#include "Light_Sensor_Interface.h"
#include "Simulated_IIC_2_Master.h"

void ALS_Delay_100us(ALS_uint8_t u8ALSData)
{
	ALS_uint32_t ALSDelayCount = 0;
	ALS_uint32_t i = 0;
	ALS_uint32_t j = 0;
	for (j = 0; j < u8ALSData; j++)
	{
		for (i = 0; i < 1000; i++)
		{
			ALSDelayCount++;
		}
	}
}

/****************初始化函数调用示例*************/
void Light_Sensor_Init_Example(void)
{
	Light_Sensor_Par_st_t stALSInitPar;

	stALSInitPar.pfnALSDelay100usCB = ALS_Delay_100us;
	stALSInitPar.pfnALSIICStartCB = Simulated_IIC_2_Start;
	stALSInitPar.pfnALSIICStopCB = Simulated_IIC_2_Stop;
	stALSInitPar.pfnALSIICTxDataCB = Simulated_IIC_2_Transmit_Data;
	stALSInitPar.pfnALSIICTxACKCB = Simulated_IIC_2_Transmit_ACK;
	stALSInitPar.pfnALSIICRxDataCB = Simulated_IIC_2_Receive_Data;
	stALSInitPar.pfnALSIICRxACKCB = Simulated_IIC_2_Receive_ACK;

	ALS_Init(&stALSInitPar);
}
