This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
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?
Let me strongly suggest that you use the drivers provided in TivaWare instead of doing direct register writes. You will gain efficiency in writing your code using proven routines and you will find better support in the examples and in support from other users on the forum. There is an example in the TivaWare documentation (page 285) on using GPIOA for interrupts. You can follow this example changing it to GIOPF.