Apparently macro DDRA
hides some sort of lvalue tied to some hardware register. Changing that lvalue changes the register and the brightness. If the actual type if that lvalue is uint8_t
, then in order to pass it through your struct Pin
you should initialize the corresponding member of your struct as
pin6.pinReg = &DDRA;
Note the &
operator.
The pin6.pinReg = DDRA
that you have in your code should not even compile or at least should produce warnings for incompatible types in assignment.