void EMIO_Button_InterruptHandler(void *CallBackRef, int Bank, u32 Status) { print("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r\n"); print(" Inside EMIO GPIO ISR \n \r "); XGpioPs_WritePin(&psGpioInstancePtr,55,1); print("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r\n"); XTmrCtr_Start(&TimerInstancePtr,0); XGpioPs_IntrClear(&psGpioInstancePtr, XGPIOPS_BANK2, 0x1); }
/* * XGpioPS Interrupt Handler * Compared to the original Interrupt Handler, this one only handles an interrupt if it has been enabled. * (Source: https://forums.xilinx.com/t5/Zynq-All-Programmable-SoC/GPIOPS-interrupt-problem/td-p/441640) * In: Instance Pointer */ void myXGpioPs_IntrHandler(XGpioPs *InstancePtr) { u8 Bank; u32 IntrStatus; u32 IntrEnabled; Xil_AssertVoid(InstancePtr != NULL); Xil_AssertVoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY); for (Bank = 0U; Bank < InstancePtr->MaxBanks; Bank++) { IntrStatus = XGpioPs_IntrGetStatus(InstancePtr, Bank); IntrEnabled = XGpioPs_IntrGetEnabled(InstancePtr, Bank); if ((IntrStatus & IntrEnabled) != (u32) 0) { XGpioPs_IntrClear((XGpioPs *) InstancePtr, Bank, (IntrStatus & IntrEnabled)); InstancePtr->Handler(InstancePtr->CallBackRef, Bank, (IntrStatus & IntrEnabled)); } } }
/** * * This function is the interrupt handler for GPIO interrupts.It checks the * interrupt status registers of all the banks to determine the actual bank in * which an interrupt has been triggered. It then calls the upper layer callback * handler set by the function XGpioPs_SetBankHandler(). The callback is called * when an interrupt * * @param InstancePtr is a pointer to the XGpioPs instance. * * @return None. * * @note This function does not save and restore the processor context * such that the user must provide this processing. * ******************************************************************************/ void XGpioPs_IntrHandler(XGpioPs *InstancePtr) { u8 Bank; u32 IntrStatus; u32 IntrEnabled; Xil_AssertVoid(InstancePtr != NULL); Xil_AssertVoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY); for (Bank = 0; Bank < XGPIOPS_MAX_BANKS; Bank++) { IntrStatus = XGpioPs_IntrGetStatus(InstancePtr, Bank); if (IntrStatus != 0) { IntrEnabled = XGpioPs_IntrGetEnabled(InstancePtr, Bank); XGpioPs_IntrClear(InstancePtr, Bank, IntrStatus & IntrEnabled); InstancePtr->Handler((void *)InstancePtr-> CallBackRef, Bank, (IntrStatus & IntrEnabled)); } } }