/* Return if there is touch detected or not.  */
uint8_t stmpe811_TS_DetectTouch(uint16_t DeviceAddr)
/* Return if there is touch detected or not.  */
uint8_t stmpe811_TS_DetectTouch(uint16_t DeviceAddr)
{
  uint8_t state;
  uint8_t ret = 0;
  state = ((IOE_Read(DeviceAddr, STMPE811_REG_TSC_CTRL) & (uint8_t)STMPE811_TS_CTRL_STATUS) == (uint8_t)0x80);
  if(state > 0)
  {
    if(IOE_Read(DeviceAddr, STMPE811_REG_FIFO_SIZE) > 0)
    {
      ret = 1;
    }
  }
  else
  {
    IOE_Write(DeviceAddr, STMPE811_REG_FIFO_STA, 0x01);
    IOE_Write(DeviceAddr, STMPE811_REG_FIFO_STA, 0x00);
  }
  return ret;
}