Skip to main content
Explorer II
December 1, 2023
Solved

GPIO Interrupt

  • December 1, 2023
  • 5 replies
  • 5549 views

Is it possible to disable a specific GPIO interrupt in my code and re-enable it after some time. HAL_NVIC_DisableIRQ(EXTI4_15_IRQn) this function will help but this will disable all the GPIO pins connected to that particular EXTI line. Any other possible ways I can implement?

    This topic has been closed for replies.
    Best answer by Pavel A.

    You can use LL_EXTI_EnableIT_0_31()  and  LL_EXTI_DisableIT_0_31() 

     

    5 replies

    Super User
    December 1, 2023

    Which STM32?

    In most STM32 the individual EXTI interrupts are enabled/disabled in the EXTI_IMR register, see EXTI chapter in Reference Manual (RM).

    JW

    Explorer II
    December 1, 2023

    Hi @waclawek.jan

    I am using STM32G474RCT6 controller.

    Should I need to make changes in the EXTI_IMR register. Or are there any HAL functions I can use to Implement this. Currently I could be able to disable EXTI15_10_IRQn which disables all the GPIOs connected to this line.

    Sri_Nishanth_0-1701421306953.png

     

     
    Super User
    December 1, 2023

    I don't use Cube/HAL.

    I've seen in the past users to perform the same operation as when initializing the pin, just without the interrupt being set.

    JW

    Technical Moderator
    December 1, 2023

    Hello @Sri_Nishanth 

     

    FBelaid_0-1701425704816.png

    According to the reference manual, EXTI line dedicated to 10->15 are regrouped in one vector in NVIC controller. So, using CMSIS, this should not be possible. Maybe, we can implement this operation in HAL driver using directly EXTI_IMR. I will forward the request to dedicated team. 

    Explorer II
    December 1, 2023

    Hi @FBL 

    Okay sure.

    Thanks for the help!!

    Pavel A.Answer
    Super User
    December 1, 2023

    You can use LL_EXTI_EnableIT_0_31()  and  LL_EXTI_DisableIT_0_31() 

     

    Explorer II
    December 4, 2023

    Thanks!!

    This worked:grinning_face::handshake:

    Super User
    August 15, 2024

    These are two different things.

    First comes the multiplexer controlled by SYSCFG register, which selects, which port's pin is used for that particular EXTIn, n = 0..15.

    Then output of that multiplexer enters EXTI module and you can then there enable/disable individual EXTI in the EXTI_IMR register, see EXTI chapter in Reference Manual (RM). That's what those LL functions/macros do.

    Cube/LL is open source, so you can look up yourself what the macros/functions do.

    JW