00001 /* This file has been prepared for Doxygen automatic documentation generation.*/ 00032 #ifndef BATTERY_H 00033 #define BATTERY_H 00034 00035 00036 //****************************************************************************** 00037 // Defines for EEPROM reading 00038 //****************************************************************************** 00039 #define OWIBUS OWI_PIN_0 00040 00041 #define OW_NONE 0x00 00042 #define OW_DS2505 0x09 00043 00044 #define DS2505_MEM_READ 0xF0 00045 #define DS2505_STATUS_READ 0xAA 00046 #define DS2505_DATA_READ 0xC3 00047 00048 00049 //****************************************************************************** 00050 // RID-less charging (for BatteryStatusRefresh()) 00051 //****************************************************************************** 00052 //#define ALLOW_NO_RID //!< Use default battery data if no matching entry found. 00053 00054 #define DEF_BAT_CAPACITY 0 00055 #define DEF_BAT_CURRENT_MAX 0 00056 #define DEF_BAT_TIME_MAX 0 00057 00058 #define DEF_BAT_CURRENT_MIN 0 00059 00060 00061 00062 //****************************************************************************** 00063 // RID and NTC defines and struct declarations 00064 //****************************************************************************** 00065 #define RID_TABLE_SIZE 4 00066 #define NTC_TABLE_SIZE 20 00067 00069 struct RID_Lookup_struct { 00070 unsigned int Low; 00071 unsigned int High; 00072 unsigned int Resistance; 00073 unsigned int Capacity; 00074 unsigned int Icharge; 00075 unsigned int tCutOff; 00076 unsigned int ICutOff; 00077 }; 00078 typedef struct RID_Lookup_struct RID_Lookup_t; 00079 00084 struct NTC_Lookup_struct 00085 { 00086 unsigned int ADC; 00087 unsigned char ADCsteps; 00088 }; 00089 typedef struct NTC_Lookup_struct NTC_Lookup_t; 00090 00091 00092 //****************************************************************************** 00093 // Global variables 00094 //****************************************************************************** 00095 extern __eeprom Battery_t BattControl[]; 00096 extern Batteries_t BattData; 00097 extern __eeprom unsigned char BattEEPROM[][32]; 00098 extern unsigned char BattActive; 00099 00100 00101 //****************************************************************************** 00102 // Function prototypes 00103 //****************************************************************************** 00104 unsigned char BatteryCheck(void); 00105 unsigned char BatteryStatusRefresh(void); 00106 unsigned char BatteryDataRefresh(void); 00107 void EnableBattery(unsigned char); 00108 void DisableBatteries(void); 00109 unsigned char RIDLookUp(void); 00110 void NTCLookUp(void); 00111 00112 00113 #endif // BATTERY_H
1.5.2