I am trying to integrate an external interrupt into my RTOS project. I wanted to know if I am initializing the GPIO XINT1 correctly? See the picture and code below.
// GPIO0 is an input
EALLOW;
GpioCtrlRegs.GPAMUX1.bit.GPIO0 = 0; // GPIO
GpioCtrlRegs.GPADIR.bit.GPIO0 = 0; // input
EDIS;
// GPIO0 is XINT1
EALLOW;
GpioIntRegs.GPIOXINT1SEL.bit.GPIOSEL = 0; // XINT1 is GPIO0
EDIS;
// Configure XINT1
XIntruptRegs.XINT1CR.bit.POLARITY = 0; // Falling/Rising edge interrupt
// Enable XINT1
XIntruptRegs.XINT1CR.bit.ENABLE = 1; // Enable XINT1