Microcontroller Initialization
Submitted by dmitry on Tue, 01/15/2013 - 12:09am
We will use SystemInit() and CGU_Init() function to initialize the LPC4300 microcontroller and its Clock Generation Unit (CGU) respectively. These functions are defined in system_LPC43xx.c and lpc43xx_cgu.c files, so let's add them to our project.
Use Add Files dialog box (menu [Project | Add Files...]) to add the files from the following locations:
lpc43xx\Core\Device\NXP\LPC43xx\Source\Templates\system_LPC43xx.clpc43xx\Core\Device\NXP\LPC43xx\Include\system_LPC43xx.hlpc43xx\Drivers\source\lpc43xx_cgu.clpc43xx\Drivers\include\lpc43xx_cgu.hlpc43xx\Drivers\source\lpc43xx_scu.clpc43xx\Drivers\include\lpc43xx_scu.h
The last two files contains the scu_pinmux() function, which is called from CGU_Init().
Now our project should contain 8 files:

Let's open our main.c file and add the following code:
#include "LPC43xx.h"
#include "lpc43xx_cgu.h"
#include "system_LPC43xx.h"
int main()
{
SystemInit();
CGU_Init();
return 0;
}