I'd like my class to set the output bit in a DDR register, but I don't know if the caller will use DDRA, DDRB, etc.
i can't even use a switch statement because on some chips DDRD is defined and not others, leading to ugly code to handle it.
So I figure a template might be the best way. The only problem is I don't know how I'd pass DDR in the template... Any idea how to pull it off?
template <?[color=red]??? myddr[/color]>
class myclass {
myclass() { myddr |= 1U<<3; }
}
myclass<DDRB> foob;
mycass<DDRD> food;