/* Get the touch screen X and Y positions values Manage multi touch thanks to touch Index global variable 'ft3x67_handle.currActiveTouchIdx'.  */
void ft3x67_TS_GetXY(uint16_t DeviceAddr, uint16_t *X, uint16_t *Y)
/* Get the touch screen X and Y positions values Manage multi touch thanks to touch Index global variable 'ft3x67_handle.currActiveTouchIdx'.  */
void ft3x67_TS_GetXY(uint16_t DeviceAddr, uint16_t *X, uint16_t *Y)
{
  uint8_t regAddress = 0U;
  uint8_t dataxy[4U];
  if(ft3x67_handle.currActiveTouchIdx < ft3x67_handle.currActiveTouchNb)
  {
    switch(ft3x67_handle.currActiveTouchIdx)
    {
    case 0U :
      regAddress = FT3X67_P1_XH_REG;
      break;
    case 1U :
      regAddress = FT3X67_P2_XH_REG;
      break;
    default :
      break;
    }
    TS_IO_ReadMultiple(DeviceAddr, regAddress, dataxy, sizeof(dataxy));
    *X = ((dataxy[0U] & FT3X67_TOUCH_POS_MSB_MASK) << 8U) | dataxy[1U];
    *Y = ((dataxy[2U] & FT3X67_TOUCH_POS_MSB_MASK) << 8U) | dataxy[3U];
    ft3x67_handle.currActiveTouchIdx++;
  }
}