Question.5
A developer packs three fields into a 16-bit SPI config register:
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| CPOL | CPHA | DIV | — | CS | |||||||||||
He writes:
uint16_t reg = 0;
uint8_t cpol = 1, cpha = 0, div = 18, cs = 3;
reg |= (cpol & 0x01) << 15;
reg |= (cpha & 0x01) << 14;
reg |= (div & 0x3F) << 8;
reg |= (cs & 0x0F);What is the value of reg in hexadecimal?