I have configure the EPI. I just wonder how to set up the P4 P5 interrupt. Is the code below right? Thanks!
Hwi_Struct callbackPortP4Hwi;
const GPIO_Callbacks TM4C129X_gpioPortP4Callbacks = {
GPIO_PORTP_BASE, INT_GPIOP4, &callbackPortP4Hwi,
{NULL, NULL, NULL, NULL, isr_int, NULL, NULL, NULL}
};
Hwi_Struct callbackPortP5Hwi;
const GPIO_Callbacks TM4C129X_gpioPortP5Callbacks = {
GPIO_PORTP_BASE, INT_GPIOP5, &callbackPortP5Hwi,
{NULL, NULL, NULL, NULL, NULL, isr_sync0, NULL, NULL}
};
GPIO_setupCallbacks(&TM4C129X_gpioPortP4Callbacks);
GPIO_enableInt(TM4C129X_ECAT_ISR, GPIO_INT_FALLING);
GPIO_setupCallbacks(&TM4C129X_gpioPortP5Callbacks);
GPIO_enableInt(TM4C129X_ECAT_SYNC0, GPIO_INT_FALLING);
I use another way to set up the P4 P5 interrupt. But it is not success, but the interrupts ditn't happened.
cfg script:
var hwi0Params = new Hwi.Params();
hwi0Params.instance.name = "hwi0";
Program.global.hwi0 = Hwi.create(84, "&isr_int", hwi0Params);
var hwi1Params = new Hwi.Params();
hwi1Params.instance.name = "hwi1";
Program.global.hwi1 = Hwi.create(85, "&isr_sync0", hwi1Params);
c code:
GPIOPinTypeGPIOInput(GPIO_PORTP_BASE, GPIO_PIN_4 | GPIO_PIN_5);
GPIOIntTypeSet(GPIO_PORTP_BASE, GPIO_PIN_4 | GPIO_PIN_5, GPIO_FALLING_EDGE);
GPIOIntEnable(GPIO_PORTP_BASE, GPIO_PIN_4 | GPIO_PIN_5);
IntEnable(INT_GPIOP4);
IntEnable(INT_GPIOP5);
IntMasterEnable();
void isr_int()
{
GPIOIntClear(GPIO_PORTP_BASE,GPIO_INT_PIN_4);
}
void isr_sync0()
{
GPIOIntClear(GPIO_PORTP_BASE,GPIO_INT_PIN_5);
}