XilinxProcessorIPLib/drivers/spi/examples/xspi_eeprom_example.c
static int SetupInterruptSystem(XSpi *SpiPtr)
{

	int Status;


	/*
	 * Initialize the interrupt controller driver so that
	 * it's ready to use, specify the device ID that is generated in
	 * xparameters.h
	 */
	Status = XIntc_Initialize(&InterruptController, INTC_DEVICE_ID);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}


	/*
	 * Connect a device driver handler that will be called when an interrupt
	 * for the device occurs, the device driver handler performs the
	 * specific interrupt processing for the device
	 */
	Status = XIntc_Connect(&InterruptController,
			   SPI_INTR_ID,
			   (XInterruptHandler)XSpi_InterruptHandler,
			   (void *)SpiPtr);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}


	/*
	 * Start the interrupt controller such that interrupts are enabled for
	 * all devices that cause interrupts, specific real mode so that
	 * the SPI can cause interrupts through the interrupt controller.
	 */
	Status = XIntc_Start(&InterruptController, XIN_REAL_MODE);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}

	/*
	 * Enable the interrupt for the Spi device
	 */
	XIntc_Enable(&InterruptController, SPI_INTR_ID);


	/*
	 * 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,
			 &InterruptController);

	/*
	 * Enable non-critical exceptions
	 */
	Xil_ExceptionEnable();

	return XST_SUCCESS;
}
/****************************************************************************
*
*
* This function setups the interrupt system such that interrupts can occur
* for the SPI driver.  This function is application specific since the actual
* system may or may not have an interrupt controller. The SPI device could
* be directly connected to a processor without an interrupt controller.  The
* user should modify this function to fit the application.
*
* @param 	SpiPtr contains a pointer to the instance of the XSpi component
* 		which is going to be connected to the interrupt controller.
*
* @return	XST_SUCCESS if successful else XST_FAILURE.
*
* @note		None.
*
****************************************************************************/
This function setups the interrupt system such that interrupts can occur
for the SPI driver.  This function is application specific since the actual
system may or may not have an interrupt controller. The SPI device could
be directly connected to a processor without an interrupt controller.  The
user should modify this function to fit the application.
This function setups the interrupt system such that interrupts can occur for the SPI driver . This function is application specific since the actual system may or may not have an interrupt controller . The SPI device could be directly connected to a processor without an interrupt controller . The user should modify this function to fit the application .
static int SetupInterruptSystem(XSpi *SpiPtr)
{
	int Status;
	Status = XIntc_Initialize(&InterruptController, INTC_DEVICE_ID);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}
	Status = XIntc_Connect(&InterruptController,
			   SPI_INTR_ID,
			   (XInterruptHandler)XSpi_InterruptHandler,
			   (void *)SpiPtr);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}
	Status = XIntc_Start(&InterruptController, XIN_REAL_MODE);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}
	XIntc_Enable(&InterruptController, SPI_INTR_ID);
	Xil_ExceptionInit();
	Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_INT,
			 (Xil_ExceptionHandler)XIntc_InterruptHandler,
			 &InterruptController);
	Xil_ExceptionEnable();
	return XST_SUCCESS;
}
static int SetupInterruptSystem ( XSpi * SpiPtr ) { int Status ; Status = XIntc_Initialize ( & InterruptController , INTC_DEVICE_ID ) ; if ( Status != XST_SUCCESS ) { return XST_FAILURE ; } Status = XIntc_Connect ( & InterruptController , SPI_INTR_ID , ( XInterruptHandler ) XSpi_InterruptHandler , ( void * ) SpiPtr ) ; if ( Status != XST_SUCCESS ) { return XST_FAILURE ; } Status = XIntc_Start ( & InterruptController , XIN_REAL_MODE ) ; if ( Status != XST_SUCCESS ) { return XST_FAILURE ; } XIntc_Enable ( & InterruptController , SPI_INTR_ID ) ; Xil_ExceptionInit ( ) ; Xil_ExceptionRegisterHandler ( XIL_EXCEPTION_ID_INT , ( Xil_ExceptionHandler ) XIntc_InterruptHandler , & InterruptController ) ; Xil_ExceptionEnable ( ) ; return XST_SUCCESS ; }
This function setups the interrupt system such that interrupts can occur
for the SPI driver.
This function setups the interrupt system such that interrupts can occur for the SPI driver .
/*
	 * Initialize the interrupt controller driver so that
	 * it's ready to use, specify the device ID that is generated in
	 * xparameters.h
	 */ /*
	 * Connect a device driver handler that will be called when an interrupt
	 * for the device occurs, the device driver handler performs the
	 * specific interrupt processing for the device
	 */ /*
	 * Start the interrupt controller such that interrupts are enabled for
	 * all devices that cause interrupts, specific real mode so that
	 * the SPI can cause interrupts through the interrupt controller.
	 */ /*
	 * Enable the interrupt for the Spi device
	 */ /*
	 * Initialize the exception table
	 */ /*
	 * Register the interrupt controller handler with the exception table
	 */ /*
	 * Enable non-critical exceptions
	 */