cancel
Showing results for 
Search instead for 
Did you mean: 

touchgfx SPI touch controller

Uusta.1
Associate III

Hi!

I am using is resistive touch panel which is handled by XPT2046 (TSC2046), Touch controller controlled by SPI. I added xpt2046 library to my file. I configured SPI_HandleTypeDef to mine. And I added code as you see below. What else do I need to detect touches on my board

bool STM32TouchController::sampleTouch(int32_t& x, int32_t& y)
{
	if (XPT2046_TouchPressed()) {
			XPT2046_TouchGetCoordinates((uint16_t*) &x, (uint16_t*) &y);
			return true;
		}
    return false;
}

1 REPLY 1
Osman SOYKURT
ST Employee

Hello Uusta.1,

Could you give more information about your configuration please ?

  • Which board do you use ?
  • Which version of TouchGFX Designer do you use ?
  • Which version of STM32CubeMX do you use ?

Are you using a TouchGFX Board Setup or did you start your project from scratch?

/Osman

Osman SOYKURT
ST Software Developer | TouchGFX