Eeprom
[Drivers]

Collaboration diagram for Eeprom:

Defines

#define EEPROM_DVK_ADDR   0xA0
 I2C device address for EEPROM on DK.

Functions

int EEPROM_Read (I2C_TypeDef *i2c, uint8_t addr, unsigned int offset, uint8_t *data, unsigned int len)
 Read data from EEPROM.
int EEPROM_Write (I2C_TypeDef *i2c, uint8_t addr, unsigned int offset, uint8_t *data, unsigned int len)
 Write data to EEPROM.

Define Documentation

#define EEPROM_DVK_ADDR   0xA0

I2C device address for EEPROM on DK.

Definition at line 60 of file eeprom.h.


Function Documentation

int EEPROM_Read ( I2C_TypeDef *  i2c,
uint8_t  addr,
unsigned int  offset,
uint8_t *  data,
unsigned int  len 
)

Read data from EEPROM.

Parameters:
[in] i2c Pointer to I2C peripheral register block.
[in] addr I2C address for EEPROM, in 8 bit format, where LSB is reserved for R/W bit.
[in] offset Offset in EEPROM to start reading from.
[out] data Location to place read data, must be at least len long.
[in] len Number of bytes to read.
Returns:
Returns number of bytes read. Less than specified number of bytes is returned if reading beyond end of EEPROM. Negative value is returned is some sort of error occurred during read.

Definition at line 149 of file eeprom.c.

References EEPROM_DVK_LEN, and I2CDRV_Transfer().

Here is the call graph for this function:

int EEPROM_Write ( I2C_TypeDef *  i2c,
uint8_t  addr,
unsigned int  offset,
uint8_t *  data,
unsigned int  len 
)

Write data to EEPROM.

Parameters:
[in] i2c Pointer to I2C peripheral register block.
[in] addr I2C address for EEPROM, in 8 bit format, where LSB is reserved for R/W bit.
[in] offset Offset in EEPROM to start writing to.
[out] data Location holding data to write, must be at least len long.
[in] len Number of bytes to write.
Returns:
Returns number of bytes written. Less than specified number of bytes is returned if writing beyond end of EEPROM. Negative value is returned is some sort of error occurred during write.

Definition at line 217 of file eeprom.c.

References EEPROM_AckPoll(), EEPROM_DVK_LEN, EEPROM_DVK_PAGESIZE, and I2CDRV_Transfer().

Here is the call graph for this function: