So I'm trying to ORR some bits in a register on a micro controller. Up until now I've been using Assembly, now I'm using C I'm hitting some walls.
So in ASM if I wanted to access a register with an offset such as. GPIO_PORT_F and offset GPIO_DATA I would use the following code.
LDR R0,=GPIO_PORT_F ;load the base
LDR R1, [R0, #GPIO_DATA] ;load the offset
ORR R1, 0x1 ;ORR it with a value
STR R1, [R0, #GPIO_DATA] ;store back
This is the exact operation I want to perform but in C. This is what I have.
GPIO_PORT_F is defined like
#define GPIO_PORT_F (*((unsigned long *)0x40025000))
(GPIO_PORT_F+GPIO_DATA) = (GPIO_PORT_F+GPIO_DATA) | inMask;
I get an error "expression must be a modifiable lvalue"
What am I doing wrong here, I'm using it's my attempt at offsetting.