Electronic – External interrupts in stm32f10x

gpiogpio-external-interruptinterruptsstm32stm32f10x

I'm not quite sure how external interrupts will work with several peripherals on the same EXTI line.

For instance, if I configured interrupt on line X and on the same line(of course another GPIO port) I have SPI MOSI or SCK, or maybe ADC working, would I receive interrupt every time one of these pins was triggered? And if I do then is it possible to get information about what pin was actually triggered?

Thanks.

Best Answer

When using a GPIO pin for external interrupt (without setting the alternative function for the pin) you can have exactly one interrupt per line. Hence, you can never have an external interrupt for both PA6 and PB6 since they are located on the same line.

However, when you are activating the alternative function for a pin as you would do for SPI and other peripherals you will get the interrupt from the peripheral itself (i.e. another interrupt vector).

You can not configure a pin as both alternative function and as a GPIO pin (with external interrupt).