PM_SetLCDPower

C Specification

#include <nitro/spi.h>
BOOL PM_SetLCDPower( PMLCDPower sw );
  

Arguments

sw LCD switch.

Return Values

Returns a value of TRUE if the attempt to turn ON the LCD is successful. Returns a value of FALSE if the attempt to turn ON the LCD fails. The failure occurs if an attempt is made to turn ON the LCD before 100 ms have elapsed since the LCD was turned OFF.

Description

This function switches the LCD switch. The sw argument is the LCD switch. This argument is a PMLCDPower enumerator type that can contain either one of the following values:

PM_LCD_POWER_ON Turns the LCD switch ON.
PM_LCD_POWER_OFF Turns the LCD switch OFF.

When you switch the LCD switch, the LED becomes ON regardless of whether the LED state, sw, is PM_LCD_POWER_ON or PM_LCD_POWER_OFF.

Because of a hardware restriction, you cannot turn the LCD ON unless 100 ms have passed since the LCD was turned OFF. If you attempt to switch the LCD ON before a sufficient amount of time has passed since the last time the LCD was turned OFF, nothing will occur and a value of FALSE will be returned. After a sufficient amount of time has passed and the LCD can be successfully turned on, a value of TRUE is returned. When you switch from the ON state to the OFF state, this restriction does not apply and the value that is returned is always TRUE.

Before you use this function, initialize the PM library by using the PM_Init() function. The PM_Init() function has to be called only once. Also, when you call OS_Init(), there is no need to call PM_Init() separately since it is called from within OS_Init().)

Internal Operation

The switching of the LCD switch is accessed in the GX_POWCNT register. This function operates the PMIC register PMIC_CTL to control the LED (power lamp).

See Also

PM_Init, PM_GetLCDPower

Revision History

08/17/2004 Changed the description of the LED state
08/07/2004 Initial version