cancel
Showing results for 
Search instead for 
Did you mean: 

Enable/ disable EXTI interrupts using HAL

AlexandrosAA
Associate III

Hey guys.

I need to enable/disable the line 14 of the EXTI interrupts multiple times, using HAL

Do i just use the HAL_NVIC_DisableIRQ  HAL_NVIC_EnableIRQ  ( and HAL_NVIC_SetPriority whenever i re-enable the line?), providing the correct handle to the api each time?

1 ACCEPTED SOLUTION

Accepted Solutions
Sarra.S
ST Employee

Hello @AlexandrosAA

You only need to set the priority once using HAL_NVIC_SetPriority unless you need to change the priority dynamically.

to enable the interrupt: HAL_NVIC_EnableIRQ(EXTI15_10_IRQn);

to disable the interrupt: HAL_NVIC_DisableIRQ(EXTI15_10_IRQn);

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

2 REPLIES 2
Pavel A.
Evangelist III

To enable/disable EXTI interrupts, you can set and clear raising/falling edge detection bit of the needed line in EXTI registers EXTI_RTSR1 and/or EXTI_FTSR1. Leave the NVIC interrupt enabled.  Not sure if the HAL library has a function for this. If not, do it without the HAL.

Sarra.S
ST Employee

Hello @AlexandrosAA

You only need to set the priority once using HAL_NVIC_SetPriority unless you need to change the priority dynamically.

to enable the interrupt: HAL_NVIC_EnableIRQ(EXTI15_10_IRQn);

to disable the interrupt: HAL_NVIC_DisableIRQ(EXTI15_10_IRQn);

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.