XilinxProcessorIPLib/drivers/qspipsu/examples/xqspipsu_generic_nand_flash_interrupt_example.c
static int QspiPsuSetupIntrSystem(XScuGic *IntcInstancePtr,
                               XQspiPsu *QspiPsuInstancePtr, u16 QspiPsuIntrId)
{
        int Status;

        XScuGic_Config *IntcConfig; /* Instance of the interrupt controller */

        Xil_ExceptionInit();

        /*
         * Initialize the interrupt controller driver so that it is ready to
         * use.
         */
        IntcConfig = XScuGic_LookupConfig(INTC_DEVICE_ID);
        if (IntcConfig == NULL) {
                return XST_FAILURE;
        }

        Status = XScuGic_CfgInitialize(IntcInstancePtr, IntcConfig,
                        IntcConfig->CpuBaseAddress);
        if (Status != XST_SUCCESS) {
                return XST_FAILURE;
        }

        /*
         * Connect the interrupt controller interrupt handler to the hardware
         * interrupt handling logic in the processor.
         */
        Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_INT,
                        (Xil_ExceptionHandler)XScuGic_InterruptHandler,
                        IntcInstancePtr);

        /*
         * Connect the device driver 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 = XScuGic_Connect(IntcInstancePtr, QspiPsuIntrId,
                        (Xil_ExceptionHandler)XQspiPsu_InterruptHandler,
                        (void *)QspiPsuInstancePtr);
	if (Status != XST_SUCCESS) {
		return Status;
	}
	/*
	 * Enable the interrupt for the QspiPsu device.
	 */
	XScuGic_Enable(IntcInstancePtr, QspiPsuIntrId);

	/*
	 * Enable interrupts in the Processor.
	 */
	Xil_ExceptionEnable();

	return XST_SUCCESS;
}
/*****************************************************************************/
/**
 *
 * This function setups the interrupt system for a QspiPsu device.
 *
 * @param       IntcInstancePtr is a pointer to the instance of the Intc
 *              device.
 * @param       QspiPsuInstancePtr is a pointer to the instance of the
 *              QspiPsu device.
 * @param       QspiPsuIntrId is the interrupt Id for an QSPIPSU device.
 *
 * @return      XST_SUCCESS if successful, otherwise XST_FAILURE.
 *
 * @note        None.
 *
 ******************************************************************************/
This function setups the interrupt system for a QspiPsu device.
@param       IntcInstancePtr is a pointer to the instance of the Intc
device.
@param       QspiPsuInstancePtr is a pointer to the instance of the
QspiPsu device.
@param       QspiPsuIntrId is the interrupt Id for an QSPIPSU device.



@note        None.
This function setups the interrupt system for a QspiPsu device . @param IntcInstancePtr is a pointer to the instance of the Intc device . @param QspiPsuInstancePtr is a pointer to the instance of the QspiPsu device . @param QspiPsuIntrId is the interrupt Id for an QSPIPSU device . @note None .
static int QspiPsuSetupIntrSystem(XScuGic *IntcInstancePtr,
                               XQspiPsu *QspiPsuInstancePtr, u16 QspiPsuIntrId)
{
        int Status;
        XScuGic_Config *IntcConfig; 
        Xil_ExceptionInit();
        IntcConfig = XScuGic_LookupConfig(INTC_DEVICE_ID);
        if (IntcConfig == NULL) {
                return XST_FAILURE;
        }
        Status = XScuGic_CfgInitialize(IntcInstancePtr, IntcConfig,
                        IntcConfig->CpuBaseAddress);
        if (Status != XST_SUCCESS) {
                return XST_FAILURE;
        }
        Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_INT,
                        (Xil_ExceptionHandler)XScuGic_InterruptHandler,
                        IntcInstancePtr);
        Status = XScuGic_Connect(IntcInstancePtr, QspiPsuIntrId,
                        (Xil_ExceptionHandler)XQspiPsu_InterruptHandler,
                        (void *)QspiPsuInstancePtr);
	if (Status != XST_SUCCESS) {
		return Status;
	}
	XScuGic_Enable(IntcInstancePtr, QspiPsuIntrId);
	Xil_ExceptionEnable();
	return XST_SUCCESS;
}
static int QspiPsuSetupIntrSystem ( XScuGic * IntcInstancePtr , XQspiPsu * QspiPsuInstancePtr , u16 QspiPsuIntrId ) { int Status ; XScuGic_Config * IntcConfig ; Xil_ExceptionInit ( ) ; IntcConfig = XScuGic_LookupConfig ( INTC_DEVICE_ID ) ; if ( IntcConfig == NULL ) { return XST_FAILURE ; } Status = XScuGic_CfgInitialize ( IntcInstancePtr , IntcConfig , IntcConfig -> CpuBaseAddress ) ; if ( Status != XST_SUCCESS ) { return XST_FAILURE ; } Xil_ExceptionRegisterHandler ( XIL_EXCEPTION_ID_INT , ( Xil_ExceptionHandler ) XScuGic_InterruptHandler , IntcInstancePtr ) ; Status = XScuGic_Connect ( IntcInstancePtr , QspiPsuIntrId , ( Xil_ExceptionHandler ) XQspiPsu_InterruptHandler , ( void * ) QspiPsuInstancePtr ) ; if ( Status != XST_SUCCESS ) { return Status ; } XScuGic_Enable ( IntcInstancePtr , QspiPsuIntrId ) ; Xil_ExceptionEnable ( ) ; return XST_SUCCESS ; }
This function setups the interrupt system for a QspiPsu device.
This function setups the interrupt system for a QspiPsu device .
/* Instance of the interrupt controller */ /*
         * Initialize the interrupt controller driver so that it is ready to
         * use.
         */ /*
         * Connect the interrupt controller interrupt handler to the hardware
         * interrupt handling logic in the processor.
         */ /*
         * Connect the device driver handler that will be called when an
         * interrupt for the device occurs, the handler defined above performs
         * the specific interrupt processing for the device.
         */ /*
	 * Enable the interrupt for the QspiPsu device.
	 */ /*
	 * Enable interrupts in the Processor.
	 */