/* Read the SX8651 device ID, pre initialize I2C in case of need to be able to read the SX8651 device ID, and verify this is an SX8651.  */
int32_t SX8651_ReadID(SX8651_Object_t *pObj, uint32_t *Id)
/* Read the SX8651 device ID, pre initialize I2C in case of need to be able to read the SX8651 device ID, and verify this is an SX8651.  */
int32_t SX8651_ReadID(SX8651_Object_t *pObj, uint32_t *Id)
{
  int32_t ret = SX8651_OK;
  uint8_t data = 0;
  if (sx8651_read_reg(&pObj->Ctx, SX8651_READ_ADDR | SX8651_REG_CHAN_MSK, &data, 1) != SX8651_OK)
  {
    ret = SX8651_ERROR;
  }
  *Id = (uint32_t)data;
  return ret;
}