Hi,
Below is the snapshot from "syscon_8xx.h" file of lpcopen library. If you see, everywhere they have used '~'.
For example, take SYSAHBCLKDIV register in LPC812.
Here Bits <31:8> are reserved bits. We could have defined
#define SYSCTL_SYSAHBCLKDIV_RESERVED (0xffffff)
But why did LPCOpen use #define SYSCTL_SYSAHBCLKDIV_RESERVED (~0xff) instead ?
The '~' operator is a 'binary-negate' operator in C. The reserved bitmask would be 0xFFFFFF00 (and not 0xFFFFFF as you wrote). And ~0xFF will be exactly that 0xFFFFFF00. You could use both notations. I would prefer 0xFFFFFF00 too, but ~0xFF is shorter :-).
I hope this helps,
Erich