iicps
Vitis Drivers API Documentation
xiicps_smbus_intr_slave_example.c File Reference

Overview

This example can run on zynqmp / versal platform evaluation board and IIC controller configured slave in interrupt-driven mode and loopback setup used for master.

It sends and receives the data using IIC device as slave for SMBus transfers.

Note
None.
 MODIFICATION HISTORY:
Ver   Who Date     Changes


1.00 gm 05/10/22 First release 3.18 gm 07/14/23 Added SDT support.

 

Functions

int IicPsSmbusSlaveIntrExample (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 interrupt example in the slave mode. 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.
int IicPsSmbusSlaveIntrExample ( 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 component.

This function sends and receives data as a smbus slave in 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(), XIicPs_CfgInitialize(), XIicPs_LookupConfig(), XIicPs_MasterInterruptHandler(), XIicPs_SelfTest(), XIicPs_SetSClk(), XIicPs_SetStatusHandler(), and XIicPs_SetupSlave().

Referenced by main().

int main ( void  )

Main function to call the interrupt example in the slave mode.

Returns
  • XST_SUCCESS if successful.
  • XST_FAILURE if unsuccessful.
Note
None

References IicPsSmbusSlaveIntrExample().