Hello,
i'm developing a board that comunicates with two i2c sensors. I developed some i2c routines to use with these sensors. Everything works fine (comunication establish and i can exchange data), but i noticed that the sensors need different endianess in transmission: one needs MSBfirst, the other LSBfirst. In general, i could implement an additional step to swap bytes for one of the two devices, but this would require doubling the functions and it should be considered bad practice if some options is available instead.
I believed that the i2c_dt_spec* spec parameter that i need to pass to:
static inline int i2c_write_read_dt(const struct i2c_dt_spec *spec, const void *write_buf, size_t num_write, void *read_buf, size_t num_read)
could contain a flag (i.e. I2C_BIT_ORDER_MSB)or something to specify the endianess of the comunication but i was not able to find anything in both Nrf Connect SDK and Zephyr documentation.
Is there any info i missed? I'm quite confident that there should be a smart solution for this common problem.
Thank you
Francesco