Been going around and around on this, to the point that I hardly know which way is up. Maybe someone can shine a little light on the matter.
I read and write a collection of device control values to M348P EEPROM by putting everything into a struct (about 65 bytes) and use eeprom_write_block(), eeprom_read_block(), and eeprom_update_block() from AVR_libc. It works great.
Now, I need to add a set of calibration tables for an acceleration sensor. There can be up to 6 such tables, one for each sensitivity available for the sensor (2g, 4g, 6g, 8g, and so forth). Each table contains three int16_t offset values (one for each axis) and three int32_t 1g values (one for each axis). Now, an important point is that these values are NEVER used at run-time. They are simply carried forward for use by a desktop GUI; this is so that they are positively bound to the unit without the operator having to do anything but read them via the USB terminal port. That is the "what I need to do", part.
The next part is how to organize them for the eeprom. I wonder if I should add this data to the existing struct, or have one struct that holds all of the tables, or one struct per table. I have no clue how page boundaries are handled in the eeprom_xxx_block() functions and don't even know if that is an issue to be concerned with. Also, I don't know how to maintain order, since the existing struct purposely avoids the first eeprom byte. Do new values declared for the eeprom get assigned in the order in which they are declared?
The next part is how to organize the tables for easy access to the data within an designated table. An array of tables? Arrays within the tables? Struct per table? Here is where I have really been going around and around, not finding anything that is very attractive.
I would really appreciate some constructive thoughts about this. And I do appreciate your contribution.