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_SetBatteryLowCallback</TITLE>
8<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css">
9</HEAD>
10<BODY>
11<H1 align="left">PM_SetBatteryLowCallback <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;twl/spi.h&gt;</CODE></PRE>
16  <PRE><CODE>void PM_SetBatteryLowCallback(
17     PMBatteryLowCallback callback,
18     void* arg );
19
20typedef void (*PMGenCallback)(void*);
21#define PMBatteryLowCallback PMGenCallback</CODE></PRE>
22</DL>
23<H2>Arguments</H2>
24<TABLE border="1" width="100%">
25  <TBODY>
26    <TR>
27<TD><CODE>callback</CODE></TD>
28<TD>Callback function.</TD>
29    </TR>
30    <TR>
31<TD><CODE>arg</CODE></TD>
32<TD>Callback argument.</TD>
33    </TR>
34  </TBODY>
35</TABLE>
36<H2>Return Values</H2>
37<P>None.</P>
38<H2>Description</H2>
39<P>Sets the callback that is invoked when a decrease in the remaining battery life is detected.</P>
40<P>The ARM7 detects a drop in the remaining battery life and notifies the ARM9. Next, the <CODE>callback</CODE> function is invoked. At this time, <CODE>arg</CODE> is set as its argument value.</P>
41<P>The callback set here will be called from the interrupt handler, so it should perform all necessary processing and promptly exit.</P>
42<P>Even if the remaining battery life recovers (the battery is charged) after this callback has been invoked, this callback will be invoked again when a drop in the remaining battery life is again detected.</P>
43<P><B>Note:</B> As explained in <B>About Callbacks</B> for the <A href="PM_GetBatteryLevel.html"><CODE>PM_GetBatteryLevel</CODE></A> function, at times the value will change in discrete steps. In other words, the condition set for invoking the callback could be skipped over.</P>
44<H2>See Also</H2>
45<P><A href="PM_GetBattery.html"><CODE>PM_GetBattery</CODE></A><BR> <A href="PM_GetBatteryLevel.html"><CODE>PM_GetBatteryLevel</CODE></A><BR> <A href="PM_GetACAdapter.html"><CODE>PM_GetACAdapter</CODE></A></P>
46<H2>Revision History</H2>
47<P>2008/02/07 Initial version.</P>
48<hr><p>CONFIDENTIAL</p></body>
49</HTML>