Platform-specific layer provides a consistent Virtual EEPROM API to upper layers of the driver.
EEPROM API Overview
This API contains the functions to initialize and control 24xxx family of EEPROMs (24C08/24C64/24C128) for the Programmable XBee devices. These EEPROMs are user-modifiable read-only memories (ROM) that are connected to the XBee modules trough the I2C interface. They can be erased and reprogrammed (written to) repeatedly.
- 24xxx EEPROM configuration functions:
- Functions to read/write the 24xxx EEPROMs:
- eeprom_read()
- eeprom_write()
Configures the EEPROM.
- Parameters
-
[in] | eeprom | eeprom index to configure (use the name of the component defined by the config.xml) |
[in] | subaddr | EEPROM slave subaddress range from 0 (0x50) to 7 (0x57) depending on hardware configuration. |
[in] | addrbytes | Required address bytes for the eeprom. |
[in] | pagesize | Device page size for writing operations. |
- Return values
-
0 | on success. |
EINVAL | invalid parameter. |
Reads the specified number of bytes from the EEPROM.
- Parameters
-
[in] | eeprom | eeprom to handle (use the name of the component defined by the config.xml) |
[out] | buf | buffer where the read bytes will be stored. |
[in] | addr | address of the EEPROM to start reading from. |
[in] | len | number of bytes to read from the EEPROM. |
- Return values
-
ssize_t | the number of bytes read. |
ERANGE | out of range. |
<0 | if there is an error while reading the EEPROM. |
Writes an array of bytes in the EEPROM.
- Parameters
-
[in] | eeprom | eeprom to handle (use the name of the component defined by the config.xml) |
[in] | buf | buffer containing the bytes to be written. |
[in] | addr | address of the EEPROM to start the writing process. |
[in] | len | number of bytes to write from the buffer. |
- Return values
-
ssize_t | number of bytes that where written. |
ERANGE | out of range |
<0 | if there is an error while writing in the EEPROM. |