iicps
Vitis Drivers API Documentation
xiicps_polled_master_example.c File Reference

Overview

This example can run on zynqmp / versal platform evaluation board and IIC controller configured master in polled mode and Aardvark Analyzer used as slave.

The example uses buffer size 132. Please set the send buffer of the Aardvark device to be continuous 64 bytes from 0x00 to 0x3F.

 MODIFICATION HISTORY:
 Ver   Who Date     Changes


1.00a jz 01/30/10 First release 3.18 gm 07/14/23 Added SDT support.

 

Functions

int IicPsMasterPolledExample (u16 DeviceId)
 This function sends data and expects to receive data from slave as modular of 64. More...
 
int main (void)
 Main function to call the polled master example. More...
 

Variables

XIicPs Iic
 Instance of the IIC Device. More...
 
u8 SendBuffer [TEST_BUFFER_SIZE]
 Buffer for Transmitting Data. More...
 
u8 RecvBuffer [TEST_BUFFER_SIZE]
 Buffer for Receiving Data. More...
 

Function Documentation

int IicPsMasterPolledExample ( u16  DeviceId)

This function sends data and expects to receive data from slave as modular of 64.

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

This function uses interrupt-driven mode of the device.

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
None.

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

This function sends and receives data as a smbus master in poll 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
None.

References XIicPs_Config::BaseAddress, XIicPs_BusIsBusy(), XIicPs_CfgInitialize(), XIicPs_LookupConfig(), XIicPs_MasterRecvPolled(), XIicPs_MasterSendPolled(), XIicPs_SelfTest(), and XIicPs_SetSClk().

Referenced by main().

int main ( void  )

Main function to call the polled master example.

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

References IicPsMasterPolledExample().

Variable Documentation

XIicPs Iic

Instance of the IIC Device.

u8 RecvBuffer[TEST_BUFFER_SIZE]

Buffer for Receiving Data.

u8 SendBuffer[TEST_BUFFER_SIZE]

Buffer for Transmitting Data.