Part Number: EK-TM4C123GXL
I think there should be a clean example showing the order of statements used to initialize GPIO interrupts. Today I learned to things.
GPIOPinTypeGPIOInput() must come before GPIOPadConfigSet() because GPIOPadConfigSet() needs to know which pins are inputs to setup the termination resistors. Swap them and it does not work.
GPIOPadConfigSet() must come before IntEnable() or it will have no effect.
I don't want to waste time if there is a good example to use but with GPIO ISR it seems half get the status and then clear and the other have issue a clear and then try to read status.
Here what is working for me at the moment:
void initGPIO(void)
{
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, LED_PINS);
GPIOPinTypeGPIOInput(GPIO_PORTF_BASE, INT_PINS);
GPIOPadConfigSet(GPIO_PORTF_BASE, INT_PINS, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD_WPU);
GPIOIntEnable(GPIO_PORTF_BASE, INT_PINS);
GPIOIntTypeSet(GPIO_PORTF_BASE, INT_PINS, GPIO_LOW_LEVEL);
IntPrioritySet(INT_GPIOF, 0);
IntRegister(INT_GPIOF, GPIOIntHandler);
IntEnable(INT_GPIOF);
IntMasterEnable();
}
But what do I know I am a TivaWare newbie and yet older than dirt too.
BTW, where does Tiva come from?
John