Hello Mike,
The first thing you do in the example after the hardware initialization is enabling the interrupt that corresponds to the SW8 of the EVK:
EnableIRQ(EXAMPLE_SW_IRQ);
After, you initialize and configure the pin that will trigger the interrupt:
GPIO_PinInit(EXAMPLE_SW_GPIO, EXAMPLE_SW_GPIO_PIN, &sw_config);
The data for the configuration of the pin is inside the structure sw_config. Here you define that the pin will be an input and the interrupt will be generated when a rising edge occurs.
gpio_pin_config_t sw_config = {
kGPIO_DigitalInput,
0,
kGPIO_IntRisingEdge,
};
After, you enable the interrupt of the pin:
GPIO_PortEnableInterrupts(EXAMPLE_SW_GPIO, 1U << EXAMPLE_SW_GPIO_PIN);
The handler is declared with the help of the definitions at the beginning of the file gpio_input_interrupt.c:
#define EXAMPLE_SW_GPIO BOARD_USER_BUTTON_GPIO
#define EXAMPLE_SW_GPIO_PIN BOARD_USER_BUTTON_GPIO_PIN
#define EXAMPLE_SW_IRQ BOARD_USER_BUTTON_IRQ
#define EXAMPLE_GPIO_IRQHandler BOARD_USER_BUTTON_IRQ_HANDLER
#define EXAMPLE_SW_NAME BOARD_USER_BUTTON_NAME
With the 4 define, you are setting the handler's name of the interrupt thanks to the macro BOARD_USER_BUTTON_IRQ_HANDLER
Regards,
Victor