AnsweredAssumed Answered

FRDM-K64F Interrupt Handling - How to perform?

Question asked by dgrullon on Oct 13, 2017
Latest reply on Oct 15, 2017 by Kerry Zhou

====================================

The Situation

====================================

I'm trying to figure out how to control interrupts. I've looked at the GPIO driver SDK example called 'gpio_input_interrupt' (as this is the closest to what I'm trying to do). I see that in the initialization they perform these functions:

 

    /* Init input switch GPIO. */
    PORT_SetPinInterruptConfig(BOARD_SW_PORT, BOARD_SW_GPIO_PIN, kPORT_InterruptFallingEdge);
    EnableIRQ(BOARD_SW_IRQ);
    GPIO_PinInit(BOARD_SW_GPIO, BOARD_SW_GPIO_PIN, &sw_config);

And that this function is what handles the interrupt:

void BOARD_SW_IRQ_HANDLER(void);

 

====================================

The Questions

====================================

  1. Is there a step by step tutorial on how to handle interrupts?
  2. How does the MCU know to go to BOARD_SW_IRQ_HANDLER() when the button is pressed?
  3. The EnableIRQ() function is not included in the API Reference manual that came with my SDK, does anyone know where I can get information on this?
  4. What if I wanted to have multiple interrupts for different GPIO pins but they are all on the same port - can they each have their own function?

 

Thank you very much!

Outcomes