battery.h File Reference


Detailed Description

Battery module C header file.

REVISION

Definition in file battery.h.

#include "../feature.h"
#include "../MESSAGE/message.h"

Include dependency graph for battery.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Data Structures

struct  batlevel
 Battery level structure definition. More...
struct  battery
 Battery data structure definition. More...

Typedefs

typedef batlevel st_BATLEVEL
 Battery level structure definition.
typedef battery st_BATTERY
 Battery data structure definition.

Functions

void BAT_low (void)
 Battery low hardware interrupt handle.
void BAT_main (void)
 Function serves as battery monitor task handle.
void BAT_calibrate (void)
 Basic functionality for calculating the current voltage based on battery chemistry and current average periods.
unsigned long BAT_deltaAvg (void)
 Return current battery average data.


Function Documentation

unsigned long BAT_deltaAvg void   ) 
 

Return current battery average data.

Returns:
Current battery average data in terms of time resolution.

Definition at line 285 of file BAT_main.c.

00286 {
00287     return ((UINT32)TIM_resolution*(UINT32)DeltaAvg);
00288 }

void BAT_main void   ) 
 

Function serves as battery monitor task handle.

This will update the battery structure accordingly and the results can be pulled from this structure.

Definition at line 206 of file BAT_main.c.

References battery::Flags, SBATLEVEL_UPDT, and SYS_plugSenseDet().

Referenced by KBD_main().

00207 {   
00208     SYS_plugSenseDet();
00209     BAT_stackassert(BAT_MAIN);
00210 
00211     // Now, there's really not reason to calculate the average and voltage
00212     // more than every 0.5 seconds.  Therefore, only calculate the voltage 
00213     // and ultimately update the display when bat_swi.c tells us to
00214     // (i.e. pDelta = &BatteryData.Delta[0];        
00215     if (pDelta == &Delta[0])
00216     {
00217         _batCalculate();
00218         if(SYS_HF_battery())
00219         {
00220             BatteryData.Flags |= BAT_HIDDENFEATURE;
00221             mMSG_send(sysMsgQ, SYS_MSG_ID, SBATLEVEL_UPDT, 0x1234, 0);
00222         }
00223         else if(BatteryData.Flags & BAT_HIDDENFEATURE)
00224         {
00225             BatteryData.Flags |= BAT_HIDDENFEATURE_EXIT;
00226             BatteryData.Flags &= ~BAT_HIDDENFEATURE;
00227         }
00228     }
00229         
00230     // Initiate another measurement
00231     OldTime = TIM;
00232     _setBatlevel(0);            // set battery level to input
00233 }

Here is the call graph for this function:


Generated on Wed Jan 19 01:12:48 2005 for neuros-firmware by  doxygen 1.3.9.1