Replies: 4 comments 2 replies
-
The Arduino docs are pretty high-level, so do you have any other core/MCU you use that does the MSB/LSB switch differently? I'd like to just confirm, especially since this call is only used when users explicitly try and read 16 bits (which to me implies those 16-bits are a logical value and we should do magic to make it usable as a Would you like to make a PR fixing this, since you found it (and I assume you ran into a problem because of it)? |
Beta Was this translation helpful? Give feedback.
-
Thank for your answer |
Beta Was this translation helpful? Give feedback.
-
Converted to discussion for you. Never heard of the W806 and only can seem to find a machine translated overview (i.e. not register map/etc.) from the GOOG. But, I will see what, say, the old-school AVRs do, as that's easily discovered and really the OG Arduino definition. :) |
Beta Was this translation helpful? Give feedback.
-
According to this AVR core, https://github.com/arduino/ArduinoCore-avr/blob/master/libraries/SPI/src/SPI.h#L220-L241 So, I think the existing code is behaving correctly. |
Beta Was this translation helpful? Give feedback.
-
Hi
There is some confusion between these two pairs of settings, but as far I know they are generally independent. The MSBFIRST/LSBFIRST controls the order of bits in a single byte, the BigEndian/LittleEndian - the order of bytes in a 32-bit word. Changing the order of bits when setting the LSBFIRST does not mean changing the order of bytes.
However, in your code these settings are treated as related. For example, in the
reverse16Bit
procedure, when changing from MSB to LSB, not only bits, but also bytes are unfolded:Beta Was this translation helpful? Give feedback.
All reactions