Bitfields
Input: 0x10FF
Output:
Channel: 1
ADC Value: 255
0x10FF -> 0b 0001 0000 1111 1111
for channel the mask -> 0xF000
shift to the right by 12 to get the channel
for adc-val the mask -> 0x0FFF
Plan:
- create a local object from the union
- create a mask for the adc value
- create a mask for the channel value
- print the channel and the adc value