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_GetAmp</TITLE> 8<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css"> 9</HEAD> 10<BODY> 11<H1 align="left">PM_GetAmp <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_GetAmp( PMAmpSwitch* swBuf ); 17 </CODE></PRE> 18</DL> 19<H2>Arguments</H2> 20<TABLE border="1" width="100%"> 21 <TBODY> 22 <TR> 23<TD width="13%"><EM><STRONG>swBuf</STRONG></EM></TD> 24<TD width="87%">Buffer that saves the results of getting the amp switch setting.</TD> 25 </TR> 26 </TBODY> 27</TABLE> 28<H2>Return Values</H2> 29<P>If <CODE>PM_RESULT_SUCCESS</CODE>, the command was run successfully.</P> 30<P>If <CODE>PM_RESULT_BUSY</CODE>, the SPI was occupied by other processing and unable to process this function.</P> 31<H2>Description</H2> 32<P>Gets the current settings of the programmable gain amp switch.</P> 33<P>The value of the <CODE>PMAmpSwitch</CODE> enumerated type is saved in the <SPAN class="argument">swBuf</SPAN> argument. It can take any one of the following values.<BR> 34</P> 35<TABLE border="1"> 36 <TBODY> 37 <TR> 38<TH>Value stored in <SPAN class="argument">swBuf</SPAN></TH> 39<TH>Amp State</TH> 40 </TR> 41 <TR> 42<TD><CODE><CODE>PM_AMP_ON</CODE></CODE></TD> 43<TD>Amp is ON. </TD> 44 </TR> 45 <TR> 46<TD><CODE><CODE>PM_AMP_OFF</CODE></CODE></TD> 47<TD>Amp is OFF.</TD> 48 </TR> 49 </TBODY> 50</TABLE> 51<P>This function uses PXI to send a command to execute the operation in question on the ARM7 processor. Once it receives that command, the ARM7 executes it by manipulating the PMIC. Therefore, this function may not operate instantly after you call it.</P> 52<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> 53<P><BR> <BR> <B>About <CODE>PM_RESULT_BUSY</CODE></B></P> 54<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 notified 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> 55<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> 56<BLOCKQUOTE style="background-color:#ffffcc"><B>Example:</B><BR> <CODE>while( PM_GetAmp( ... ) != PM_RESULT_SUCCESS )<BR> {<BR> }</CODE></BLOCKQUOTE> 57 58<H2>Internal Operation</H2> 59<P>Reads the value of the PMIC register <code>OP_CTL</code>.</P> 60<H2>See Also</H2> 61<P><a href="PM_Init.html"><code>PM_Init</code></a><BR> <a href="PM_SetAmp.html"><code>PM_SetAmp*</code></a></P> 62<H2>Revision History</H2> 63<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> 64<hr><p>CONFIDENTIAL</p></body> 65</HTML>