LPCOpen Platform  v1.03
LPCOpen Platform for NXP LPC Microcontrollers
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
LPC18xx/43xx Power Management Controller example

Detailed Description

Example description
This example demonstrates the power states supported by PMC. The example demonstrates steps to go to low power states & wake up from the states.

UART needs to be setup prior to running the example as the example takes input from the UART console.

Special connection requirements

Build procedures:
LPC18xx/43xx example quickstart for Keil uVision4
LPC18xx/43xx example quickstart for IAR EWARM
LPC18xx/43xx example quickstart for Code Red Xpresso

Supported boards and board setup:
Hitex 1850 evaluation boards
Hitex 4350 evaluation boards
Keil 1857 evaluation boards
Keil 4357 evaluation boards
NGX 1830 Xplorer boards
NGX 4330 Xplorer boards

Submitting LPCOpen issues:
Community support for LPCOpen

Data Structures

struct  CLK_BASE_STATES
 

Macros

#define RTC_ALARM_TIME   5
 

Functions

static void PMC_Get_Wakeup_option (uint8_t *Wakeup_rtc)
 
static void PMC_Pre_SleepPowerDown (void)
 
static void PMC_Post_Wakeup (uint8_t buffer)
 
static void PMC_Evrt_Configure (CHIP_EVRT_SRC_T Evrt_Src)
 
static void PMC_PwrState_Handler (uint8_t buffer, uint8_t Wake_RTC)
 
void EVRT_IRQHandler (void)
 Event router interrupt handler.
 
int main (void)
 Main entry point.
 

Variables

static char menu []
 
static char menu1 []
 
static char menu2 [] = "PMC demo example terimnated \r\n"
 
static char menu3 [] = "\r\nPress 'C' or 'c' to start demo...\r\n"
 
static struct CLK_BASE_STATES InitClkStates []
 

Macro Definition Documentation

#define RTC_ALARM_TIME   5

RTC Alarm in seconds

Definition at line 80 of file app_pmc_states.c.

Function Documentation

void EVRT_IRQHandler ( void  )

Event router interrupt handler.

Returns
Nothing

Definition at line 445 of file app_pmc_states.c.

int main ( void  )

Main entry point.

Main program body.

Returns
Nothing

Definition at line 466 of file app_pmc_states.c.

static void PMC_Evrt_Configure ( CHIP_EVRT_SRC_T  Evrt_Src)
static

Event Router configure function

Definition at line 284 of file app_pmc_states.c.

static void PMC_Get_Wakeup_option ( uint8_t *  Wakeup_rtc)
static

Definition at line 147 of file app_pmc_states.c.

static void PMC_Post_Wakeup ( uint8_t  buffer)
static

Post wake up initialisation function

Definition at line 224 of file app_pmc_states.c.

static void PMC_Pre_SleepPowerDown ( void  )
static

Set IRC as source clock fo all the output clocks & power down before going to 'Deep Sleep'/'Power Down'/'Deep Power Down' modes

Definition at line 178 of file app_pmc_states.c.

static void PMC_PwrState_Handler ( uint8_t  buffer,
uint8_t  Wake_RTC 
)
static

Power State handler function

Definition at line 308 of file app_pmc_states.c.

Variable Documentation

struct CLK_BASE_STATES InitClkStates[]
static
Initial value:
= {
{CLK_BASE_SAFE, CLKIN_IRC, true, false},
{CLK_BASE_APB1, CLKIN_MAINPLL, true, false},
{CLK_BASE_APB3, CLKIN_MAINPLL, true, false},
{CLK_BASE_USB0, CLKIN_USBPLL, true, true},
{CLK_BASE_PHY_TX, CLKIN_ENET_TX, true, false},
{CLK_BASE_PHY_RX, CLKIN_ENET_RX, true, false},
{CLK_BASE_SDIO, CLKIN_MAINPLL, true, false},
{CLK_BASE_SSP0, CLKIN_MAINPLL, true, false},
{CLK_BASE_SSP1, CLKIN_MAINPLL, true, false},
{CLK_BASE_UART0, CLKIN_MAINPLL, true, false},
{CLK_BASE_UART1, CLKIN_MAINPLL, true, false},
{CLK_BASE_UART2, CLKIN_MAINPLL, true, false},
{CLK_BASE_UART3, CLKIN_MAINPLL, true, false},
{CLK_BASE_LCD, CLKIN_IDIVC, true, false},
{CLK_BASE_USB1, CLKIN_IDIVD, true, true},
}

Definition at line 109 of file app_pmc_states.c.

char menu[]
static
Initial value:
=
"\r\n==========================================================================\r\n"
"NXP Semiconductors LPC18xx/43xx MCU Power Management Controller example \r\n"
"=============================================================================\r\n"
"Select the power state test to be executed \r\n"
" - Sleep state & Wake up test : Press '1' to select \r\n"
" - Deep Sleep state & Wake up test : Press '2' to select \r\n"
" - Power down state & Wake up test : Press '3' to select \r\n"
" - Deep power down state & Wake up test : Press '4' to select \r\n"
" - Exit the demo : Press 'X' or 'x' to select \r\n"
"=============================================================================\r\n"

Definition at line 90 of file app_pmc_states.c.

char menu1[]
static
Initial value:
= "\r\nSelect the Wake up signal \r\n"
" - WAKEUP0 pin : Press 'W' or 'w' to select \r\n"
" - RTC Alarm : Press 'R' or 'r' to select \r\n"

Definition at line 101 of file app_pmc_states.c.

char menu2[] = "PMC demo example terimnated \r\n"
static

Definition at line 105 of file app_pmc_states.c.

char menu3[] = "\r\nPress 'C' or 'c' to start demo...\r\n"
static

Definition at line 106 of file app_pmc_states.c.