BeRTOS
|
Driver for the 24xx16 and 24xx256 I2C EEPROMS. More...
#include "cfg/cfg_eeprom.h"
#include <cfg/compiler.h>
#include <cfg/debug.h>
#include <drv/i2c.h>
#include <io/kblock.h>
#include <io/kfile.h>
#include <io/kfile_block.h>
#include <cpu/attr.h>
Go to the source code of this file.
Data Structures | |
struct | Eeprom |
Describe an EEPROM context, used by the driver to access the single device. More... | |
struct | EepromInfo |
Descrive all EEPROM informations needed by the driver. More... | |
Defines | |
#define | KBT_EEPROM MAKE_ID('E', 'E', 'P', 'R') |
ID for eeproms. | |
#define | e2addr(type, field) ((e2addr_t)&(((type *)0)->field)) |
Macro for E2Layout offset calculation. | |
Typedefs | |
typedef uint8_t | e2dev_addr_t |
On the same I2C bus can live more than one EEPROM device. | |
typedef uint16_t | e2addr_t |
Type for EEPROM addresses. | |
typedef uint16_t | e2blk_size_t |
Type for EEPROM block size. | |
typedef uint32_t | e2_size_t |
Type for accessing EEPROM whole size. | |
Enumerations | |
enum | EepromType |
Values for Eeprom types. | |
Functions | |
Eeprom * | EEPROM_CAST_KBLOCK (KBlock *blk) |
Convert + ASSERT from generic KFile to Eeprom. | |
bool | eeprom_erase (Eeprom *eep, e2addr_t addr, e2_size_t count) |
Erase EEPROM. | |
void | eeprom_init_5 (Eeprom *eep, I2c *i2c, EepromType type, e2dev_addr_t addr, bool verify) |
Initialize EEPROM module. |
Driver for the 24xx16 and 24xx256 I2C EEPROMS.
Definition in file eeprom.h.
#define e2addr | ( | type, | |
field | |||
) | ((e2addr_t)&(((type *)0)->field)) |
Macro for E2Layout offset calculation.
typedef uint8_t e2dev_addr_t |
void eeprom_init_5 | ( | Eeprom * | eep, |
I2c * | i2c, | ||
EepromType | type, | ||
e2dev_addr_t | addr, | ||
bool | verify | ||
) |
Initialize EEPROM module.
eep | is the Kblock context. |
type | is the eeprom device we want to initialize ( |
i2c | context for i2c channel |
addr | is the i2c devide address (usually pins A0, A1, A2). |
verify | enable the write check. |