Content originally posted in LPCWare by frame on Tue Aug 14 11:39:13 MST 2012
Having turned to develop SW for microcontrollers just recently (i.e. a few years ago), I understand the confusion behind this question.
In C/C++ coding for a 'real' OS, fixed addresses are almost taboo. Interrupts are hidden in the OS, "while (1)" loops are virtually unknown,
and there are plenty of comfortable library functions.
To the things you mentioned:
Quote:
LPC_12C->STAT
LPC_12C->CONCLR
LPC_12C->CONSET
LPC_IOCON
LPC_SYSCON
It is a common 'trick' in embedded development to define a struct exactly matching the register layout of a peripheral,
and creating an instance of this struct at the actual address of the peripheral. This way, you can have the compiler
and linker fiddle with this addresses, while having nice looking and portable source code.
The header file defining this structs are usually supplied by the silicon vendor. In this case, ARM and NXP.
Note that all those structured register definitions are declared 'volatile'. That keyword used rather frequently in embedded SW.
To come to the point:
In addition to the CMSIS files and the user manual, I suggest to grab a tutorial to embedded C programming.
There are plenty around on the net. And it has not necessarily to be one for ARM Cortex controllers.