Here is my main function:
#include <stdint.h>
#include "tm4c123gh6pm.h"
#include "tm4c_cmsis.h"
#include "bsp.h"
int main()
{
// Initialize and enable GPIOF
SYSCTL->RCGC2 |= 0x20; // Disable clock gating of GPIOF
SYSCTL->GPIOHSCTL |= 0x20; // Enable high speed bus
GPIOF_HS->LOCK |= GPIO_KEY; // Unlock GPIOF
GPIOF_HS->CR |= 0xFF; // Enable GPIOF commits
GPIOF_HS->PUR |= 0x11; // Set GPIOF push button pins to pull-up
GPIOF_HS->DIR |= 0x0E; // Set GPIOF LED pins to output
GPIOF_HS->DEN |= 0x1F; // Set GPIOF pins to digital enabled
// Configure interrupt for push buttons
__enable_interrupt();
__NVIC_SetPriority(30, 1);
GPIOF_HS->IM &= 0x00; // Mask all GPIOF interupts, preventing iterupts
GPIOF_HS->IS |= 0x11; // Configure GPIOF push button pins for low level detection
GPIOF_HS->IM |= 0x11; // Un-mask GPIOF push button interupts, enabling them
while (1)
{
GPIOF_HS->DATA_Bits[LED_W] = LED_OFF;
}
return 0;
}
I have a vector table set up that I used to successfully implement SysTick and PendSV handlers, and now I want to figure out how to get the GPIOF IRQ to work, but I am stumped, and cannot figure out what I am doing wrong. I have previously gotten the push buttons to light an LED, so I know they are working correctly, but I am not sure what I am doing wrong in initializing the buttons to trigger an IRQ. Can anyone here help me figure this out?