iicps: xiicps_eeprom_polled_example.c File Reference

| iicps Xilinx SDK Drivers API Documentation

- Overview
- Data Structures
- APIs
- File List
- Examples

Macros | Functions | Variables
xiicps_eeprom_polled_example.c File Reference

## Overview

This file consists of a polled mode design example which uses the Xilinx PS IIC device and XIicPs driver to exercise the EEPROM.

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.

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.3   Nava 08/08/16 Adopt the Dynamic EEPROM finding support.

## Macros
#define | SLV_MON_LOOP_COUNT 0x00FFFFFF
| Slave Monitor Loop Count. More...

## Functions
s32 | IicPsEepromPolledExample ()
| 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...

## Macro Definition Documentation

#define SLV_MON_LOOP_COUNT 0x00FFFFFF

Slave Monitor Loop Count.

## Function Documentation

s32 IicPsEepromPolledExample | ( |  | ) |

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.

Parameters

  None. |

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 polled example.

Parameters

  None. |

Returns
  XST_SUCCESS if successful else XST_FAILURE.

Note
  None.

References IicPsEepromPolledExample().

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