Example:
int x;
u32 board_sn;
if(x != 0) xil_printf("EEPROM Write Error!\n");
if(x != 182) xil_printf("EEPROM Read Error (read %d, should be 182)!\n", x);
xil_printf("Board s/n: W3-a-%05d\n", board_sn);
void iic_eeprom_init |
( |
u32 |
ba, |
|
|
u8 |
clkDiv |
|
) |
| |
Initializes the EEPROM controller. This function must be called once at boot before any EEPROM read/write operations.
- Parameters
-
ba | Base memory address of w3_iic_eeprom pcore |
clkDiv | Clock divider for IIC clock (set 0x64 for 160MHz bus) |
int iic_eeprom_writeByte |
( |
u32 |
ba, |
|
|
u16 |
addrToWrite, |
|
|
u8 |
byteToWrite |
|
) |
| |
Writes one bytes to the EEPROM.
- Parameters
-
ba | Base memory address of w3_iic_eeprom pcore |
addrToWrite | Byte address to write (in [0,16383]) |
byteToWrite | Byte value to write |
- Returns
- Returns 0 if EEPROM write succeeds. Returns -1 if an error occurs.
int iic_eeprom_readByte |
( |
u32 |
ba, |
|
|
u16 |
addrToRead |
|
) |
| |
Reads one bytes to the EEPROM.
- Parameters
-
ba | Base memory address of w3_iic_eeprom pcore |
addrToRead | Byte address to read (in [0,16383]) |
- Returns
- If EEPROM read succeeds, the read byte is returned in the LSB. If an error occurs, returns -1.
u32 w3_eeprom_readSerialNum |
( |
u32 |
ba | ) |
|
Reads the WARP v3 board serial number (programmed during manufacturing)
- Parameters
-
ba | Base memory address of w3_iic_eeprom pcore |
- Returns
- Numeric part of board serial number (prefix "W3-a-" not stored in EEPROM)
u32 w3_eeprom_read_fpga_dna |
( |
u32 |
ba, |
|
|
int |
lo_hi |
|
) |
| |
Reads part of the 56-bit Virtex-6 FPGA DNA value (copied to EEPROM during manufacturing)
- Parameters
-
ba | Base memory address of w3_iic_eeprom pcore |
lo_hi | Selects between 32 LSB or 24 MSB of DNA value (0=LSB, 1=MSB) |
- Returns
- Returns selected portion of FPGA DNA value