I am creating a driver and I have declared my registers like this in the header file of my class.
private:
static const uint32_t REG1 = (0x00000000);
static const uint32_t REG2 = (0x00000004);
static const uint32_t REG3 = (0x00000008);
static const uint32_t REG4 = (0x0000000c);
static const uint32_t REG5 = (0x00000010);
// etc ...
Then in my .cpp
, I have done this:
const uint32_t Class::REG1;
const uint32_t Class::REG2;
const uint32_t Class::REG3;
const uint32_t Class::REG4;
const uint32_t Class::REG5;
I have been told that I need to hide the register values and don't put them into the header. Which is the most optimal way to do this?