/* Detects whether Si1147 is on the i2c bus.  */
int Si1147_Detect_Device(I2C_TypeDef *i2c, uint8_t addr)
/* Detects whether Si1147 is on the i2c bus.  */
int Si1147_Detect_Device(I2C_TypeDef *i2c, uint8_t addr)
{
  uint8_t data;
  si114x_handle->addr = addr;
  si114x_handle->i2c  = i2c;
  data                = Si114xReadFromRegister(si114x_handle, 0);
  if (data == SI1147_DEVICE_ID)
  {
    return 1;
  }
  return 0;
}