I would like to define to the struct
typedef struct
{
unsigned long GPFSEL[6];
unsigned long Reserved_1;
unsigned long GPSET[2];
unsigned long Reserved_2;
//Ignoring the reserved and test bytes
} GPIO_REGS_;
One solution would be this
volatile GPIO_REGS_ * const GPIO_REGS = ((volatile GPIO_REGS_ *) 0x20200000UL);
In this case I can reach the register as follow:
GPIO_REGS->GPSET[0];
But how should I define the GPIO_REGS variable that I can use as follow
GPIO_REGS.GPSET[0];
Why the following won't work?
#define GPIO_REGS (*(( GPIO_REGS_ *) 0x20200000UL));