[riot-notifications] [RIOT-OS/RIOT] periph/i2c: handle i2c registers in both little and big endian (#11585)
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:
-- 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 --
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