Power profiles API Power control

See Invalid frequency and An applicable power set-up for examples of the power control API.

Invalid frequency (device maximum clock rate exceeded)

command[0] = 30;-->
command[1] = PWR_CPU_PERFORMANCE;-->
command[2] = 40;-->
LPC_PWRD_API->set_power(command, result);-->

The above setup would be used in a system running at the main and system clock of 30 MHz, with a need for maximum CPU processing power. Since the specified 40 MHz clock is above the 30 MHz maximum, set_power returns PWR_INVALID_FREQ in result[0] without changing anything in the existing power setup.

An applicable power setup

command[0] = 24;-->
command[1] = PWR_CPU_EFFICIENCY;-->
command[2] = 24;-->
LPC_PWRD_API->set_power(command, result);-->

The above code specifies that an application is running at the main and system clock of 24 MHz with emphasis on efficiency. set_power returns PWR_CMD_SUCCESS in result[0] after configuring the microcontroller’s internal power control features.


-->