2 ms·
For the first case, you need to know how the value is split into bits, what does each part of the value mean, and what do the values of reach part mean. For th
by viraptor 9y ago
For the first case, you need to know how the value is split into bits, what does each part of the value mean, and what do the values of reach part mean.
For the second case, most of it goes away. You still need to know exactly how the value you set is interpreted, but you get a readable description of each part and you don't have to think of bit shifting every time they're set.
The declaration is longer of course. But what would you prefer to see at usage time:
MREG42 = MREG42 & table_type_mask | inphase_val
Or:
device_setup_registers->table_type = TableType.inphase