#include <stdio.h>
#include <stdint.h>
typedef union {
struct {
uint16_t adc_value : 12;
uint16_t channel : 4;
};
uint16_t adc_reg;
} ADC_Result;
int main() {
uint16_t reg;
scanf("%hx", ®);
// Fill union and print channel and adc_value
ADC_Result temp;
temp.adc_reg = reg;
uint16_t value = temp.adc_value;
uint16_t channel = temp.channel;
printf("Channel: %u\n", temp.channel);
printf("ADC Value: %u\n", temp.adc_value);
return 0;
}