English
Language : 

APDS-9801 Datasheet, PDF (18/24 Pages) AVAGO TECHNOLOGIES LIMITED – Digital Proximity and Analog Ambient Light Sensor
/***********************************************************************
DESC: Read back interrupt threshold value
RETURNS: Threshold Register value
***********************************************************************/
void PXS_ThresHoldRead(void)
{
unsigned char command;
//Read back Interrupt Threshold Low Byte data
command = CMD|ADDR_THRESLOW;
ReadByte_i2c(DeviceAddr, command, &ReadThresholdLow);
//Read back Interrupt Threshold High Byte data
command = CMD|(ADDR_THRESHIGH);
ReadByte_i2c(DeviceAddr, command, &ReadThresholdHigh);
}
/***********************************************************************
DESC: Set the interrupt enable
RETURNS: Nothing
***********************************************************************/
void PXS_IntpEna(unsigned char value)
{
unsigned char command;
command = CMD|ADDR_INTP;
WriteByte_i2c(DeviceAddr, command, value);
}
/***********************************************************************
DESC: Read back Interrupt Register Status
RETURNS: Interrupt status
***********************************************************************/
void PXS_IntpStatusRead(void)
{
unsigned char command;
command = CMD|ADDR_INTP;
ReadByte_i2c(DeviceAddr, command, &IntSta);
}
/***********************************************************************
DESC: Clear the pending thresholds & EOC interrupt
RETURNS: Nothing
***********************************************************************/
void PXS_IntpClr(void)
{
unsigned char command;
//Set the Clear bits of the pending threshold interrupt and EOC interrupt
command = 0x60;
Write_i2c(DeviceAddr, command);
}
18