PM_GetBattery


C Specification

#include <nitro/spi.h>

u32 PM_GetBattery( PMBattery* batteryBuf );

Description

This function checks the remaining battery capacity of the battery pack.

The batteryBuf argument is a pointer to the PMBattery type, and the results are stored here.

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, initialize the PM library by using the PM_Init() function. The PM_Init() function has to be called only once.

The OS_Init() function is called from within the PM_Init() function. If you need to call the OS_Init() function, you have to call the PM_Init() function only once. There is no need for the OS_Init() function to be called separately.

Internal Operation

Reads the PMIC register PMIC_STAT value.

This function detects whether the voltage of the PMIC VDET terminal is above or below the threshold.

Arguments

batteryBuf buffer that writes the remaining battery capacity of the battery pack

Return Values

The PM_RESULT_SUCCESS return value indicates that the execution of the command has succeeded.

The PM_RESULT_ERROR return value indicates that an error has occurred with the ARM7 processor.

This function gets and saves whether the detected voltage of the VDET terminal in the address that is indicated by the batteryBuf argument is higher or lower than the threshold.

This argument enables you to know the approximate remaining battery capacity of the battery pack. The stored values are as follows:

These values correspond to the color (green or red) of the power lamp on the NITRO unit.

Note: Even when the remaining battery capacity is low and the power lamp is red, the lamp may blink green when the unit is in the sleep mode.

See Also

PM_Init

Revision History

08/09/2004 Initial version