Your task is to define a union that allows accessing an 8-bit register both as a raw byte and as individual bitfields.
raw
en:1
mode:3
reserved:4
Example Input:
13
Output:
en=1 mode=6
Explanation:
mode = bits[1..3] = 110b = 6
Test Cases
Test Results
Input
Expected Output