extractUint32Bits function
Returns specific bits in a 32-bit unsigned integer.
Bits are specified by:
shift- Bitmask left-shift (0,1, ..., 30, 31)bitmask- For example, 0xF for 4 bits.
Example: viewUint32(0xF0A0, 8, 0xF) // --> 0xA
Implementation
int extractUint32Bits(int uint32, int shift, int mask) {
return mask & (uint32 >> shift);
}