The de facto standard way of declaring a writeable memory location in C is this:
#define REGISTER (*(volatile uint8_t*)0x10000)
where uint8_t
should correspond to the size of the contents at that memory location.
And then REGISTER = something;
writes to that memory location, just as if REGISTER was a variable.
It is important to use the volatile
keyword, to prevent optimization bugs and ensuring that reads of the location are always up to date.