cancel
Showing results for 
Search instead for 
Did you mean: 

How to enable touch screen interrupt in STM32H747I-DISCO board?

Louie88
Associate III

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

1 ACCEPTED SOLUTION

Accepted Solutions
Mike_ST
ST Employee

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.

View solution in original post

2 REPLIES 2
Mike_ST
ST Employee

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.

Thanks Mike, excellent notes. Touch IT works just fine based on your suggestions.

Many thanks for your help.

Louis