Is it possible to access semantically connected registers generically?
Preprocessor concatenation.

#define PORTREGS(let) &amp;PORT ## let, &amp;PIN ## let, &amp;DDR ## let

 ...

SpiInit(PORTREGS(B), PB2, PB1, PB0);