They access a 16-bit integer variable one byte at a time, providing access to the most significant and least significant byte halves. Low byte order is assumed.
Usage will be as follows:
uint16_t v = 0xcafe; const uint8_t v_high = TopByteInt(&v); const uint8_t v_low = BottomByteInt(&v);
The above will cause v_high be 0xca and v_low equal to v_low .
This is pretty scary code, it would be easier to just do it arithmetically:
#define TopByteInt(v) (((v) >> 8) & 0xff) #define BottomByteInt(v) ((v) & 0xff)
source share