/* Return number of touches detected if there are any. Try to detect new touches and forget the old ones (reset internal global variables).  */
static int32_t SX8651_DetectTouch(SX8651_Object_t *pObj)
/* Return number of touches detected if there are any. Try to detect new touches and forget the old ones (reset internal global variables).  */
static int32_t SX8651_DetectTouch(SX8651_Object_t *pObj)
{
  int32_t ret;
  uint8_t nb_touch = 0;
  sx8651_read_reg(&pObj->Ctx, SX8651_READ_ADDR | SX8651_REG_STAT, &nb_touch, 1);
  nb_touch = ((nb_touch & REG_STAT_CONVIRQ) == REG_STAT_CONVIRQ);
  if ((nb_touch & REG_STAT_CONVIRQ) == REG_STAT_CONVIRQ)
  {
    nb_touch = 1;
  }
  ret = (int32_t)nb_touch;
  return ret;
}