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_GetBattery</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 <nitro/spi.h></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%"><EM><STRONG>top</STRONG></EM></TD> 24<TD width="87%">Buffer where the state of the upper screen backlight is written.</TD> 25 </TR> 26 <TR> 27<TD><EM><STRONG>bottom</STRONG></EM></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 the backlight states and writes them to the addresses 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<TH>Saved Value</TH> 41<TH>Backlight State</TH> 42 </TR> 43 <TR> 44<TD><CODE>PM_BACKLIGHT_ON</CODE></TD> 45<TD>Backlight is ON.</TD> 46 </TR> 47 <TR> 48<TD><CODE>PM_BACKLIGHT_OFF</CODE></TD> 49<TD>Backlight is OFF.</TD> 50 </TR> 51 </TBODY> 52</TABLE> 53<H2>Description</H2> 54<P>Checks the state of the backlight.</P> 55<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 there. If you specify <CODE>NULL</CODE> for a pointer, this function does not write the state of the corresponding backlight.</P> 56<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.</P> 57<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> 58<P><BR> <BR> <B>About <CODE>PM_RESULT_BUSY</CODE></B></P> 59<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 dispatched 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, and this function returns <CODE>PM_RESULT_BUSY</CODE>. (In this case, the determination is made before notification is sent to the ARM7.)</P> 60<P>Accordingly, if you want to ensure that this function succeeds, make it loop until it succeeds as shown below. (This example does not take into account mistakes such as wrong arguments.)</P> 61<BLOCKQUOTE style="background-color:#ffffcc"><B>Example</B><BR> <CODE>while( PM_GetBackLight( ... ) != PM_RESULT_SUCCESS )<BR> {<BR> }</CODE></BLOCKQUOTE> 62<H2>Internal Operation</H2> 63<P>This function reads the value of the PMIC register PMIC_CTL.</P> 64<H2>See Also</H2> 65<P><a href="PM_Init.html"><code>PM_Init</code></a><BR><a href="PM_SetBackLight.html"><code>PMSetBackLight</code></a></P> 66<H2>Revision History</H2> 67<P>2009/06/03 Removed a description of the <CODE>PM_Init</CODE> function (because <CODE>OS_Init</CODE> is now required). <BR>2008/12/05 Added a cautionary note concerning use when interrupts are prohibited. <BR>2008/08/23 Mentioned <CODE>PM_RESULT_BUSY</CODE>. <BR>2005/07/07 Mentioned the <CODE>PM_RESULT_ERROR</CODE> return value. <BR>2004/08/09 Initial version.</P> 68<hr><p>CONFIDENTIAL</p></body> 69</HTML>