PM_SetBatteryLowCallback

Syntax

#include <twl/spi.h>
void PM_SetBatteryLowCallback(
     PMBatteryLowCallback callback,
     void* arg );

typedef void (*PMGenCallback)(void*);
#define PMBatteryLowCallback PMGenCallback

Arguments

callback Callback function.
arg Callback argument.

Return Values

None.

Description

Sets the callback that is invoked when a decrease in the remaining battery life is detected.

The ARM7 detects a drop in the remaining battery life and notifies the ARM9. Next, the callback function is invoked. At this time, arg is set as its argument value.

The callback set here will be called from the interrupt handler, so it should perform all necessary processing and promptly exit.

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.

Note: As explained in About Callbacks for the PM_GetBatteryLevel function, at times the value will change in discrete steps. In other words, the condition set for invoking the callback could be skipped over.

See Also

PM_GetBattery
PM_GetBatteryLevel
PM_GetACAdapter

Revision History

2008/02/07 Initial version.


CONFIDENTIAL