iicps
Vitis Drivers API Documentation
|
This file consists of a polled mode design example which uses the Xilinx PS IIC device and XIicPs driver to exercise the EEPROM.
This example runs on zynqmp evaluation board (zcu102).
The XIicPs_MasterSendPolled() API is used to transmit the data and XIicPs_MasterRecvPolled() API is used to receive the data.
The example is tested with a 2Kb/8Kb serial IIC EEPROM (ST M24C02/M24C08). The WP pin of this EEPROM is hardwired to ground in the HW in which this was tested.
The AddressType should be u8 as the address pointer in the on-board EEPROM is 1 bytes.
This code assumes that no Operating System is being used.
None.
MODIFICATION HISTORY:
Ver Who Date Changes
1.00a sdm 03/15/10 First release 1.01a sg 04/13/12 Added MuxInit function for initializing the IIC Mux on the ZC702 board and to configure it for accessing the IIC EEPROM. Updated to use usleep instead of delay loop 1.04a hk 09/03/13 Removed GPIO code to pull MUX out of reset - CR#722425. 2.3 sk 10/07/14 Removed multiple initializations for read buffer. 3.3 Nava 08/08/16 Adopt the Dynamic EEPROM finding support. 3.11 rna 10/16/19 Added support for 64 page size eeproms on Versal based boards, scanning for eeprom until found on all I2C instances rna 03/26/20 Eeprom page size detection support is added. 3.18 gm 07/14/23 Added SDT support.
Macros | |
#define | SLV_MON_LOOP_COUNT 0x00FFFFFF |
Slave Monitor Loop Count. More... | |
Functions | |
s32 | IicPsEepromPolledExample (void) |
This function writes, reads, and verifies the data to the IIC EEPROM. More... | |
int | main (void) |
Main function to call the Iic EEPROM polled example. More... | |
Variables | |
u16 | EepromAddr [] = {0x54, 0x55, 0} |
Searching for the required EEPROM Address and user can also add their own EEPROM Address in the below array list. More... | |
#define SLV_MON_LOOP_COUNT 0x00FFFFFF |
Slave Monitor Loop Count.
s32 IicPsEepromPolledExample | ( | void | ) |
This function writes, reads, and verifies the data to the IIC EEPROM.
It does the write as a single page write, performs a buffered read.
References EepromWriteData().
Referenced by main().
int main | ( | void | ) |
Main function to call the Iic EEPROM polled example.
References IicPsEepromPolledExample().
u16 EepromAddr[] = {0x54, 0x55, 0} |
Searching for the required EEPROM Address and user can also add their own EEPROM Address in the below array list.