XilinxProcessorIPLib/drivers/hwicap/examples/xhwicap_intr_example.c
static int HwIcapSetupInterruptSystem(XIntc* IntcInstancePtr,
				      XHwIcap *HwIcapPtr,
				      u16 IntrId )
{
	int Status;

	/*
	 * Initialize the interrupt controller driver so that it's ready to use.
	 */
	Status = XIntc_Initialize(IntcInstancePtr, INTC_DEVICE_ID);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}

	/*
	 * Connect the handler that will be called when an interrupt
	 * for the device occurs, the handler defined above performs the
	 * specific interrupt processing for the device.
	 */
	Status = XIntc_Connect(IntcInstancePtr,
		 		IntrId,
				(XInterruptHandler) XHwIcap_IntrHandler,
				HwIcapPtr);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}

	/*
	 * Start the interrupt controller so interrupts are enabled for all
	 * devices that cause interrupts. Specify real mode so that the
	 * HwIcap device can cause interrupts through the interrupt
	 * controller.
	 */
	Status = XIntc_Start(IntcInstancePtr, XIN_REAL_MODE);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}

	/*
	 * Enable the interrupt for the HwIcap device.
	 */
	XIntc_Enable(IntcInstancePtr, IntrId);

	/*
	 * Initialize the exception table.
	 */
	Xil_ExceptionInit();

	/*
	 * Register the interrupt controller handler with the exception table.
	 */
	Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_INT,
				(Xil_ExceptionHandler) XIntc_InterruptHandler,
				IntcInstancePtr);
	/*
	 * Enable non-critical exceptions.
	 */
	Xil_ExceptionEnable();

	return XST_SUCCESS;
}
/****************************************************************************/
/**
*
* This function sets up the interrupt system so interrupts can occur for the
* HwIcap device.  The function is application-specific since the actual
* system may or may not have an interrupt controller. The HwIcap device
* could be directly connected to a processor without an interrupt controller.
* The user should modify this function to fit the application.
*
* @param	IntcInstancePtr is a pointer to the Interrupt Controller
*		driver Instance
* @param	HwIcapPtr is a pointer to the driver instance for the System
* 		Monitor device which is going to be connected to the interrupt
*		controller
* @param	DeviceId is the XPAR_<HWICAP_INSTANCE>_DEVICE_ID value from
*		xparameters.h
*
* @return	XST_SUCCESS if successful, or XST_FAILURE.
*
* @note		None.
*
*
****************************************************************************/
This function sets up the interrupt system so interrupts can occur for the
HwIcap device.  The function is application-specific since the actual
system may or may not have an interrupt controller. The HwIcap device
could be directly connected to a processor without an interrupt controller.
The user should modify this function to fit the application.
This function sets up the interrupt system so interrupts can occur for the HwIcap device . The function is application - specific since the actual system may or may not have an interrupt controller . The HwIcap device could be directly connected to a processor without an interrupt controller . The user should modify this function to fit the application .
static int HwIcapSetupInterruptSystem(XIntc* IntcInstancePtr,
				      XHwIcap *HwIcapPtr,
				      u16 IntrId )
{
	int Status;
	Status = XIntc_Initialize(IntcInstancePtr, INTC_DEVICE_ID);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}
	Status = XIntc_Connect(IntcInstancePtr,
		 		IntrId,
				(XInterruptHandler) XHwIcap_IntrHandler,
				HwIcapPtr);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}
	Status = XIntc_Start(IntcInstancePtr, XIN_REAL_MODE);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}
	XIntc_Enable(IntcInstancePtr, IntrId);
	Xil_ExceptionInit();
	Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_INT,
				(Xil_ExceptionHandler) XIntc_InterruptHandler,
				IntcInstancePtr);
	Xil_ExceptionEnable();
	return XST_SUCCESS;
}
static int HwIcapSetupInterruptSystem ( XIntc * IntcInstancePtr , XHwIcap * HwIcapPtr , u16 IntrId ) { int Status ; Status = XIntc_Initialize ( IntcInstancePtr , INTC_DEVICE_ID ) ; if ( Status != XST_SUCCESS ) { return XST_FAILURE ; } Status = XIntc_Connect ( IntcInstancePtr , IntrId , ( XInterruptHandler ) XHwIcap_IntrHandler , HwIcapPtr ) ; if ( Status != XST_SUCCESS ) { return XST_FAILURE ; } Status = XIntc_Start ( IntcInstancePtr , XIN_REAL_MODE ) ; if ( Status != XST_SUCCESS ) { return XST_FAILURE ; } XIntc_Enable ( IntcInstancePtr , IntrId ) ; Xil_ExceptionInit ( ) ; Xil_ExceptionRegisterHandler ( XIL_EXCEPTION_ID_INT , ( Xil_ExceptionHandler ) XIntc_InterruptHandler , IntcInstancePtr ) ; Xil_ExceptionEnable ( ) ; return XST_SUCCESS ; }
This function sets up the interrupt system so interrupts can occur for the
HwIcap device.
This function sets up the interrupt system so interrupts can occur for the HwIcap device .
/*
	 * Initialize the interrupt controller driver so that it's ready to use.
	 */ /*
	 * Connect the handler that will be called when an interrupt
	 * for the device occurs, the handler defined above performs the
	 * specific interrupt processing for the device.
	 */ /*
	 * Start the interrupt controller so interrupts are enabled for all
	 * devices that cause interrupts. Specify real mode so that the
	 * HwIcap device can cause interrupts through the interrupt
	 * controller.
	 */ /*
	 * Enable the interrupt for the HwIcap device.
	 */ /*
	 * Initialize the exception table.
	 */ /*
	 * Register the interrupt controller handler with the exception table.
	 */ /*
	 * Enable non-critical exceptions.
	 */