cancel
Showing results for 
Search instead for 
Did you mean: 

how to disable EXTI interrupt

David.Cheng
Associate II

GPIO_Init(GPIOE, GPIO_Pin_7, GPIO_Mode_In_PU_No_IT); ?

is there a standard method?

1 ACCEPTED SOLUTION

Accepted Solutions
Cristian Gyorgy
Senior III

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...

View solution in original post

2 REPLIES 2
Cristian Gyorgy
Senior III

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...

got it! maybe i run into fault way.