1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<HTML> 3<HEAD> 4<META http-equiv="Content-Type" content="text/html; charset=windows-1252"> 5<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 7.0.1.0 for Windows"> 6<META http-equiv="Content-Style-Type" content="text/css"> 7<TITLE>PM_SetLCDPower</TITLE> 8<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css"> 9</HEAD> 10<BODY> 11<H1 align="left">PM_SetLCDPower <IMG src="../../image/NTR.gif" width="24" height="12" border="0" align="middle"><IMG src="../../image/TWL.gif" width="24" height="12" border="0" align="middle"></H1> 12<H2>Syntax</H2> 13<DL> 14 <DD> 15 <PRE><CODE>#include <nitro/spi.h></CODE></PRE> 16 <PRE><CODE>BOOL PM_SetLCDPower( PMLCDPower sw ); 17 </CODE></PRE> 18</DL> 19<H2>Arguments</H2> 20<TABLE border="1" width="100%"> 21 <TBODY> 22 <TR> 23<TD width="13%"><SPAN class="argument">sw</SPAN></TD> 24<TD width="87%">LCD switch.</TD> 25 </TR> 26 </TBODY> 27</TABLE> 28<H2>Return Values</H2> 29<P>Returns <CODE>TRUE</CODE> if successful.</P> 30<P>Returns <CODE>FALSE</CODE> 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.</P> 31<H2>Description</H2> 32<P>Toggles the LCD switch.</P> 33<P>The <SPAN class="argument">sw</SPAN> argument is the LCD switch. This argument is a <code>PMLCDPower</code> enumerator type that can contain either one of the following values. 34</P> 35<TABLE border="1"> 36 <TBODY> 37 <TR> 38<TH>Value of <SPAN class="argument">sw</SPAN></TH> 39<TH>LCD Operation</TH> 40 </TR> 41 <TR> 42<TD><CODE>PM_LCD_POWER_ON</CODE></TD> 43<TD>Turns the LCD switch ON.</TD> 44 </TR> 45 <TR> 46<TD><CODE>PM_LCD_POWER_OFF</CODE></TD> 47<TD>Turns the LCD switch OFF.</TD> 48 </TR> 49 </TBODY> 50</TABLE> 51<P>Because of hardware restrictions, you cannot turn ON the LCD until at least approximately 100 ms have passed since it 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 happens, and this function returns <CODE>FALSE</CODE>. After a sufficient amount of time has passed and the LCD can be successfully turned ON, this function returns <CODE>TRUE</CODE>. Note that this restriction does not apply when going from ON to OFF. This function always returns <CODE>TRUE</CODE>.<br><br> The <a href="../../gx/gx/GX_DispOff.html"><CODE>GX_DispOff</CODE></a> function must be called in advance when <CODE>PM_LCD_POWER_OFF</CODE> is specified as the <SPAN class="argument">sw</SPAN> argument and the LCD is switched OFF. If the <a href="../../gx/gx/GX_DispOff.html"><CODE>GX_DispOff</CODE></a> function is not called beforehand in this function, it is called automatically. Note, however, that a wait time equal to two V-Blanks occurs.<br>See <B>Interval After the Screen Is Turned OFF by the GX_DispOff Function</B>.<br><font color="red">For this reason, note that the <a href="../../gx/gx/GX_DispOn.html"><CODE>GX_DispOn</CODE></a> function must be called separately when setting <CODE>LCD ON</CODE> after <CODE>LCD OFF</CODE>.</font> 52</P> 53<P>You must call the <a href="../../gx/gx/GX_DispOff.html"><CODE>GX_DispOff</CODE></a> function before turning the LCD switch off, but you do not need to call the <a href="../../gx/gx/GXS_DispOff.html"><CODE>GXS_DispOff</CODE></a> function. (However, applications will probably turn the upper and lower screen displays on or off at the same time.)</P> 54<P>This function internally calls several PM functions. It continues calling these PM functions until they succeed. If another device is occupying the SPI and it is BUSY for a long time, there is sometimes a delay in returning control from this function.</P> 55 56<P><FONT color="#ff0000">This function can be used from an interrupt handler. This function cannot be used in interrupt-prohibited states other than interrupt handlers.</FONT></P> 57<H3>Interval After the Screen Is Turned OFF by the GX_DispOff Function</H3> 58<P>If the time from turning the display OFF (using the <A href="../../gx/gx/GX_DispOff.html"><CODE>GX_DispOff</CODE></A> function) to the point where this function cuts power off to the LCD module (using <CODE>PM_SetLCDPower( PM_LCD_POWER_OFF )</CODE>) is two frames or less (if the time is not exactly two V-Blanks), specifications call for a wait of two V-Blanks to prevent ghosting the next time the display is turned OFF.<br>Therefore, be sure to note the point that the system waits exactly two V-Blanks if the application itself does not call the <A href="../../gx/gx/GX_DispOff.html"><CODE>GX_DispOff</CODE></A> function before calling this function. 59</P> 60<H3>Regarding Sound When the LCD Is OFF</H3> 61<P>When the LCD is turned OFF, the power supply to the sound amp also turns OFF, so sound no longer emits from the speakers. However, if headphones were inserted while the LCD was ON and the LCD is then turned OFF, it is possible to hear sound from the headphones. Note that on TWL, headphone audio output is guaranteed even if the headphone jack is inserted while the LCD is OFF. This is not true for NITRO. (For details, see the notes for each type of power control in the programming guidelines.)</P> 62<H2>Internal Operation</H2> 63<P>Accesses the <CODE>GX_POWCNT</CODE> register to toggle the LCD switch.</P> 64<H2>See Also</H2> 65<P><a href="PM_Init.html"><code>PM_Init</code></a><BR> <a href="PM_GetLCDPower.html"><code>PM_GetLCDPower</code></a></P> 66<H2>Revision History</H2> 67<P>2009/07/08 Corrected a mistake related to the <A href="../../gx/gx/GXS_DispOff.html"><CODE>GXS_DispOff</CODE></A> function.<br> 2009/06/03 Removed a description of the <CODE>PM_Init</CODE> function (because the <CODE>OS_Init</CODE> function is now required).<BR> 2009/04/13 Added description of the <A href="../../gx/gx/GXS_DispOff.html"><CODE>GXS_DispOff</CODE></A> function.<BR> 2009/02/03 Added a description of processing when the LCD is switched from OFF to ON.<br> 2009/01/16 Revised description of calling the <a href="../../gx/gx/GX_DispOff.html"><CODE>GX_DispOff</CODE></a> function.<br> 2009/01/13 Revised the text to say that the <A href="../../gx/gx/GX_DispOff.html"><CODE>GX_DispOff</CODE></A> function should be called before turning the LCD is turned OFF.<br> 2008/12/05 Added a note related to use when interrupts are prohibited.<BR> 2008/11/02 Added a note about sound.<BR> 2008/08/23 Clarified the possibility of delays while BUSY.<BR> 2008/06/25 Added a description of the time interval with the <A href="../../gx/gx/GX_DispOff.html"><CODE>GX_DispOff</CODE></A> function.<BR> 2008/03/18 Deleted a description of the LED state.<BR> 2004/09/17 Changed a description of the LED state.<BR> 2004/08/07 Initial version.</P> 68<hr><p>CONFIDENTIAL</p></body> 69</HTML>