We should have variable length registers (whole number of bytes only though obviously). To execute a command, you just write to a register that has a length of 0 bytes. This should be standardised across the whole platform.
Examples of 0 byte length registers are "Save user settings to EEPROM" and "Reset module".
I think that, for thoroughness, the modules should have registers which contain the firmware revision number, a module ID (a unique number we give to each of the modules) and a module name (~16 byte ASCII null-terminated string which the user can overwrite).More specific to this Scanning sensor module -
I think the storage of multiple look up tables for each possible sensor is silly. Changing of the sensor connected to the module will happen infrequently and so it is a waste to store the data. It would require an extra external EEPROM chip, and that is just unnecessarily complex. Instead the user will just have to use I2C or their programmer to send and store a single LUT on the MCU's internal EEPROM.
Another (closely related) idea was the module's own internal conversion between units (volts, cm, inches...). This is now unnecessary since if the user wants to convert to inches (i can't ever see them needing to do this while the robot is running anyway) then they just unload a new LUT to the module.
This module should also support sensors which output a pulse where the width is related to the sensor reading.
Do you think that LUTs are a good idea for the sensor data conversion? Or do you think we could use some more maths instead? Maybe we could approximate sensor characteristics with a polynomial.
The ATTinyx5 series has 2 cycle multiply so this would be easily achievable.
And all we would have to store in the EEPROM is a few coefficients. Actually i will look into this aswell, seems sensible
I will change the spreadsheet i posted earlier and re-publish it soon.
EDIT: Ooops i read the wrong datasheet. The ATTinyx5 series don't have hardware multipliers, ill have a look at the software implementations and see if approximating sensor characteristics is still possible with power series.