2021-08-10 12:24 AM
Hi,
I created a touch screen initialization function. The touch screen works just fine if a I poll the TS_State.TouchDetected flag. If I enable the touch interrupt from the initialization function I get a compiler error message:
uint32_t InitializeTouchScreen(void)
{
TS_Init_t hTS;
uint32_t ts_status;
hTS.Width = LCD_GetXSize(); //800;
hTS.Height = LCD_GetYSize(); //480;
hTS.Orientation = TS_SWAP_XY | TS_SWAP_Y;
hTS.Accuracy = 0;
ts_status = BSP_TS_Init(0, &hTS);
// Enable touch IT
BSP_TS_EnableIT(0);
return ts_status;
}
The error message:
... stm32h747i_discovery_ts.c:252: undefined reference to `HAL_EXTI_GetHandle'...
The "stm32Cube-bsp-drivers.pdf" manual does not help. It just lists the interrupt enable function but there is no explanation how to use it.
I also wonder how I can detect the touch interrupt (once it compiles). It is a GPIO pin in the HAL_GPIO_EXTI_Callback() callback function, GPIO PK.7, I guess:
// stm32h747I_discovery_ts.h line 88
#define TS_INT_PIN ((uint32_t)GPIO_PIN_7)
#define TS_INT_GPIO_PORT ((GPIO_TypeDef*)GPIOK)
Thank you for your help!
Louis
Solved! Go to Solution.
2021-08-10 01:24 AM
Hello,
>> undefined reference to `HAL_EXTI_GetHandle'...
Please check that you are actually compiling the stm32h7xx_hal_exti.c file.
And uncommented the #define HAL_EXTI_MODULE_ENABLED line in stm32h7xx_hal_conf.h
>> also wonder how I can detect the touch interrupt (once it compiles)
After you called BSP_TS_EnableIT(0), in stm32h7xx_it.c you can define EXTI9_5_IRQHandler to catch interrupts from GPIOK Pin 7.
2021-08-10 01:24 AM
Hello,
>> undefined reference to `HAL_EXTI_GetHandle'...
Please check that you are actually compiling the stm32h7xx_hal_exti.c file.
And uncommented the #define HAL_EXTI_MODULE_ENABLED line in stm32h7xx_hal_conf.h
>> also wonder how I can detect the touch interrupt (once it compiles)
After you called BSP_TS_EnableIT(0), in stm32h7xx_it.c you can define EXTI9_5_IRQHandler to catch interrupts from GPIOK Pin 7.
2021-08-10 04:11 AM
Thanks Mike, excellent notes. Touch IT works just fine based on your suggestions.
Many thanks for your help.
Louis