Likely Implementation
class MyReg : public Register {
public:
static const int ItemOne = 0x0;
static const int ItemTwo = 0x1;
static const int ItemThree = 0x3;
int FourBitField (int value) {
int regval = Register::read(); // Or use cached value?
int oldval = (regval >> 1) & 0xF;
regval &= (~0xF) >> 1;
regval |= (value & 0xF) >> 1;
Register::write (regval); // Or caller does this?
return oldval;
}
}