4 * Copyright 2003, 2004 Develer S.r.l. (http://www.develer.com/)
10 * \author Stefano Fedrigo <aleph@develer.com>
11 * \author Bernardo Innocenti <bernie@develer.com>
13 * \brief Driver for the 24xx16 and 24xx256 I2C EEPROMS (interface)
18 *#* Revision 1.4 2004/08/25 14:12:08 rasky
19 *#* Aggiornato il comment block dei log RCS
21 *#* Revision 1.3 2004/08/10 06:57:22 bernie
22 *#* eeprom_erase(): New function.
24 *#* Revision 1.2 2004/07/29 22:57:09 bernie
25 *#* Add 24LC16 support.
27 *#* Revision 1.1 2004/07/20 17:11:18 bernie
28 *#* Import into DevLib.
38 * \name Values for CONFIG_EEPROM_TYPE
41 #define EEPROM_24XX16 1
42 #define EEPROM_24XX256 2
45 #if CONFIG_EEPROM_TYPE == EEPROM_24XX16
46 #define EEPROM_BLKSIZE 0x10 //!< Eeprom block size (16byte)
47 #define EEPROM_SIZE 0x800 //!< Eeprom total size (2kB)
48 #elif CONFIG_EEPROM_TYPE == EEPROM_24XX256
49 #define EEPROM_BLKSIZE 0x40 //!< Eeprom block size (64byte)
50 #define EEPROM_SIZE 0x8000 //!< Eeprom total size (32kB)
52 #error Unsupported EEPROM type.
55 //! Type for EEPROM addresses
56 typedef uint16_t e2addr_t;
58 bool eeprom_write(e2addr_t addr, const void *buf, size_t count);
59 bool eeprom_read(e2addr_t addr, void *buf, size_t count);
60 bool eeprom_write_char(e2addr_t addr, char c);
61 int eeprom_read_char(e2addr_t addr);
62 void eeprom_erase(e2addr_t addr, size_t count);
63 void eeprom_init(void);
64 void eeprom_test(void);
66 #endif /* DRV_EEPROM_H */