In the writeCmdRegister, the dataWords argument, which corresponds (uint16_t *)&value, is going to be written to the i2cwire position by position, starting at position 0.
My question is, why does we start at the beginning of dataWords and not in the end?
This code seems to work if the arduino stores values using the little endian system, but what if it is stored as big endian? can we trust it never is? Am I getting it wrong?
Thank you
[Edit]
After searching a bit, I realized almost every processor is little endian. Still, I'd like to confirm that this code is assuming that just for my own sanity.
I have a question about this conversion:
in
In the writeCmdRegister, the
dataWords
argument, which corresponds(uint16_t *)&value
, is going to be written to the i2cwire position by position, starting at position 0.My question is, why does we start at the beginning of
dataWords
and not in the end? This code seems to work if the arduino stores values using the little endian system, but what if it is stored as big endian? can we trust it never is? Am I getting it wrong?Thank you
[Edit] After searching a bit, I realized almost every processor is little endian. Still, I'd like to confirm that this code is assuming that just for my own sanity.