iicps
Xilinx SDK Drivers API Documentation
xiicps_intr_master_example.c File Reference

Overview

Design example to use the IIC device as master in interrupt-driven mode.

It continuously sends 18 buffers to slave.

 MODIFICATION HISTORY:
Ver   Who Date     Changes


1.00a jz 01/30/10 First release

 

Functions

int IicPsMasterIntrExample (u16 DeviceId)
 This function does a minimal test on the Iic device and driver as a design example. More...
 
void Handler (void *CallBackRef, u32 Event)
 This function is the handler which performs processing to handle data events from the IIC. More...
 
int main (void)
 Main function to call the example. More...
 

Function Documentation

void Handler ( void *  CallBackRef,
u32  Event 
)

This function is the handler which performs processing to handle data events from the IIC.

It is called from an interrupt context such that the amount of processing performed should be minimized.

This handler provides an example of how to handle data for the IIC and is application specific.

Parameters
CallBackRefcontains a callback reference from the driver, in this case it is the instance pointer for the IIC driver.
Eventcontains the specific kind of event that has occurred.
Returns
None.
Note
None.

It is called from an interrupt context such that the amount of processing performed should be minimized.

This handler provides an example of how to handle data for the IIC and is application specific.

Parameters
CallBackRefcontains a callback reference from the driver, in this case it is the instance pointer for the IIC driver.
Eventcontains the specific kind of event that has occurred.
EventDatacontains the number of bytes sent or received for sent and receive events.
Returns
None.
Note
None.

References Handler(), TotalErrorCount, XIICPS_EVENT_COMPLETE_RECV, XIICPS_EVENT_COMPLETE_SEND, and XIICPS_EVENT_SLAVE_RDY.

Referenced by Handler(), IicPsMasterIntrExample(), and IicPsSlaveIntrExample().

int IicPsMasterIntrExample ( u16  DeviceId)

This function does a minimal test on the Iic device and driver as a design example.

The purpose of this function is to illustrate how to use the XIicPs driver.

This function sends data and expects to receive the same data through the IIC using the Aardvark test hardware.

This function uses interrupt driver mode of the IIC.

Parameters
DeviceIdis the Device ID of the IicPs Device and is the XPAR_<IICPS_instance>_DEVICE_ID value from xparameters.h
Returns
XST_SUCCESS if successful, otherwise XST_FAILURE.
Note

This function contains an infinite loop such that if interrupts are not working it may never return.

References XIicPs_Config::BaseAddress, Handler(), RecvBuffer, SendBuffer, TotalErrorCount, XIicPs_BusIsBusy(), XIicPs_CfgInitialize(), XIicPs_LookupConfig(), XIicPs_MasterRecv(), XIicPs_MasterSend(), XIicPs_SelfTest(), XIicPs_SetSClk(), and XIicPs_SetStatusHandler().

Referenced by main().

int main ( void  )

Main function to call the example.

Parameters
None.
Returns
XST_SUCCESS if successful, XST_FAILURE if unsuccessful.
Note
None.

References IicPsMasterIntrExample().