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