A struct I'm dealing with has a field defined as uint8_t
. The spec also states that all multiple-byte fields are represented in host-endian format.
Bits 0:3 contain the information that I need (also an unsigned integer). Using plain C, how do I extract those 3 bits and convert it to a number type?