STemWin Touch Input on STM32F429 (STMPE811)
Hello,
Finally, I got STemWin working with my current settings (AC6 + ST Std.Periph.Lib)
For the resistive touch panel mounted on the STM32F429-Disco Board, I’m using the driver bundled with the firmware package (stm32f429i_discovery_ioe.c).
Up to this moment, I have been able to initialize and configure the TP. I have been able to read the TP, too, and this is a small test program I have made to test the TP functionality:
TP_State = IOE_TP_GetState();
if((TP_State->TouchDetected))
{
GPIOG->ODR |= GPIO_Pin_13;
GUI_DrawPoint(TP_State->X, TP_State->Y);
}
else
if(!(TP_State->TouchDetected))
{
GPIOG->ODR &= ~GPIO_Pin_13;
}
However, when it comes to STemWin, I just don’t understand the mechanism used to read the TP and send its data to the GUI. I tried adding the following to the IOE_TP_GetState(void) function, but it doesn’t work!
GUI_TOUCH_StoreStateEx(&TS_State);
GUI_Exec();
And in the main loop, I call
switch (GUI_GetKey()
{
case GUI_ID_BUTTON1: // Button and its handle created earlier!
break;
default:
break;
}
GUI_Demos were too messy and very difficult to trace/absorb! Any advice?
Thank you!