[riot-notifications] [RIOT-OS/RIOT] i2c_read_regs / i2c_write_regs and endianess (#11544)

Kaspar Schleiser notifications at github.com
Tue May 21 10:03:02 CEST 2019


> 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.

+1 for keeping the current one, but defining it to work in big endian (network) byte order.
It'll require the least changes (probably almost none apart from documentation as we currently only support little endian machines, and on those the current ```uint8_t *ptr = (uint8_t *)&uint16_value)``` will work that way).

As soon as we support a big endian host, its i2c implementation needs to make sure the byte order is correct. Drivers who need little endian byte order can either adapt their defines statically or convert on every i2c reg call.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/issues/11544#issuecomment-494284735
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190521/1dd773fa/attachment.html>


More information about the notifications mailing list