eeprom.h File Reference
Driver for the 24xx16 and 24xx256 I2C EEPROMS (interface). More...
#include <cfg/compiler.h>
#include <appconfig.h>
Go to the source code of this file.
Defines | |
| #define | e2addr(type, field) ((e2addr_t)&(((type *)0)->field)) |
| Macro for E2Layout offset calculation. | |
Values for CONFIG_EEPROM_TYPE | |
| #define | EEPROM_24XX16 1 |
| #define | EEPROM_24XX256 2 |
Typedefs | |
| typedef uint16_t | e2addr_t |
| Type for EEPROM addresses. | |
Functions | |
| bool | eeprom_read (e2addr_t addr, void *buf, size_t count) |
Copy count bytes at address addr from eeprom to RAM to buffer buf. | |
| bool | eeprom_write_char (e2addr_t addr, char c) |
| Write a single character c at address addr. | |
| int | eeprom_read_char (e2addr_t addr) |
| Read a single character at address addr. | |
| void | eeprom_erase (e2addr_t addr, size_t count) |
| Erase specified part of eeprom, writing 0xFF. | |
| void | eeprom_init (void) |
| Initialize TWI module. | |
Detailed Description
Driver for the 24xx16 and 24xx256 I2C EEPROMS (interface).
- Version:
- Id
- eeprom.h 1095 2008-02-07 14:50:20Z batt
Definition in file eeprom.h.
Define Documentation
| #define e2addr | ( | type, | |||
| field | ) | ((e2addr_t)&(((type *)0)->field)) |
Macro for E2Layout offset calculation.
- Note:
- We can't just use offsetof() here because we could use non-constant expressions to access array elements.
'type' is the structure type holding eeprom layout and must be defined in user files.
Function Documentation
| void eeprom_erase | ( | e2addr_t | addr, | |
| size_t | count | |||
| ) |
| bool eeprom_read | ( | e2addr_t | addr, | |
| void * | buf, | |||
| size_t | count | |||
| ) |
| int eeprom_read_char | ( | e2addr_t | addr | ) |
