EVMDM642 I2C EEPROM Module
This module reads and writes to the Catalyst CAT24WC256 EEPROM on the EVMDM642. The I2C bus is used for communication with the EEPROM. Since the EEPROM is accessed through an independent serial interface, it is not mapped into the EMIF’s address space. Therefore, addresses are logical offsets from the beginning of the device.
| Name |
Typical Value |
Description |
| EVMDM642_EEPROM_BASE |
0x000000 |
Address of start of EEPROM |
| EVMDM642_EEPROM_SIZE |
0x8000 |
Total size of EEPROM |
EVMDM642_EEPROM_read()
Description
Read data from a range in EEPROM
Required Headers
evmdm642.h
evmdm642_eeprom.h
Required Libraries
evmdm642bsl.lib
Function Prototype
void EVMDM642_EEPROM_read(Uint32 src, Uint32 dst, Uint32 length)
Parameters
src – Address in EEPROM to read from. Given as an integral number of 8-bit bytes.
dst – Address in memory to read to.
length – Length of transfer, in 8-bit bytes.
Return Value
None
Example
Uint8 buf[256];
/* Copy 256 8-bit bytes
* from the beginning of the EEPROM to buf */
EVMDM642_EEPROM_read(0, (Uint32)buf, 256);
EVMDM642_EEPROM_write()
Description
Write data to a data range in EEPROM
Required Headers
evmdm642.h
evmdm642_eeprom.h
Required Libraries
evmdm642bsl.lib
Function Prototype
void EVMDM642_EEPROM_write(Uint32 src, Uint32 dst, Uint32 length)
Parameters
src – Address of memory to read from.
dst – Address to EEPROM to write to.
length - Length of transfer in bytes, maximum 64 bytes
Return Value
None
Example
Uint8 buf[256];
/* Copy 256 8-bit bytes
* from buf to the beginning of EEPROM */
EVMDM642_EEPROM_write((Uint32)buf, 0, 256);
|