Well, I'd implement a separate module for OneWire vs I2C devices at least (and even AT24/25 if you find the protocol is different). As we're after saving as much RAM as possible we don't want to be including code that's never used.
I'd have a very basic .md file for each module, with keywords, a link to EEPROM.md, wiring, any gotchas, a link to the datasheet and the part on farnell or something. But give them all the EEPROM keyword, then write the all-encompassing EEPROM.md and include:
* APPEND_KEYWORD: EEPROM
That will then automatically link in all the pages for the EEPROMs.
By the way, DSxx is probably a bad name for the module given the DS18B20 :) Maybe DS2xxx?
Let me know if I can help at all... Can we try and simplify the API a bit and stick with reading Strings or Arrays (or Uint8Array via E.toArrayBuffer())? It seems there's quite a lot of duplication in AT24 at the moment because of the need to get arrays or strings back. If it causes trouble then I could add a library function to make the conversions easier?
© Espruino, powered by microcosm.
Report a problem