00001 #ifndef _DEV_AT24C_H_ 00002 #define _DEV_AT24C_H_ 00003 00004 #include <sys/types.h> 00005 #include <stdint.h> 00006 #include <cfg/eeprom.h> 00007 00008 #ifndef NUT_CONFIG_AT24_ADR 00009 #define NUT_CONFIG_AT24_ADR 0x50 00010 #endif 00011 00012 struct at24c{ 00013 uint8_t SlaveAddress; /* Slave address on the bus */ 00014 uint8_t IAddrW; /* With of slaves address register in bytes */ 00015 uint8_t PageSize; /* Size of pages that can be written at once */ 00016 uint8_t NumOfPage; /* Number of pages of previous defined size */ 00017 uint32_t EepromSize; /* Size of the eeprom memory in total */ 00018 uint8_t Timeout; /* Timeout of internal programming in ms*/ 00019 // unsigned int EepromName; 00020 }; 00021 00022 __BEGIN_DECLS 00023 /* Prototypes */ 00024 extern int At24cWrite( struct at24c *at24cs, uint8_t *buffer, uint32_t len, uint32_t addr); 00025 extern int At24cRead( struct at24c *at24cs, uint8_t *buffer, uint32_t len, uint32_t addr ); 00026 __END_DECLS 00027 /* End of prototypes */ 00028 #endif