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> When switching the LCD OFF using the <CODE>PM_SetLCDPOwer(PM_LCD_POWER_OFF)</CODE> function, you must call the <a href="../../gx/gx/GX_DispOff.html"><CODE>GX_DispOff</CODE></a> function first. 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 internally 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 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<P>Before you use this function, use the <A href="PM_Init.html"><CODE>PM_Init</CODE></A> function to initialize the PM library. (The <code>PM_Init</code> function has to be called only once. Also, when you call the <a href="../../os/init/OS_Init.html"><code>OS_Init</code></a> function, there is no need to call the <a href="PM_Init.html"><code>PM_Init</code></a> function separately because it is called from inside the <code>OS_Init</code> function.)</P> 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> 682009/02/03 Added a description of processing when switching from <CODE>LCD OFF</CODE> to <CODE>LCD ON</CODE>.<br> 2009/01/16 Revised the description of calling the <a href="../../gx/gx/GX_DispOff.html"><CODE>GX_DispOff</CODE></a> function.<br> 2009/01/13 Revised specifications so that the <A href="../../gx/gx/GX_DispOff.html"><CODE>GX_DispOff</CODE></A> function is called before the LCD is turned off.<br> 2008/12/05 Added a note on use during interrupt-prohibited states.<BR> 2008/11/02 Added a note about sound.<BR> 2008/08/23 Clarified the possibility of delay by <CODE>BUSY</CODE>.<BR> 2008/06/25 Added a description of the time interval versus the <A href="../../gx/gx/GX_DispOff.html"><CODE>GX_DispOff</CODE></A> function.<BR> 2008/03/18 Deleted a description of LED status.<BR> 2004/09/17 Changed the description of LED status.<BR> 2004/08/07 Initial version.</P> 69<hr><p>CONFIDENTIAL</p></body> 70</HTML>