XilinxProcessorIPLib/drivers/iicps/examples/xiicps_eeprom_intr_example.c
static int IicPsConfig(u16 DeviceId, u32 Int_Id)
{
	int Status;
	XIicPs_Config *ConfigPtr;	/* Pointer to configuration data */

	/*
	 * Initialize the IIC driver so that it is ready to use.
	 */
	ConfigPtr = XIicPs_LookupConfig(DeviceId);
	if (ConfigPtr == NULL) {
		return XST_FAILURE;
	}

	Status = XIicPs_CfgInitialize(&IicInstance, ConfigPtr,
					ConfigPtr->BaseAddress);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}

	/*
	 * Setup the Interrupt System.
	 */
	Status = SetupInterruptSystem(&IicInstance, Int_Id);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}

	/*
	 * Setup the handlers for the IIC that will be called from the
	 * interrupt context when data has been sent and received, specify a
	 * pointer to the IIC driver instance as the callback reference so
	 * the handlers are able to access the instance data.
	 */
	XIicPs_SetStatusHandler(&IicInstance, (void *) &IicInstance, Handler);

	/*
	 * Set the IIC serial clock rate.
	 */
	XIicPs_SetSClk(&IicInstance, IIC_SCLK_RATE);
	return XST_SUCCESS;
}
/*****************************************************************************/
/**
* This function perform the initial configuration for the IICPS Device.
*
* @param	DeviceId instance and Interrupt ID mapped to the device.
*
* @return	XST_SUCCESS if pass, otherwise XST_FAILURE.
*
* @note		None.
*
****************************************************************************/
This function perform the initial configuration for the IICPS Device.
This function perform the initial configuration for the IICPS Device .
static int IicPsConfig(u16 DeviceId, u32 Int_Id)
{
	int Status;
	XIicPs_Config *ConfigPtr;	
	ConfigPtr = XIicPs_LookupConfig(DeviceId);
	if (ConfigPtr == NULL) {
		return XST_FAILURE;
	}
	Status = XIicPs_CfgInitialize(&IicInstance, ConfigPtr,
					ConfigPtr->BaseAddress);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}
	Status = SetupInterruptSystem(&IicInstance, Int_Id);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}
	XIicPs_SetStatusHandler(&IicInstance, (void *) &IicInstance, Handler);
	XIicPs_SetSClk(&IicInstance, IIC_SCLK_RATE);
	return XST_SUCCESS;
}
static int IicPsConfig ( u16 DeviceId , u32 Int_Id ) { int Status ; XIicPs_Config * ConfigPtr ; ConfigPtr = XIicPs_LookupConfig ( DeviceId ) ; if ( ConfigPtr == NULL ) { return XST_FAILURE ; } Status = XIicPs_CfgInitialize ( & IicInstance , ConfigPtr , ConfigPtr -> BaseAddress ) ; if ( Status != XST_SUCCESS ) { return XST_FAILURE ; } Status = SetupInterruptSystem ( & IicInstance , Int_Id ) ; if ( Status != XST_SUCCESS ) { return XST_FAILURE ; } XIicPs_SetStatusHandler ( & IicInstance , ( void * ) & IicInstance , Handler ) ; XIicPs_SetSClk ( & IicInstance , IIC_SCLK_RATE ) ; return XST_SUCCESS ; }
This function perform the initial configuration for the IICPS Device.
This function perform the initial configuration for the IICPS Device .
/* Pointer to configuration data */ /*
	 * Initialize the IIC driver so that it is ready to use.
	 */ /*
	 * Setup the Interrupt System.
	 */ /*
	 * Setup the handlers for the IIC that will be called from the
	 * interrupt context when data has been sent and received, specify a
	 * pointer to the IIC driver instance as the callback reference so
	 * the handlers are able to access the instance data.
	 */ /*
	 * Set the IIC serial clock rate.
	 */