Xil_ExceptionEnable()启用IRQ异常,没有参数和返回值。异常处理机制并不是中断独有的,在xil_exception.h文件中有所有异常情况的ID列表。下面贴出init.c中的代码,更进一步理解: Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_INT, (Xil_ExceptionHandler)XScuGic_InterruptHandler, &INTCInst); XIL_EXCEPTION_ID_INT...
Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_IRQ_INT,(Xil_ExceptionHandler)XScuGic_InterruptHandler,&Gic);Status=XScuGic_Connect(&Gic,GPIOINTR_ID,(Xil_InterruptHandler)XGpioPs_IntrHandler,(void*)&Gpio);XGpioPs_SetCallbackHandler(&Gpio,(void*)&Gpio,(XGpioPs_Handler)UserDefKeyInterupt); 为什么要...
#define XIL_EXCEPTION_ID_DATA_ABORT_INT 4U #define XIL_EXCEPTION_ID_IRQ_INT 5U #define XIL_EXCEPTION_ID_FIQ_INT 6U #define XIL_EXCEPTION_ID_LAST 6U /* * XIL_EXCEPTION_ID_INT is defined for all Xilinx processors. */ #define XIL_EXCEPTION_ID_INT XIL_EXCEPTION_ID_IRQ_INT Xil_Exception...
Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_IRQ_INT, (Xil_ExceptionHandler)XScuGic_InterruptHandler, GicPtr); Xil_ExceptionEnable(); } sys_intr.c #ifndef SRC_SYS_INTR_H_ #define SRC_SYS_INTR_H_ #define INTC_DEVICE_ID XPAR_SCUGIC_SINGLE_DEVICE_ID int sys_IntrInit(XScuGic *GicPtr); vo...
Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_IRQ_INT, (Xil_ExceptionHandler)XScuGic_DeviceInterruptHandler, (void *)INTC_DEVICE_ID); //1、PPI 私有定时器中断设置 方法1 XScuGic_RegisterHandler(INTC_BASE_ADDR, TIMER_IRPT_INTR, (Xil_ExceptionHandler)timer_callback, ...
Xil_ExceptionEnable(); 连接中断源到GIC: intXScuGic_Connect(XScuGic *InstancePtr, u8 IntrId, Xil_ExceptionHandler Handler,void*CallBackRef); InstancePtr:指向GIC实例的指针。 IntrId:中断ID。 Handler:中断处理函数。 CallBackRef:回调函数的引用参数。
XGpioPs_IntrEnable(&Gpio, XGPIOPS_BANK2, (1 << (PL_KEY - 54)));//(实例指针,BANK号,32位_位1为使能_位0为禁止) //在GIC中允许该外设的中断源向Cpu发出中断 XScuGic_Enable(&GicInstancePtr, XPS_GPIO_INT_ID); //开启总中断 Xil_ExceptionEnableMask(XIL_EXCEPTION_IRQ);3...
IntcConfig = XScuGic_LookupConfig(DeviceId); status = XScuGic_CfgInitialize(&INTCInst, IntcConfig, IntcConfig->CpuBaseAddress); if(status != XST_SUCCESS) return XST_FAILURE; // Call interrupt setup function Xil_ExceptionInit(); Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_INT, ...
Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_INT,(Xil_ExceptionHandler)XScuGic_InterruptHandler, &GicInst); /*** * connect interrput to scugic controller ***/ Status = XScuGic_Connect(&GicInst, UART_INTR_ID, (Xil_ExceptionHandler) XUartPs_InterruptHandler, &Uart...
BNT1_INT_ID, (Xil_ExceptionHandler)BNT_intr_Handler, (void *)1); if(status != XST_SUCCESS) return XST_FAILURE; status = XScuGic_Connect(&INTCInst, BNT2_INT_ID, (Xil_ExceptionHandler)BNT_intr_Handler, (void *)2); if(status != XST_SUCCESS) return XST_FAILURE; ...