iicps
Vitis Drivers API Documentation
|
Design example is to demonstrate multi-master support in polled mode.
In case arbitration lost there will be retry..
The XIicPs_MasterSendPolled() API is used to transmit the data and the XIicPs_MasterRecvPolled() API is used to receive the data. This example tested on ZCU102 board and slave address needs to be changed based on board design
This example can run on zynqmp / versal IIC device as master in polled mode and Aardvark test hardware used as slave.
It 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 sg 03/09/19 First release 3.18 gm 07/14/23 Added SDT support.
Functions | |
s32 | IicPsMultiMasterPolledExample (u16 DeviceId) |
The purpose of this function is to illustrate multi-master arbitration lost support in XIicPs driver. More... | |
s32 | 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... | |
s32 IicPsMultiMasterPolledExample | ( | u16 | DeviceId | ) |
The purpose of this function is to illustrate multi-master arbitration lost support in XIicPs driver.
This function sends data and expects to receive data from slave device
This function uses polled transfer functions to send and receive from device. In case arbitration lost status will re-initiate the transfer
DeviceId | is the Device ID of the IicPs Device and is the XPAR_<IICPS_instance>_DEVICE_ID value from xparameters.h |
References XIicPs_Config::BaseAddress, XIicPs_BusIsBusy(), XIicPs_CfgInitialize(), XIicPs_LookupConfig(), XIicPs_MasterRecvPolled(), XIicPs_MasterSendPolled(), XIicPs_SelfTest(), and XIicPs_SetSClk().
Referenced by main().
s32 main | ( | void | ) |
Main function to call the polled master example.
References IicPsMultiMasterPolledExample().
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.