iicps
Vitis Drivers API Documentation
xiicps_eeprom_intr_example.c File Reference

Overview

This file consists of a interrutp 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_MasterSend() API is used to transmit the data and the XIicPs_MasterRecv() 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 on 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.

Note

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.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 08/26/23 Added SDT support.

Macros

#define SLV_MON_LOOP_COUNT   0x000FFFFF
 Slave Monitor Loop Count. More...
 

Functions

int IicPsEepromIntrExample (void)
 This function writes, reads, and verifies the data to the IIC EEPROM. More...
 
int main (void)
 Main function to call the Iic EEPROM interrupt example. More...
 

Variables

volatile u8 TransmitComplete
 Flag to check completion of Transmission. More...
 
volatile u8 ReceiveComplete
 Flag to check completion of Reception. More...
 
volatile u32 TotalErrorCount
 Total Error Count Flag. More...
 
volatile u32 SlaveResponse
 Slave Response Flag. More...
 
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...
 

Macro Definition Documentation

#define SLV_MON_LOOP_COUNT   0x000FFFFF

Slave Monitor Loop Count.

Function Documentation

int IicPsEepromIntrExample ( 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.

Returns
XST_SUCCESS if successful else XST_FAILURE.
Note
None.

References EepromWriteData().

Referenced by main().

int main ( void  )

Main function to call the Iic EEPROM interrupt example.

Returns
XST_SUCCESS if successful else XST_FAILURE.
Note
None.

References IicPsEepromIntrExample().

Variable Documentation

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.

volatile u8 ReceiveComplete

Flag to check completion of Reception.

volatile u32 SlaveResponse

Slave Response Flag.

volatile u8 TransmitComplete

Flag to check completion of Transmission.