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_GetBackLight</TITLE>
8<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css">
9</HEAD>
10<BODY>
11<H1 align="left">PM_GetBackLight <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 &lt;nitro/spi.h&gt;</CODE></PRE>
16  <PRE><CODE>u32 PM_GetBackLight( PMBackLightSwitch* top, PMBackLightSwitch* bottom );
17</CODE></PRE>
18</DL>
19<H2>Arguments</H2>
20<TABLE border="1" width="100%">
21  <TBODY>
22    <TR>
23<TD width="20%"><SPAN class="argument">top</SPAN></TD>
24<TD width="87%">Buffer where the state of the upper screen backlight is written.</TD>
25    </TR>
26    <TR>
27<TD><SPAN class="argument">bottom</SPAN></TD>
28<TD>Buffer where the state of the lower screen backlight is written.</TD>
29    </TR>
30  </TBODY>
31</TABLE>
32<H2>Return Values</H2>
33<P>If <CODE>PM_RESULT_SUCCESS</CODE>, the command ran successfully.</P>
34<P>If <CODE>PM_RESULT_BUSY</CODE>, the SPI was occupied by other processing and unable to process this function.</P>
35
36<P>This function gets and writes the backlight state in the address indicated by <SPAN class="argument">top</SPAN> and <SPAN class="argument">bottom</SPAN>. The saved values are as follows.</P>
37<TABLE border="1">
38  <TBODY>
39    <TR>
40<TD><CODE>PM_BACKLIGHT_ON</CODE></TD>
41<TD>Backlight is ON.</TD>
42    </TR>
43    <TR>
44<TD><CODE>PM_BACKLIGHT_OFF</CODE></TD>
45<TD>Backlight is OFF.</TD>
46    </TR>
47  </TBODY>
48</TABLE>
49<H2>Description</H2>
50<P>Checks the state of the backlight.</P>
51<P>The <SPAN class="argument">top</SPAN> and <SPAN class="argument">bottom</SPAN> arguments are pointers to the <code>PMBackLightSwitch</code> type. The results of this function are stored here. When a null pointer is specified, it does not write the backlight state that corresponds to that display.</P>
52<P>This function uses PXI to send the command that performs the corresponding operation in the ARM7 processor. The ARM7 side that receives that command is executed by operating the PMIC. 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>
53<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>
54<P> <B>About <CODE>PM_RESULT_BUSY</CODE></B></P>
55<P>The SPI is used for various other processes besides power management. If you call this function while another process is using it, this function sends a command to the ARM7. There, the SPI is determined to be BUSY, and <CODE>PM_RESULT_BUSY</CODE> is sent to the ARM9 without actually processing this function. Likewise, if you call this function while another PM process is running, that fact is determined on the ARM9 side and this function returns <CODE>PM_RESULT_BUSY</CODE>. (In this case, the determination is made before notification is sent to the ARM7.)</P>
56<P>Accordingly, if you want to make certain that this function will succeed, make it loop until it succeeds as shown below. (This example does not take into account mistakes such as wrong arguments.)</P>
57<BLOCKQUOTE style="background-color:#ffffcc"><B>Example</B><BR> <CODE>while( PM_GetBackLight( ... ) != PM_RESULT_SUCCESS )<BR> {<BR> }</CODE></BLOCKQUOTE>
58<H2>Internal Operation</H2>
59<P>This function reads the <CODE>PMIC_CTL</CODE> value of the PMIC register.</P>
60<H2>See Also</H2>
61<P><a href="PM_Init.html"><code>PM_Init</code></a><BR> <a href="PM_SetBackLight.html"><code>PMSetBackLight</code></a></P>
62<H2>Revision History</H2>
63<P>2008/12/05 Added note about use in interrupt-prohibited states. <BR>2008/08/23 Made reference to <CODE>PM_RESULT_BUSY</CODE>. <BR>2005/07/07 Added a reference to the <CODE>PM_RESULT_ERROR</CODE> return value.</CODE>. <BR>2004/08/09 Initial version.</P>
64<hr><p>CONFIDENTIAL</p></body>
65</HTML>