A
A
Alexander Dubina2015-06-05 11:51:48
Microcontrollers
Alexander Dubina, 2015-06-05 11:51:48

Find out which pin caused an external interrupt on STM32F4?

I need to read a lot of interrupts (more than 10 to start), and I would like not to occupy all the X0-X10 pins.
I'm wondering if it's possible, using the standard approach:

void EXTI0_IRQHandler(void)
{
    //Check if EXTI_Line0 is asserted
    if(EXTI_GetITStatus(EXTI_Line0) != RESET)
    {
    LEDToggle(LEDG);
    }
    //we need to clear line pending bit manually
    EXTI_ClearITPendingBit(EXTI_Line0);
}

find out and check not only the interrupt line, but also the name of the pin, let's say PD0 or PB0 caused an interrupt?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Dubina, 2015-06-05
@struggleendlessly

from what I found but haven't tried yet.
You cannot assign several pins to one line at once, for example PD0 or PB0, which will initiate an interrupt. Only one.
If so, then there is no need for verification.
If it is possible - tell me.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question