XilinxProcessorIPLib/drivers/iic/examples/xiic_tempsensor_example.c
static int SetupInterruptSystem(XIic *IicPtr)
{
	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, INTC_IIC_INTERRUPT_ID,
					XIic_InterruptHandler, IicPtr);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}

	/*
	 * Start the interrupt controller such that interrupts are recognized
	 * and handled by the processor.
	 */
	Status = XIntc_Start(&InterruptController, XIN_REAL_MODE);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}

	/*
	 * Enable the interrupts for the IIC device.
	 */
	XIntc_Enable(&InterruptController, INTC_IIC_INTERRUPT_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 IIC. This function is application specific since the actual system may
* or may not have an interrupt controller. The IIC device could be directly
* connected to a processor without an interrupt controller. The user should
* modify this function to fit the application.
*
* @param	IicPtr contains a pointer to the instance of the IIC component
*		which is going to be connected to the interrupt controller.
*
* @return	XST_SUCCESS if successful, otherwise XST_FAILURE.
*
* @notes	None.
*
****************************************************************************/
This function setups the interrupt system such that interrupts can occur
for IIC. This function is application specific since the actual system may
or may not have an interrupt controller. The IIC 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 IIC . This function is application specific since the actual system may or may not have an interrupt controller . The IIC 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(XIic *IicPtr)
{
	int Status;
	Status = XIntc_Initialize(&InterruptController, INTC_DEVICE_ID);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}
	Status = XIntc_Connect(&InterruptController, INTC_IIC_INTERRUPT_ID,
					XIic_InterruptHandler, IicPtr);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}
	Status = XIntc_Start(&InterruptController, XIN_REAL_MODE);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}
	XIntc_Enable(&InterruptController, INTC_IIC_INTERRUPT_ID);
	Xil_ExceptionInit();
	Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_INT,
				 (Xil_ExceptionHandler) XIntc_InterruptHandler,
				 &InterruptController);
	Xil_ExceptionEnable();
	return XST_SUCCESS;
}
static int SetupInterruptSystem ( XIic * IicPtr ) { int Status ; Status = XIntc_Initialize ( & InterruptController , INTC_DEVICE_ID ) ; if ( Status != XST_SUCCESS ) { return XST_FAILURE ; } Status = XIntc_Connect ( & InterruptController , INTC_IIC_INTERRUPT_ID , XIic_InterruptHandler , IicPtr ) ; if ( Status != XST_SUCCESS ) { return XST_FAILURE ; } Status = XIntc_Start ( & InterruptController , XIN_REAL_MODE ) ; if ( Status != XST_SUCCESS ) { return XST_FAILURE ; } XIntc_Enable ( & InterruptController , INTC_IIC_INTERRUPT_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 IIC.
This function setups the interrupt system such that interrupts can occur for IIC .
/*
	 * 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 recognized
	 * and handled by the processor.
	 */ /*
	 * Enable the interrupts for the IIC device.
	 */ /*
	 * Initialize the exception table.
	 */ /*
	 * Register the interrupt controller handler with the exception table.
	 */ /*
	 * Enable non-critical exceptions.
	 */