UM10429
All information provided in this document is subject to legal disclaimers.
© NXP B.V. 2010. All rights reserved.
User manual
Rev. 1 — 20 October 2010
47 of 258
NXP Semiconductors
UM10429
Chapter 5: LPC1102 Power profiles
5.5.1.4 Code examples
The following examples illustrate some of the
set_power
features discussed above.
5.5.1.4.1
Invalid frequency (device maximum clock rate exceeded)
command[0] = 55;
command[1] = PWR_CPU_PERFORMANCE;
command[2] = 12;
(*rom)->pWRD->set_power(command, result);
The above setup would be used in a system running at 12 MHz attempting to switch to
55 MHz system clock, with a need for maximum CPU processing power. Since the
specified 55 MHz clock is above the 50 MHz maximum,
set_power
returns
PWR_INVALID_FREQ in
result[0]
without changing anything in the existing power setup.
5.5.1.4.2
An applicable power setup
command[0] = 24;
command[1] = PWR_CPU_EFFICIENCY;
command[2] = 12;
(*rom)->pWRD->set_power(command, result);
The above code specifies that an application running at a system clock of 12 MHz will
switch to 24 MHz with emphasis on efficiency.
set_power
returns PWR_CMD_SUCCESS
in
result[0]
after configuring the microcontroller’s internal power control features.