Byte Order and Bit Fields Inside a Register
A register is usually read as a whole 32-bit number, but its meaning is packed into individual bits and small groups of bits: bit 0 means busy, bits 8 to 15 hold a length, and so on. On top of that, the device and the processor may disagree about which end of a multi-byte value comes first, which is what little-endian and big-endian mean. Get either wrong and you set the wrong flag or write a number that arrives byte-reversed, with no error message to tell you.
Questions this Concept answers
- Why does a byte-order mismatch between a device and the processor usually produce no error message at all?
How Endianness Effects Bitfield Packing
A register is read as one whole number, but its meaning lives in individual bits and small groups of bits. This page shows that the order those named bit fields occupy inside the word flips depending…