Hi TI,
I am beginner to External Interrupts, I am a bit confused on how to trigger external interrupts and read data from GPIO A port.
Here are my testing requirements:
1: I want to use GPIO10 to trigger the external interrupts with falling edge
2: I set two external interrupts to GPIO8(rising edge) and GPIO9(rising edge), one is for reading data from GPIO0-GPIO7 and another for writing data to GPIO0-GPIO7
3: Here are my GPIO Setups, let me know if there are some mistakes here:
For GPIO0 to GPIO7, rest of them are the same as GPIO0
GpioCtrlRegs.GPAPUD.bit.GPIO0 = 0; // Enable pullup on GPIO0 GpioCtrlRegs.GPAQSEL1.bit.GPIO0 = 3; // asynch input
For GPIO8 and GPIO9: (GPIO 9 is same as GPIO8)
GpioCtrlRegs.GPAMUX1.bit.GPIO8= 0; // GPIO GpioCtrlRegs.GPADIR.bit.GPIO8 = 0; // input GpioCtrlRegs.GPAQSEL1.bit.GPIO8 = 0; // XINT1 Synch to SYSCLKOUT only GpioIntRegs.GPIOXINT1SEL.bit.GPIOSEL = 8; // XINT1 is GPIO8 // Configure XINT1 XIntruptRegs.XINT1CR.bit.POLARITY = 0; // Falling edge interrupt // Enable XINT1 XIntruptRegs.XINT1CR.bit.ENABLE = 1; // Enable XINT1
For GPIO10:
GpioCtrlRegs.GPAMUX1.bit.GPIO10 = 0; // GPIO10 = GPIO10 GpioCtrlRegs.GPAQSEL1.bit.GPIO10 = 3; // asynch input GpioIntRegs.GPIOLPMSEL.bit.GPIO10=1; // GPIO10 will wake the device
Here is the code for interrupts to read GPIO Port A:
interrupt void xint1_isr(void) { readData = (GpioDataRegs.GPADAT.all & 0x000000FF); // Acknowledge this interrupt to get more from group 1 PieCtrlRegs.PIEACK.all = PIEACK_GROUP1; }
But I don't know how to write the code to connect trigger GPIO 10 to these two interrupts, please help.
Thanks!
(I am using F28055, with example code of ExternalInterrupts.c in ControlSuite)