I found this statement in header file that came with a micro controller and have no idea how to evaluate it
#define FIO0SET (*(volatile unsigned long *)(FIO_BASE_ADDR + 0x18))
I don’t have the foggiest idea what this expression is, and so I have no way to start any meaningful research. Can anyone tell me what this beast is or how to evaluate it?
Go at memory address
FIO_BASE_ADDR + 0x18and retreive the 32-bit (ifunsigned longis 32-bit) word stored at that location.FIO0SETis also a modifiable lvalue so you can assign it a value.Note that the
volatilequalifier is used to inform the compiler that the value of the object can change in a way unknown to it. Consider for an example an IO register in input mode: its value can change unexpectedly and the compiler cannot assume its value didn’t change after it was read.For example:
or