ButterflyMP3

power.h

Go to the documentation of this file.
00001 
00037 #ifndef POWER_H
00038 #define POWER_H
00039 #include "types.h"
00040 /*
00041 * return accurate percentage from experimental data
00042 *
00043 *       mins    %       ADC     ADC     ~Voltage
00044 *       0       100     655     0x28f   4.2
00045 *       400     66      608     0x260   3.9     
00046 *       1050    12      572     0x23c   3.6
00047 *       1200    0       445     0x1BD   2.8
00048 */
00049 #define PWR_MAX_V               0x28f ///< 4.2V
00050 #define PWR_GOOD_V              0x260 ///< 3.85V
00051 #define PWR_LOW_V               0x23c ///< 3.6V average voltage
00052 #define PWR_MIN_V               0x1D9 ///< 3.0V
00053 #define PWR_ABS_MIN_V           0x1C0 ///< 2.8V absolute minimum allowed battery voltage
00054 
00055 volatile uint8  gPowerSaveTimer;        // used for sleep mode power down
00056 
00057 void    Power_Init(void);
00058 void    Power_idle(void);
00059 void    Power_save(void);
00060 void    Power_off(void);
00061 uint16  Power_check(void);
00062 uint16  Power_pcnt(uint16 voltage); // return power left as percent
00063 
00064 
00065 #endif
 All Files Functions Variables Typedefs Enumerations Enumerator Defines