[riot-notifications] [RIOT-OS/RIOT] i2c_read_regs / i2c_write_regs and endianess (#11544)
notifications at github.com
Tue May 21 06:50:58 CEST 2019
@dylad : many thanks for the links! I'll check the tickets in detail for sure!
@keestux: I've looked a bit further but again came until now to a similar conclusion as yours, as it seems like it's device specific (althought inclined, at least for EEPROMS which are one of the fews that need 16 byte adressing as other simpler I2C devices don't have that much registers, to be big endian) and there is not even mention of "register" in I2C.
About a possible PR:
assuming we need to handle both cases (if we conclude it's device specific) I would go for having therefore a set of these reg function, one that works with big endian and one with little endian, and in each of these we make sure the format is correct (using the functions defined in `include/byteorder.h`).
Either we keep the current one named as it is (and force it to be big endian, as I think it was originally tested for) and create just and additional little endian one, or we remove the current one (but this is an API change) and add explicitly a _be and a _le.
Let me know if this sounds reasonable (also which would be best of the two API solutions), I can sketch the code then in a PR.
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the notifications