Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

TM4C1290NCPDT: ISR on PQ2

$
0
0

Part Number: TM4C1290NCPDT

startup_ccs.c file

 IntDefaultHandler,                      // GPIO Port Q (Summary or Q0)

 ResetDebugISR,                      // GPIO Port Q2

I need to check if interrupt on PQ2 has triggered.. Is the API for interrupt status correct?

I don't have any other interrupt on port Q except on pin PQ2.

Thanks,

Priya

void ResetDebugGPIO_Initialize(void)
{
    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOQ);
    resetDbgIntTriggered = 0;
        //Set Pin as input
    ROM_GPIOPinTypeGPIOInput(GPIO_PORTQ_BASE, GPIO_PIN_2);
    ROM_GPIOIntRegisterPin(GPIO_PORTQ_BASE, GPIO_PIN_2, ResetDebugISR);
    ROM_GPIOIntTypeSet(GPIO_PORTQ_BASE, GPIO_PIN_2, GPIO_FALLING_EDGE);
    ROM_GPIOPinIntEnable(GPIO_PORTQ_BASE, GPIO_PIN_2);
}
void ResetDebugISR(void)
{
    bool bMasked = false;
    uint32_t intStatus = 0;
        //Check if this is a GPIO Interrupt
        intStatus = ROM_GPIOPinIntStatus(GPIO_PORTQ_BASE, bMasked);
        if((intStatus & GPIO_PIN_2) == GPIO_PIN_2)
        {
            //CLEAR THE INTERUPT
            resetDbgIntTriggered = 1;
            ROM_GPIOPinIntClear(GPIO_PORTQ_BASE, GPIO_PIN_2);
            resetDbgIntTriggered = 0;
        }
}
//PN

Viewing all articles
Browse latest Browse all 262198

Trending Articles