Skip to main content
Uusta.1
Associate III
December 29, 2021
Question

touchgfx SPI touch controller

  • December 29, 2021
  • 1 reply
  • 889 views

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;
}

This topic has been closed for replies.

1 reply

Osman SOYKURT
ST Technical Moderator
February 23, 2022

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

ST Software Developer | TouchGFX