XBee Firmware Library  1.6.0
Functions
24xxx EEPROM

Functions

int eeprom_24xxx_config (eeprom_24xxx_t eeprom, uint8_t subaddr, uint8_t addrbytes, uint8_t pagesize)
 Configures the EEPROM. More...
 
ssize_t eeprom_24xxx_read (eeprom_24xxx_t eeprom, void *buf, uint32_t addr, size_t len)
 Reads the specified number of bytes from the EEPROM. More...
 
ssize_t eeprom_24xxx_write (eeprom_24xxx_t eeprom, void *buf, uint32_t addr, size_t len)
 Writes an array of bytes in the EEPROM. More...
 

Detailed Description

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.

Function Documentation

int eeprom_24xxx_config ( eeprom_24xxx_t  eeprom,
uint8_t  subaddr,
uint8_t  addrbytes,
uint8_t  pagesize 
)

Configures the EEPROM.

Parameters
[in]eepromeeprom index to configure (use the name of the component defined by the config.xml)
[in]subaddrEEPROM slave subaddress range from 0 (0x50) to 7 (0x57) depending on hardware configuration.
[in]addrbytesRequired address bytes for the eeprom.
[in]pagesizeDevice page size for writing operations.
Return values
0on success.
EINVALinvalid parameter.
ssize_t eeprom_24xxx_read ( eeprom_24xxx_t  eeprom,
void *  buf,
uint32_t  addr,
size_t  len 
)

Reads the specified number of bytes from the EEPROM.

Parameters
[in]eepromeeprom to handle (use the name of the component defined by the config.xml)
[out]bufbuffer where the read bytes will be stored.
[in]addraddress of the EEPROM to start reading from.
[in]lennumber of bytes to read from the EEPROM.
Return values
ssize_tthe number of bytes read.
ERANGEout of range.
<0if there is an error while reading the EEPROM.
ssize_t eeprom_24xxx_write ( eeprom_24xxx_t  eeprom,
void *  buf,
uint32_t  addr,
size_t  len 
)

Writes an array of bytes in the EEPROM.

Parameters
[in]eepromeeprom to handle (use the name of the component defined by the config.xml)
[in]bufbuffer containing the bytes to be written.
[in]addraddress of the EEPROM to start the writing process.
[in]lennumber of bytes to write from the buffer.
Return values
ssize_tnumber of bytes that where written.
ERANGEout of range
<0if there is an error while writing in the EEPROM.