I2C EEPROM library from 24C01 to 24C1025
Dependents: Digitalni_Sat_MG_AN EEROM_1768 EEPROM_kamal EEPROM_MY ... more
Revision 1:a262173cac81, committed 2013-12-11
- Comitter:
- bborredon
- Date:
- Wed Dec 11 23:13:19 2013 +0000
- Parent:
- 0:80245aff63ce
- Child:
- 2:79ed7ff7c23d
- Commit message:
- Version 1.1 12/11/2013 update
Changed in this revision
eeprom.cpp | Show annotated file Show diff for this revision Revisions of this file |
eeprom.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/eeprom.cpp Sat Jul 14 08:20:06 2012 +0000 +++ b/eeprom.cpp Wed Dec 11 23:13:19 2013 +0000 @@ -1,7 +1,18 @@ /*********************************************************** Author: Bernard Borredon +Date: 11 december 2013 +Version: 1.1 + - Change address parameter size form uint16_t to uint32_t (error for eeprom > 24C256). + - Change size parameter size from uint16_t to uint32_t (error for eeprom > 24C256). + - Correct a bug in function write(uint32_t address, int8_t data[], uint32_t length) : + last step must be done only if it remain datas to send. + - Add function getName. + - Add function clear. + - Initialize _name array. + Date: 27 december 2011 Version: 1.0 + ************************************************************/ #include "eeprom.h" @@ -9,6 +20,9 @@ #define BIT_TEST(x,n) (x & (0x01<<n)) #define BIT_CLEAR(x,n) (x=x & ~(0x01<<n)) +const char * const EEPROM::_name[] = {"24C01","24C02","24C04","24C08","24C16","24C32", + "24C64","24C128","24C256","24C512","24C1024","24C1025"}; + EEPROM::EEPROM(PinName sda, PinName scl, uint8_t address, TypeEeprom type) : _i2c(sda, scl) { @@ -101,7 +115,7 @@ _i2c.frequency(400000); } -void EEPROM::write(uint16_t address, int8_t data) +void EEPROM::write(uint32_t address, int8_t data) { uint8_t page; uint8_t addr; @@ -148,8 +162,6 @@ // Data cmd[2] = (uint8_t) data; } - - //printf("len %d address %02x cmd[0] %02x cmd[1] %02x cmd[2] %02x\n",len,addr,cmd[0],cmd[1],cmd[2]); ack = _i2c.write((int)addr,(char *)cmd,len); if(ack != 0) { @@ -162,10 +174,10 @@ } -void EEPROM::write(uint16_t address, int8_t data[], uint16_t length) +void EEPROM::write(uint32_t address, int8_t data[], uint32_t length) { uint8_t page; - uint8_t addr; + uint8_t addr = 0; uint8_t blocs,remain; uint8_t fpart,lpart; uint8_t i,j,ind; @@ -307,84 +319,86 @@ } } - // Compute page number - page = 0; - if(_type < T24C32) - page = (uint8_t) (address / 256); + if(remain) { + // Compute page number + page = 0; + if(_type < T24C32) + page = (uint8_t) (address / 256); - // Device address - addr = EEPROM_Address | _address | (page << 1); - - if(_type < T24C32) { - // Word address - cmd[0] = (uint8_t) (address - page * 256); + // Device address + addr = EEPROM_Address | _address | (page << 1); - if((uint8_t) ((address + remain) / 256) == page) { // Data fit in the same page - // Add data for the current page - for(j = 0;j < remain;j++) - cmd[j + 1] = (uint8_t) data[blocs * _page_write + j]; - - // Write data for the current page - ack = _i2c.write((int)addr,(char *)cmd,remain + 1); - if(ack != 0) { - _errnum = EEPROM_I2cError; - return; - } + if(_type < T24C32) { + // Word address + cmd[0] = (uint8_t) (address - page * 256); - // Wait end of write - ready(); - } - else { // Data on 2 pages. We must split the write - // Number of bytes in current page - fpart = (page + 1) * 256 - address; - - // Add data for current page - for(j = 0;j < fpart;j++) - cmd[j + 1] = (uint8_t) data[blocs * _page_write + j]; + if((uint8_t) ((address + remain) / 256) == page) { // Data fit in the same page + // Add data for the current page + for(j = 0;j < remain;j++) + cmd[j + 1] = (uint8_t) data[blocs * _page_write + j]; - // Write data for current page - ack = _i2c.write((int)addr,(char *)cmd,fpart + 1); - if(ack != 0) { - _errnum = EEPROM_I2cError; - return; - } - - // Wait end of write - ready(); - - // Increment address - address += fpart; - - if(page < _page_number - 1) { - // Increment page - page++; - - // Device address - addr = EEPROM_Address | _address | (page << 1); - - // Word address - cmd[0] = (uint8_t) (address - page * 256); - - // Data index - ind = blocs * _page_write + fpart; - - // Number of bytes in next page - lpart = remain - fpart; - - // Add data for next page - for(j = 0;j < lpart;j++) - cmd[j + 1] = (uint8_t) data[ind + j]; - - // Write data for next page - ack = _i2c.write((int)addr,(char *)cmd,lpart + 1); + // Write data for the current page + ack = _i2c.write((int)addr,(char *)cmd,remain + 1); if(ack != 0) { _errnum = EEPROM_I2cError; return; } - + // Wait end of write ready(); } + else { // Data on 2 pages. We must split the write + // Number of bytes in current page + fpart = (page + 1) * 256 - address; + + // Add data for current page + for(j = 0;j < fpart;j++) + cmd[j + 1] = (uint8_t) data[blocs * _page_write + j]; + + // Write data for current page + ack = _i2c.write((int)addr,(char *)cmd,fpart + 1); + if(ack != 0) { + _errnum = EEPROM_I2cError; + return; + } + + // Wait end of write + ready(); + + // Increment address + address += fpart; + + if(page < _page_number - 1) { + // Increment page + page++; + + // Device address + addr = EEPROM_Address | _address | (page << 1); + + // Word address + cmd[0] = (uint8_t) (address - page * 256); + + // Data index + ind = blocs * _page_write + fpart; + + // Number of bytes in next page + lpart = remain - fpart; + + // Add data for next page + for(j = 0;j < lpart;j++) + cmd[j + 1] = (uint8_t) data[ind + j]; + + // Write data for next page + ack = _i2c.write((int)addr,(char *)cmd,lpart + 1); + if(ack != 0) { + _errnum = EEPROM_I2cError; + return; + } + + // Wait end of write + ready(); + } + } } } else { @@ -411,7 +425,7 @@ } -void EEPROM::write(uint16_t address, int16_t data) +void EEPROM::write(uint32_t address, int16_t data) { int8_t cmd[2]; @@ -431,7 +445,7 @@ } -void EEPROM::write(uint16_t address, int32_t data) +void EEPROM::write(uint32_t address, int32_t data) { int8_t cmd[4]; @@ -451,7 +465,7 @@ } -void EEPROM::write(uint16_t address, float data) +void EEPROM::write(uint32_t address, float data) { int8_t cmd[4]; @@ -471,7 +485,7 @@ } -void EEPROM::write(uint16_t address, void *data, uint16_t size) +void EEPROM::write(uint32_t address, void *data, uint32_t size) { int8_t *cmd = NULL; @@ -491,15 +505,15 @@ return; } - memcpy(cmd,data,size); + memcpy(cmd,(uint8_t *)data,size); write(address,cmd,size); - + free(cmd); } -void EEPROM::read(uint16_t address, int8_t& data) +void EEPROM::read(uint32_t address, int8_t& data) { uint8_t page; uint8_t addr; @@ -557,7 +571,7 @@ } -void EEPROM::read(uint16_t address, int8_t *data, uint16_t size) +void EEPROM::read(uint32_t address, int8_t *data, uint32_t size) { uint8_t page; uint8_t addr; @@ -642,7 +656,7 @@ } -void EEPROM::read(uint16_t address, int16_t& data) +void EEPROM::read(uint32_t address, int16_t& data) { int8_t cmd[2]; @@ -662,7 +676,7 @@ } -void EEPROM::read(uint16_t address, int32_t& data) +void EEPROM::read(uint32_t address, int32_t& data) { int8_t cmd[4]; @@ -682,7 +696,7 @@ } -void EEPROM::read(uint16_t address, float& data) +void EEPROM::read(uint32_t address, float& data) { int8_t cmd[4]; @@ -702,10 +716,10 @@ } -void EEPROM::read(uint16_t address, void *data, uint16_t size) +void EEPROM::read(uint32_t address, void *data, uint32_t size) { int8_t *cmd = NULL; - + // Check error if(_errnum) return; @@ -717,12 +731,13 @@ } cmd = (int8_t *)malloc(size); + if(cmd == NULL) { _errnum = EEPROM_MallocError; return; } - read(address,cmd,size); + read(address,(int8_t *)cmd,size); memcpy(data,cmd,size); @@ -730,11 +745,23 @@ } +void EEPROM::clear(void) +{ + int32_t data; + uint32_t i; + + data = 0; + + for(i = 0; i < _size / 4;i++) { + write((uint32_t)(i * 4),data); + } +} + void EEPROM::ready(void) { int ack; uint8_t addr; - uint8_t cmd; + uint8_t cmd[2]; // Check error if(_errnum) @@ -743,11 +770,12 @@ // Device address addr = EEPROM_Address | _address; - cmd = 0; + cmd[0] = 0; // Wait end of write do { ack = _i2c.write((int)addr,(char *)cmd,0); + //wait(0.5); } while(ack != 0); } @@ -757,12 +785,58 @@ return(_size); } +const char* EEPROM::getName(void) +{ + uint8_t i = 0; + + switch(_type) { + case T24C01 : + i = 0; + break; + case T24C02 : + i = 1; + break; + case T24C04 : + i = 2; + break; + case T24C08 : + i = 3; + break; + case T24C16 : + i = 4; + break; + case T24C32 : + i = 5; + break; + case T24C64 : + i = 6; + break; + case T24C128 : + i = 7; + break; + case T24C256 : + i = 8; + break; + case T24C512 : + i = 9; + break; + case T24C1024 : + i = 10; + break; + case T24C1025 : + i = 11; + break; + } + + return(_name[i]); +} + uint8_t EEPROM::getError(void) { return(_errnum); } -bool EEPROM::checkAddress(uint16_t address) +bool EEPROM::checkAddress(uint32_t address) { bool ret = true; @@ -818,4 +892,4 @@ } return(ret); -} \ No newline at end of file +}
--- a/eeprom.h Sat Jul 14 08:20:06 2012 +0000 +++ b/eeprom.h Wed Dec 11 23:13:19 2013 +0000 @@ -1,6 +1,20 @@ #ifndef __EEPROM__H_ #define __EEPROM__H_ +/*********************************************************** +Author: Bernard Borredon +Date: 11 december 2013 +Version: 1.1 + - Change address parameter size form uint16_t to uint32_t (error for eeprom > 24C256). + - Change size parameter size from uint16_t to uint32_t (error for eeprom > 24C256). + - Add EEPROM name as a private static const char array. + - Add function getName. + - Add a test program. + +Date: 27 december 2011 +Version: 1.0 +************************************************************/ + // Includes #include <string> @@ -8,6 +22,289 @@ // Example /* +#include <string> + +#include "mbed.h" +#include "eeprom.h" + +#define EEPROM_ADDR 0x0 // I2c EEPROM address is 0x00 + +#define SDA p9 // I2C SDA pin +#define SCL p10 // I2C SCL pin + +#define MIN(X,Y) ((X) < (Y) ? (X) : (Y)) +#define MAX(X,Y) ((X) > (Y) ? (X) : (Y)) + +DigitalOut led2(LED2); + +typedef struct _MyData { + int16_t sdata; + int32_t idata; + float fdata; + } MyData; + +static void myerror(std::string msg) +{ + printf("Error %s\n",msg.c_str()); + exit(1); +} + +void eeprom_test(void) +{ + EEPROM ep(SDA,SCL,EEPROM_ADDR,EEPROM::T24C16); // 24C16 eeprom with sda = p9 and scl = p10 + uint8_t data[256],data_r[256]; + int8_t ival; + uint16_t s; + int16_t sdata,sdata_r; + int32_t ldata[1024],ldata_r[1024]; + int32_t eeprom_size,max_size; + uint32_t addr; + int32_t idata,idata_r; + uint32_t i,j,k,l,t; + float fdata,fdata_r; + MyData md,md_r; + + eeprom_size = ep.getSize(); + max_size = MIN(eeprom_size,256); + + printf("Test EEPROM I2C model %s of %d bytes\n\n",ep.getName(),eeprom_size); + + // Test sequential read byte (max_size first bytes) + for(i = 0;i < max_size;i++) { + ep.read(i,ival); + data_r[i] = ival; + if(ep.getError() != 0) + myerror(ep.getErrorMessage()); + } + + printf("Test sequential read %d first bytes :\n\n",max_size); + for(i = 0;i < max_size/16;i++) { + for(j = 0;j < 16;j++) { + addr = i * 16 + j; + printf("%3d ",(uint8_t)data_r[addr]); + } + printf("\n"); + } + + // Test sequential read byte (max_size last bytes) + for(i = 0;i < max_size;i++) { + addr = eeprom_size - max_size + i; + ep.read(addr,ival); + data_r[i] = ival; + if(ep.getError() != 0) + myerror(ep.getErrorMessage()); + } + + printf("Test sequential read %d last bytes :\n\n",max_size); + for(i = 0;i < max_size/16;i++) { + for(j = 0;j < 16;j++) { + addr = i * 16 + j; + printf("%3d ",(uint8_t)data_r[addr]); + } + printf("\n"); + } + + // Test write byte (max_size first bytes) + for(i = 0;i < max_size;i++) + data[i] = i; + + for(i = 0;i < max_size;i++) { + ep.write(i,(int8_t)data[i]); + if(ep.getError() != 0) + myerror(ep.getErrorMessage()); + } + + // Test read byte (max_size first bytes) + for(i = 0;i < max_size;i++) { + ep.read(i,(int8_t&)ival); + data_r[i] = (uint8_t)ival; + if(ep.getError() != 0) + myerror(ep.getErrorMessage()); + } + + printf("Test write and read %d first bytes :\n\n",max_size); + for(i = 0;i < max_size/16;i++) { + for(j = 0;j < 16;j++) { + addr = i * 16 + j; + printf("%3d ",(uint8_t)data_r[addr]); + } + printf("\n"); + } + + // Test current address read byte (max_size first bytes) + ep.read((uint32_t)0,(int8_t&)ival); // current address is 0 + data_r[0] = (uint8_t)ival; + if(ep.getError() != 0) + myerror(ep.getErrorMessage()); + + for(i = 1;i < max_size;i++) { + ep.read((int8_t&)ival); + data_r[i] = (uint8_t)ival; + if(ep.getError() != 0) + myerror(ep.getErrorMessage()); + } + + printf("Test current address read %d first bytes :\n\n",max_size); + for(i = 0;i < max_size/16;i++) { + for(j = 0;j < 16;j++) { + addr = i * 16 + j; + printf("%3d ",(uint8_t)data_r[addr]); + } + printf("\n"); + } + + // Test sequential read byte (first max_size bytes) + ep.read((uint32_t)0,(int8_t *)data_r,(uint32_t) max_size); + if(ep.getError() != 0) + myerror(ep.getErrorMessage()); + + printf("Test sequential read %d first bytes :\n\n",max_size); + for(i = 0;i < max_size/16;i++) { + for(j = 0;j < 16;j++) { + addr = i * 16 + j; + printf("%3d ",(uint8_t)data_r[addr]); + } + printf("\n"); + } + + // Test write short, long, float + sdata = -15202; + addr = eeprom_size - 16; + ep.write(addr,(int16_t)sdata); // short write at address eeprom_size - 16 + if(ep.getError() != 0) + myerror(ep.getErrorMessage()); + + idata = 45123; + addr = eeprom_size - 12; + ep.write(addr,(int32_t)idata); // long write at address eeprom_size - 12 + if(ep.getError() != 0) + myerror(ep.getErrorMessage()); + + fdata = -12.26; + addr = eeprom_size - 8; + ep.write(addr,(float)fdata); // float write at address eeprom_size - 8 + if(ep.getError() != 0) + myerror(ep.getErrorMessage()); + + // Test read short, long, float + printf("Test write and read short (%d), long (%d), float (%f) :\n", + sdata,idata,fdata); + + ep.read((uint32_t)(eeprom_size - 16),(int16_t&)sdata_r); + if(ep.getError() != 0) + myerror(ep.getErrorMessage()); + printf("sdata %d\n",sdata_r); + + ep.read((uint32_t)(eeprom_size - 12),(int32_t&)idata_r); + if(ep.getError() != 0) + myerror(ep.getErrorMessage()); + printf("idata %d\n",idata_r); + + ep.read((uint32_t)(eeprom_size - 8),fdata_r); + if(ep.getError() != 0) + myerror(ep.getErrorMessage()); + printf("fdata %f\n\n",fdata_r); + + // Test read and write a structure + md.sdata = -15203; + md.idata = 45124; + md.fdata = -12.27; + + ep.write((uint32_t)(eeprom_size - 32),(void *)&md,sizeof(md)); // write a structure eeprom_size - 32 + if(ep.getError() != 0) + myerror(ep.getErrorMessage()); + + printf("Test write and read a structure (%d %d %f) :\n\n",md.sdata,md.idata,md.fdata); + + ep.read((uint32_t)(eeprom_size - 32),(void *)&md_r,sizeof(md_r)); + if(ep.getError() != 0) + myerror(ep.getErrorMessage()); + + printf("md.sdata %d\n",md_r.sdata); + printf("md.idata %d\n",md_r.idata); + printf("md.fdata %f\n\n",md_r.fdata); + + // Test read and write of an array of the first max_size bytes + for(i = 0;i < max_size;i++) + data[i] = max_size - i - 1; + + ep.write((uint32_t)(0),data,(uint32_t)max_size); + if(ep.getError() != 0) + myerror(ep.getErrorMessage()); + + ep.read((uint32_t)(0),data_r,(uint32_t)max_size); + if(ep.getError() != 0) + myerror(ep.getErrorMessage()); + + printf("Test write and read an array of the first %d bytes :\n",max_size); + for(i = 0;i < max_size/16;i++) { + for(j = 0;j < 16;j++) { + addr = i * 16 + j; + printf("%3d ",(uint8_t)data_r[addr]); + } + printf("\n"); + } + printf("\n"); + + // Test write and read an array of int32 + s = eeprom_size / 4; // size of eeprom in int32 + int ldata_size = sizeof(ldata) / 4; // size of data array in int32 + l = s / ldata_size; // loop index + + // size of read / write in bytes + t = eeprom_size; + if(t > ldata_size * 4) + t = ldata_size * 4; + + printf("Test write and read an array of %d int32 (write entire memory) :\n",t); + + // Write entire eeprom + for(k = 0;k <= l;k++) { + for(i = 0;i < ldata_size;i++) + ldata[i] = ldata_size * k + i; + + addr = k * ldata_size * 4; + ep.write(addr,(void *)ldata,t); + if(ep.getError() != 0) + myerror(ep.getErrorMessage()); + } + + // Read entire eeprom + for(k = 0;k <= l;k++) { + addr = k * s * 4; + + ep.read(addr,(void *)ldata_r,t); + if(ep.getError() != 0) + myerror(ep.getErrorMessage()); + + // format outputs with 16 words rows + for(i = 0;i < s / 16;i++) { + printf("%3d ",i+1); + for(j = 0;j < 16;j++) { + addr = i * 16 + j; + printf("%4d ",ldata_r[addr]); + } + printf("\n"); + } + } + + // clear eeprom + printf("Clear eeprom\n"); + + ep.clear(); + if(ep.getError() != 0) + myerror(ep.getErrorMessage()); + + printf("End\n"); +} + +int main() +{ + + eeprom_test(); + + return(0); +} */ // Defines @@ -37,7 +334,7 @@ enum TypeEeprom {T24C01=128,T24C02=256,T24C04=512,T24C08=1024,T24C16=2048, T24C32=4096,T24C64=8192,T24C128=16384,T24C256=32768, T24C512=65536,T24C1024=131072,T24C1025=131073} Type; - + /* * Constructor, initialize the eeprom on i2c interface. * @param sda : sda i2c pin (PinName) @@ -50,44 +347,44 @@ /* * Random read byte - * @param address : start address (uint16_t) + * @param address : start address (uint32_t) * @param data : byte to read (int8_t&) * @return none */ - void read(uint16_t address, int8_t& data); + void read(uint32_t address, int8_t& data); /* * Random read short - * @param address : start address (uint16_t) + * @param address : start address (uint32_t) * @param data : short to read (int16_t&) * @return none */ - void read(uint16_t address, int16_t& data); + void read(uint32_t address, int16_t& data); /* * Random read long - * @param address : start address (uint16_t) + * @param address : start address (uint32_t) * @param data : long to read (int32_t&) * @return none */ - void read(uint16_t address, int32_t& data); + void read(uint32_t address, int32_t& data); /* * Random read float - * @param address : start address (uint16_t) + * @param address : start address (uint32_t) * @param data : float to read (float&) * @return none */ - void read(uint16_t address, float& data); + void read(uint32_t address, float& data); /* * Random read anything - * @param address : start address (uint16_t) + * @param address : start address (uint32_t) * @param data : data to read (void *) - * @param size : number of bytes to read (uint16_t) + * @param size : number of bytes to read (uint32_t) * @return none */ - void read(uint16_t address, void *data, uint16_t size); + void read(uint32_t address, void *data, uint32_t size); /* * Current address read byte @@ -98,62 +395,62 @@ /* * Sequential read byte - * @param address : start address (uint16_t) + * @param address : start address (uint32_t) * @param data : bytes array to read (int8_t[]&) - * @param size : number of bytes to read (uint16_t) + * @param size : number of bytes to read (uint32_t) * @return none */ - void read(uint16_t address, int8_t *data, uint16_t size); + void read(uint32_t address, int8_t *data, uint32_t size); /* * Write byte - * @param address : start address (uint16_t) + * @param address : start address (uint32_t) * @param data : byte to write (int8_t) * @return none */ - void write(uint16_t address, int8_t data); + void write(uint32_t address, int8_t data); /* * Write short - * @param address : start address (uint16_t) + * @param address : start address (uint32_t) * @param data : short to write (int16_t) * @return none */ - void write(uint16_t address, int16_t data); + void write(uint32_t address, int16_t data); /* * Write long - * @param address : start address (uint16_t) + * @param address : start address (uint32_t) * @param data : long to write (int32_t) * @return none */ - void write(uint16_t address, int32_t data); + void write(uint32_t address, int32_t data); /* * Write float - * @param address : start address (uint16_t) + * @param address : start address (uint32_t) * @param data : float to write (float) * @return error number if > 0 (uint8_t) */ - void write(uint16_t address, float data); + void write(uint32_t address, float data); /* - * Write anything - * @param address : start address (uint16_t) + * Write anything (use the page write mode) + * @param address : start address (uint32_t) * @param data : data to write (void *) - * @param size : number of bytes to read (uint16_t) + * @param size : number of bytes to write (uint32_t) * @return none */ - void write(uint16_t address, void *data, uint16_t size); + void write(uint32_t address, void *data, uint32_t size); /* - * Write page - * @param address : start address (uint16_t) + * Write array of bytes (use the page mode) + * @param address : start address (uint32_t) * @param data : bytes array to write (int8_t[]) - * @param size : number of bytes to write (uint16_t) + * @param size : number of bytes to write (uint32_t) * @return none */ - void write(uint16_t address, int8_t data[], uint16_t size); + void write(uint32_t address, int8_t data[], uint32_t size); /* * Wait eeprom ready @@ -165,14 +462,28 @@ /* * Get eeprom size in bytes * @param : none - * @return size in bytes (uint16_t) + * @return size in bytes (uint32_t) */ uint32_t getSize(void); + + /* + * Get eeprom name + * @param : none + * @return name (const char*) + */ + const char* getName(void); + + /* + * Clear eeprom (write with 0) + * @param : none + * @return current error number (uint8_t) + */ + void clear(void); /* * Get the current error number (EEPROM_NoError if no error) * @param : none - * @return current error number (uint8_t) + * @return none */ uint8_t getError(void); @@ -188,14 +499,15 @@ //---------- local variables ---------- private: - I2C _i2c; // Local i2c communication interface instance - int _address; // Local ds1621 i2c address - uint8_t _errnum; // Error number - TypeEeprom _type; // EEPROM type - uint8_t _page_write; // Page write size - uint8_t _page_number; // Number of page - uint32_t _size; // Size in bytes - bool checkAddress(uint16_t address); // Check address range + I2C _i2c; // Local i2c communication interface instance + int _address; // Local i2c address + uint8_t _errnum; // Error number + TypeEeprom _type; // EEPROM type + uint8_t _page_write; // Page write size + uint8_t _page_number; // Number of page + uint32_t _size; // Size in bytes + bool checkAddress(uint32_t address); // Check address range + static const char * const _name[]; // eeprom name //------------------------------------- }; -#endif \ No newline at end of file +#endif