[riot-notifications] [RIOT-OS/RIOT] periph/i2c: handle i2c registers in both little and big endian (#11585)

Federico Pellegrin notifications at github.com
Mon May 27 07:36:51 CEST 2019


### Contribution description
Adds the possibility to ask for 16-bit little-endian register access, making also sure that the previous one (which was supposed to be big-endian) works correctly on all platforms (assuring a conversion to big-endian is always done, while before the function may not have been working depending on the endianess of the architecture).
The endianess of the I2C 16-bit registers is device dependant and therefore giving the possibility to have both is deemed useful.

### Testing procedure
The test in `tests/periph_i2c` can be used, specifiying to `i2c_read_reg` the flag value of 16 (equivalent to `I2C_REG16_LE` value) to test the new little-endian feature or 2 to test the old big-endian one.

### Issues/PRs references
Fixed #11544 . Discussion on implementation on that Issue.

You can view, comment on, or merge this pull request online at:

  https://github.com/RIOT-OS/RIOT/pull/11585

-- Commit Summary --

  * periph/i2c: handle i2c registers in both little and big endian

-- File Changes --

    M drivers/include/periph/i2c.h (9)
    M drivers/periph_common/i2c.c (25)

-- Patch Links --

https://github.com/RIOT-OS/RIOT/pull/11585.patch
https://github.com/RIOT-OS/RIOT/pull/11585.diff

-- 
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/pull/11585
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190527/6138e5f2/attachment.html>


More information about the notifications mailing list