| LPCOpen Platform v1.03 LPCOpen Platform for NXP LPC Microcontrollers

- Main Page
- Modules
- Data Structures
- Files
- Related Pages

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
LPC1857 and LPC4357 Keil MCB board System Init code
LPC1857 and LPC4357 Keil MCB board support functions

## Detailed Description

The System initialization code is called prior to the application and initializes the board for run-time operation. Board initialization for the Keil MCB boards includes clock setup, default pin muxing, and memory configuration.

With the exception of stack space, no RW memory is used for this call.

LPC1857 and LPC4357 Keil MCB setup
Clocking:
All base clocks enabled by default (Save power by disabling un-needed clocks)
CPU PLL set to maximum clock frequency (as defined by MAX_CLOCK_FREQ value)
SPIFI FLASH clock setup for fastest speed
CGU Dividers A, C, D and E are used for the LCD, USB, and SPIFI. Pin muxing:
Sets up various pin mux functions for the board (Ethernet, LEDs, etc.)
Sets up the external memory controller signals
Memory:
Sets up DRAM and NOR FLASH.
Note that this code is not for use with booting with a device on the external EMC bus (ie, NOR FLASH). If booting from external FLASH on the EMC bus is used, the chip's external address bus must be setup prior to accessing any address beyond the first 16K.

## Data Structures
struct | PINMUX_GRP_T
struct | CLK_BASE_STATES

## Macros
#define | CLK0_DELAY 7

## Functions
STATIC void | SystemSetupClocking (void)
STATIC void | SystemSetupMuxing (void)
STATIC void | SystemSetupMemory (void)
void | SystemInit (void)
| Setup the system SystemInit() is called prior to the application and sets up system clocking, memory, and any resources needed prior to the application starting.

## Variables
STATIC struct CLK_BASE_STATES | InitClkStates []
STATIC const PINMUX_GRP_T | spifipinmuxing []
static const CGU_USBAUDIO_PLL_SETUP_T | usbPLLSetup
STATIC const PINMUX_GRP_T | pinmuxing []
STATIC const PINMUX_GRP_T | pinclockmuxing []
STATIC const IP_EMC_DYN_CONFIG_T | MT48LC4M32_config
STATIC const IP_EMC_STATIC_CONFIG_T | S29GL64N90_config

## Macro Definition Documentation

#define CLK0_DELAY 7

Definition at line 431 of file sysinit_keil_mcb_18574357.c.

## Function Documentation

void SystemInit | ( | void |  | ) |

Setup the system SystemInit() is called prior to the application and sets up system clocking, memory, and any resources needed prior to the application starting.

Setup the system.

Returns
  none

Definition at line 523 of file sysinit_keil_mcb_18574357.c.

STATIC void SystemSetupClocking | ( | void |  | ) |

Definition at line 133 of file sysinit_keil_mcb_18574357.c.

STATIC void SystemSetupMemory | ( | void |  | ) |

Definition at line 488 of file sysinit_keil_mcb_18574357.c.

STATIC void SystemSetupMuxing | ( | void |  | ) |

Definition at line 415 of file sysinit_keil_mcb_18574357.c.

## Variable Documentation

STATIC struct CLK_BASE_STATES InitClkStates[]

Definition at line 73 of file sysinit_keil_mcb_18574357.c.

STATIC const IP_EMC_DYN_CONFIG_T MT48LC4M32_config

Definition at line 434 of file sysinit_keil_mcb_18574357.c.

STATIC const PINMUX_GRP_T pinclockmuxing[]

Initial value:
= {
{0, 0, (SCU_MODE_MODE_PULLUP | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_HIGHSPEEDSLEW_EN | SCU_MODE_FUNC0)},
{0, 1, (SCU_MODE_MODE_PULLUP | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_HIGHSPEEDSLEW_EN | SCU_MODE_FUNC0)},
{0, 2, (SCU_MODE_MODE_PULLUP | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_HIGHSPEEDSLEW_EN | SCU_MODE_FUNC0)},
{0, 3, (SCU_MODE_MODE_PULLUP | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_HIGHSPEEDSLEW_EN | SCU_MODE_FUNC0)},
}

Definition at line 407 of file sysinit_keil_mcb_18574357.c.

STATIC const PINMUX_GRP_T pinmuxing[]

Definition at line 196 of file sysinit_keil_mcb_18574357.c.

STATIC const IP_EMC_STATIC_CONFIG_T S29GL64N90_config

Initial value:
= {
0,
EMC_STATIC_CONFIG_MEM_WIDTH_32 |
EMC_STATIC_CONFIG_CS_POL_ACTIVE_LOW |
EMC_STATIC_CONFIG_BLS_HIGH ,
EMC_NANOSECOND(0),
EMC_NANOSECOND(65),
EMC_NANOSECOND(90),
EMC_NANOSECOND(90),
EMC_NANOSECOND(35),
}

Definition at line 472 of file sysinit_keil_mcb_18574357.c.

STATIC const PINMUX_GRP_T spifipinmuxing[]

Initial value:
= {
{0x3, 3, (SCU_PINIO_FAST | SCU_MODE_FUNC3)},
{0x3, 4, (SCU_PINIO_FAST | SCU_MODE_FUNC3)},
{0x3, 5, (SCU_PINIO_FAST | SCU_MODE_FUNC3)},
{0x3, 6, (SCU_PINIO_FAST | SCU_MODE_FUNC3)},
{0x3, 7, (SCU_PINIO_FAST | SCU_MODE_FUNC3)},
{0x3, 8, (SCU_PINIO_FAST | SCU_MODE_FUNC3)}
}

Definition at line 107 of file sysinit_keil_mcb_18574357.c.

const CGU_USBAUDIO_PLL_SETUP_T usbPLLSetup
| static

Initial value:
= {
0x0000601D,
0x06167FFA,
0x00000000,
0x00000000
}

Definition at line 117 of file sysinit_keil_mcb_18574357.c.