Skip to main content
Visitor II
December 16, 2019
Solved

how to disable EXTI interrupt

  • December 16, 2019
  • 1 reply
  • 1285 views

GPIO_Init(GPIOE, GPIO_Pin_7, GPIO_Mode_In_PU_No_IT); ?

is there a standard method?

    This topic has been closed for replies.
    Best answer by Cristian Gyorgy

    Well, it depends on how you configured your external interrupts! It depends if you want to disable it for one bit or multiple bits and so on...

    Put simple, to disable the external interrupt for one port pin, you just need to reset it's position in CR2 register.

    Below is an example for PortB pin 5:

    in asm:
    bres PB_CR2, #5
     
    C (depending on your compiler):
    GPIOB->CR2 &= (uint8_t)(~(1<<5));

    And ofcourse it can be done in various ways, with macros and functions, different definitions etc.

    These things are very well explained in the manuals. So, please read and understand the manuals.

    To just jump into programming, without knowing what's behind does not get you far...

    1 reply

    Visitor II
    December 17, 2019

    Well, it depends on how you configured your external interrupts! It depends if you want to disable it for one bit or multiple bits and so on...

    Put simple, to disable the external interrupt for one port pin, you just need to reset it's position in CR2 register.

    Below is an example for PortB pin 5:

    in asm:
    bres PB_CR2, #5
     
    C (depending on your compiler):
    GPIOB->CR2 &= (uint8_t)(~(1<<5));

    And ofcourse it can be done in various ways, with macros and functions, different definitions etc.

    These things are very well explained in the manuals. So, please read and understand the manuals.

    To just jump into programming, without knowing what's behind does not get you far...

    Visitor II
    December 18, 2019

    got it! maybe i run into fault way.