Platform-specific layer provides a consistent Virtual EEPROM API to upper layers of the driver.
EEPROM API Overview
This API contains the functions to control a virtual EEPROM implementation over the flash memory of the Programmable XBee devices. The virtual EEPROM is a user-modifiable read-only memory (ROM) that has been implemented over the processor flash. It can be erased and reprogrammed (written to) repeatedly.
- Virtual EEPROM configuration functions:
- Functions to read/write the Virtual EEPROM:
- Miscellaneous functions:
size_t veeprom_get_size |
( |
void |
| ) |
|
Returns the size of the virtual EEPROM.
- Parameters
-
- Return values
-
size_t | the size in bytes of the virtual EEPROM. |
int veeprom_init |
( |
void |
| ) |
|
Initializes the virtual EEPROM in the flash of the device.
- Parameters
-
- Return values
-
0 | on success. |
<0 | if there is an error in the initialization process. |
ssize_t veeprom_read |
( |
void * |
buf, |
|
|
maddr_t |
offset, |
|
|
size_t |
len |
|
) |
| |
Reads the content of selected virtual EEPROM.
- Parameters
-
[out] | buf | buffer where the read bytes will be stored. |
[in] | offset | address of the virtual EEPROM to start reading from. |
[in] | len | number of bytes to read. |
- Return values
-
ssize_t | the number of bytes read. |
EINVAL | invalid offset parameter. |
ssize_t veeprom_write |
( |
const void * |
buf, |
|
|
maddr_t |
offset, |
|
|
size_t |
len |
|
) |
| |
Writes an array of bytes in the virtual EEPROM.
- Parameters
-
[in] | buf | buffer containing the bytes to be written. |
[in] | offset | address of the virtual EEPROM to start the writing process. |
[in] | len | number of bytes to write from the buffer. |
- Return values
-
ssize_t | number of bytes that were written. |
EINVAL | invalid offset parameter. |