
UM10800
All information provided in this document is subject to legal disclaimers.
© NXP Semiconductors N.V. 2016. All rights reserved.
User manual
Rev. 1.2 — 5 October 2016
391 of 487
NXP Semiconductors
UM10800
Chapter 26: LPC82x ROM API Power profiles
The following elements have to be defined in an application that uses the power profiles:
typedef struct _PWRD {
void (*set_pll)(unsigned int cmd[], unsigned int resp[]);
void (*set_power)(unsigned int cmd[], unsigned int resp[]);
} PWRD;
#define ROM_DRIVER_BASE (0x1FFF1FF8UL)
#define LPC_PWRD_API ((PWRD_API_T *) ((*(ROM_API_T * *) (ROM_DRIVER_BASE))->pPWRD))
See
for how to include the ROM driver structure.
26.5.1 set_pll
This routine sets up the system PLL according to the calling arguments. If the expected
clock can be obtained by simply dividing the system PLL input, set_pll bypasses the PLL
to lower system power consumption.
Remark:
Before this routine is invoked, the PLL clock source (IRC/system oscillator) must
be selected (
), the main clock source must be set to the input clock to the system
PLL (
). and the system/AHB clock divider must be set to 1 (
set_pll attempts to find a PLL setup that matches the calling parameters. Once a
combination of a feedback divider value (SYSPLLCTRL, M), a post divider ratio
(SYSPLLCTRL, P) and the system/AHB clock divider (SYSAHBCLKDIV) is found, set_pll
applies the selected values and switches the main clock source selection to the system
PLL clock out (if necessary).
The routine returns a result code that indicates if the system PLL was successfully set
(PLL_CMD_SUCCESS) or not (in which case the result code identifies what went wrong).
The current system frequency value is also returned. The application should use this
information to adjust other clocks in the device (the SSP, UART, and WDT clocks, and/or
the clock output).
The following definitions are needed when making set_pll power routine calls:
/* set_pll mode options */
Table 343. Power profile API calls
API call
Description
Reference
set_pll(command, result)
;
Power API set pll routine
set_power(command, result)
;
Power API set power routine
Table 344. set_pll routine
Routine
set_pll
Input
Param0:
system PLL input frequency (in kHz)
Param1:
expected system clock (in kHz)
Param2:
mode (CPU_FREQ_EQU, CPU_FREQ_LTE, CPU_FREQ_GTE,
CPU_FREQ_APPROX)
Param3:
system PLL lock time-out
Result
Result0:
PLL_CMD_SUCCESS | PLL_INVALID_FREQ | PLL_INVALID_MODE |
PLL_FREQ_NOT_FOUND | PLL_NOT_LOCKED
Result1:
system clock (in kHz)