I am trying to change the state (output/input) for more then one pin at the same time (with a bitmask).
The code for one pin is:
#define INP_GPIO(g) *(gpio+((g)/10)) &= ~(7<<(((g)%10)*3))
#define OUT_GPIO(g) *(gpio+((g)/10)) |= (1<<(((g)%10)*3))
I don't really understand what this code does.
Let's say, gpio := 0x20200000
so for Pin 1 it should be
10 0000 0010 0000 0000 0000 0000 0000 + 0 = (10 0000 0010 0000 0000 0000 0000 0000 + 0) & ~11 1000 = 0
I think this can't be correct. What am i doing wrong?