- Main Page
- Data Structures
- Files

- File List
- Globals

# data_flash.h

Go to the documentation of this file.

    00001 //******************************************************************************
    00002 //THIS PROGRAM IS PROVIDED "AS IS". TI MAKES NO WARRANTIES OR
    00003 //REPRESENTATIONS, EITHER EXPRESS, IMPLIED OR STATUTORY,
    00004 //INCLUDING ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
    00005 //FOR A PARTICULAR PURPOSE, LACK OF VIRUSES, ACCURACY OR
    00006 //COMPLETENESS OF RESPONSES, RESULTS AND LACK OF NEGLIGENCE.
    00007 //TI DISCLAIMS ANY WARRANTY OF TITLE, QUIET ENJOYMENT, QUIET
    00008 //POSSESSION, AND NON-INFRINGEMENT OF ANY THIRD PARTY
    00009 //INTELLECTUAL PROPERTY RIGHTS WITH REGARD TO THE PROGRAM OR
    00010 //YOUR USE OF THE PROGRAM.
    00011 //
    00012 //IN NO EVENT SHALL TI BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
    00013 //CONSEQUENTIAL OR INDIRECT DAMAGES, HOWEVER CAUSED, ON ANY
    00014 //THEORY OF LIABILITY AND WHETHER OR NOT TI HAS BEEN ADVISED
    00015 //OF THE POSSIBILITY OF SUCH DAMAGES, ARISING IN ANY WAY OUT
    00016 //OF THIS AGREEMENT, THE PROGRAM, OR YOUR USE OF THE PROGRAM.
    00017 //EXCLUDED DAMAGES INCLUDE, BUT ARE NOT LIMITED TO, COST OF
    00018 //REMOVAL OR REINSTALLATION, COMPUTER TIME, LABOR COSTS, LOSS
    00019 //OF GOODWILL, LOSS OF PROFITS, LOSS OF SAVINGS, OR LOSS OF
    00020 //USE OR INTERRUPTION OF BUSINESS. IN NO EVENT WILL TI'S
    00021 //AGGREGATE LIABILITY UNDER THIS AGREEMENT OR ARISING OUT OF
    00022 //YOUR USE OF THE PROGRAM EXCEED FIVE HUNDRED DOLLARS
    00023 //(U.S.$500).
    00024 //
    00025 //Unless otherwise stated, the Program written and copyrighted
    00026 //by Texas Instruments is distributed as "freeware".  You may,
    00027 //only under TI's copyright in the Program, use and modify the
    00028 //Program without any charge or restriction.  You may
    00029 //distribute to third parties, provided that you transfer a
    00030 //copy of this license to the third party and the third party
    00031 //agrees to these terms by its first use of the Program. You
    00032 //must reproduce the copyright notice and any other legend of
    00033 //ownership on each copy or partial copy, of the Program.
    00034 //
    00035 //You acknowledge and agree that the Program contains
    00036 //copyrighted material, trade secrets and other TI proprietary
    00037 //information and is protected by copyright laws,
    00038 //international copyright treaties, and trade secret laws, as
    00039 //well as other intellectual property laws.  To protect TI's
    00040 //rights in the Program, you agree not to decompile, reverse
    00041 //engineer, disassemble or otherwise translate any object code
    00042 //versions of the Program to a human-readable form.  You agree
    00043 //that in no event will you alter, remove or destroy any
    00044 //copyright notice included in the Program.  TI reserves all
    00045 //rights not specifically granted under this license. Except
    00046 //as specifically provided herein, nothing in this agreement
    00047 //shall be construed as conferring by implication, estoppel,
    00048 //or otherwise, upon you, any license or other right under any
    00049 //TI patents, copyrights or trade secrets.
    00050 //
    00051 //You may not use the Program in non-TI devices.
    00052 //
    00053 //This software has been submitted to export control regulations
    00054 //The ECCN is EAR99
    00055 //*****************************************************************************
    00066 #ifndef DATA_FLASH_H
    00067 #define DATA_FLASH_H
    00068
    00069
    00070 //Battery pack definition
    00071 #define NUMBER_OF_BQ_DEVICES      3  //3 BQ76PL536 devices are connected
    00072 #define NUMBER_OF_CELLS           18 //MAX number of cells in the system
    00073 #define MAX_CELLS_NUMBER_IN_BQ    6  //MAX number of cells per BQ76PL536 device
    00074 #define CELL_BALANCING_EN         1  //set to 1 to enable cell balancing
    00075 #define ONE_MINUTE                     60
    00076
    00077 //Battery pack information and threshold values
    00078 #define dCOV_THRESHOLD                 3700  //COV_THRESHOLD           [mV]
    00079 #define dCOV_RECOVERY_THRESHOLD        3600  //COV_RECOVERY_THRESHOLD  [mV]
    00080 #define dCOV_TIME                      5 //20 //COV_TIME (max value 32) [100ms]
    00081 #define dCUV_THRESHOLD                 2000  //CUV_THRESHOLD           [mV]
    00082 #define dCUV_RECOVERY_THRESHOLD        2200  //CUV_RECOVERY_THRESHOLD  [mV]
    00083 #define dCUV_TIME                      5 //20 //CUV_TIME (max value 32) [100ms]
    00084
    00085 #define dPACK_OVER_TEMP1               50    //3 PACK_OVER_TEMP1   [st C]
    00086 #define dPACK_OT_TIME1                 2000  //PACK_OT_TIME1       [ms]
    00087 #define dPACK_OVER_TEMP2               50    //3 PACK_OVER_TEMP2   [st C]
    00088 #define dPACK_OT_TIME2                 2000  //PACK_OT_TIME2       [ms]
    00089
    00090 //PACK_END_OF_CHARGE_VOLTAGE   [mV]
    00091 #define dPACK_END_OF_CHARGE_VOLTAGE    (DWORD)dCOV_THRESHOLD*NUMBER_OF_CELLS
    00092 #define dCC_CV_QUAL_TIME               20    //CC_CV_QUAL_TIME              [s]
    00093 //PACK_END_OF_DISCHARGE_VOLTAGE[mV]
    00094 #define dPACK_END_OF_DISCHARGE_VOLTAGE (DWORD)dCUV_THRESHOLD*NUMBER_OF_CELLS
    00095 #define dEND_OF_DISCHARGE_QUAL_TIME    20    //END_OF_DISCHARGE_QUAL_TIME   [s]
    00096
    00097 #define dCHARGE_CURRENT                1100  //CHARGE_CURRENT               [mA]
    00098 #define dCHARGE_TAPER_CURRENT          300   //CHARGE_TAPER_CURRENT         [mA]
    00099 #define dCHARGE_TAPER_TIME             (DWORD)240*ONE_MINUTE//CHARGE_TAPER_TIME[s]
    00100 #define dMAX_CHARGE_TIME               (DWORD)200*ONE_MINUTE//MAX_CHARGE_TIME  [s]
    00101
    00102 //FULL_DISCHARGE_CLEAR_VOLTS   [mV]
    00103 #define dFULL_DISCHARGE_CLEAR_VOLTS    dPACK_END_OF_DISCHARGE_VOLTAGE
    00104 //FULL_CHARGE_CLEAR_VOLTS      [mV]
    00105 #define dFULL_CHARGE_CLEAR_VOLTS       dPACK_END_OF_CHARGE_VOLTAGE
    00106 #define dDELTA_CHARGE_V                300   //DELTA_CHARGE_V               [mv]
    00107 #define dCHARGE_DISCHARGE_TIME         (DWORD)5*ONE_MINUTE//CHARGE_DISCHARGE_TIME [s]
    00108 #define dDELTA_DISCHARGE_V             200   //DELTA_DISCHARGE_V            [mV]
    00109
    00110 #define dSOV_THRESHOLD                 4200  //SOV_THRESHOLD                [mV]
    00111 #define dSOV_RECOVERY_THRESHOLD        3800  //SOV_RECOVERY_THRESHOLD       [mV]
    00112 #define dSOV_TIME                      3000  //SOV_TIME                     [ms]
    00113
    00114 #define dCELL_IMBALANCE_FAIL_THRESHOLD 500   //CELL_IMBALANCE_FAIL_THRESHOLD[mV]
    00115 #define dCELL_IMBALANCE_FAIL_TIME      (DWORD)120*ONE_MINUTE//CELL_IMBALANCE_FAIL_TIME[s]
    00116 #define dBALANCE_TIME                  (DWORD)1*ONE_MINUTE    //BALANCE_TIME A.K.A CB_TIME[s]
    00117 #define dBALANCE_VOLTS_THRESHOLD       50    //BALANCE_VOLTS_THRESHOLD      [mV]
    00118 #define dMIN_BALANCE_VOLTS             dCUV_RECOVERY_THRESHOLD //MIN_BALANCE_VOLTS[mV]
    00119 #define dMAX_BALANCE_TIME              (DWORD)120*ONE_MINUTE//MAX_BALANCE_TIME[s]
    00120
    00121
    00122
    00127 //definition of the Parameters structure
    00128 typedef enum PARAM_ID
    00129 {
    00130   /*Voltage*/
    00131   COV_THRESHOLD, //COV_THRESHOLD = 0,
    00132   COV_RECOVERY_THRESHOLD,
    00133   COV_TIME,
    00134   CUV_THRESHOLD,
    00135   CUV_RECOVERY_THRESHOLD,
    00136   CUV_TIME,
    00137
    00138   /*Temperature*/
    00139   PACK_OVER_TEMP1,
    00140   PACK_OT_TIME1,
    00141   PACK_OVER_TEMP2,
    00142   PACK_OT_TIME2,
    00143
    00144   /*Charge and Discharge*/
    00145   PACK_END_OF_CHARGE_VOLTAGE,
    00146   CC_CV_QUAL_TIME,
    00147   PACK_END_OF_DISCHARGE_VOLTAGE,
    00148   END_OF_DISCHARGE_QUAL_TIME,
    00149   CHARGE_CURRENT,
    00150   CHARGE_TAPER_CURRENT,
    00151   CHARGE_TAPER_TIME,
    00152   MAX_CHARGE_TIME,
    00153   FULL_DISCHARGE_CLEAR_VOLTS,
    00154   FULL_CHARGE_CLEAR_VOLTS,
    00155   DELTA_CHARGE_V,
    00156   CHARGE_DISCHARGE_TIME,
    00157   DELTA_DISCHARGE_V,
    00158
    00159   /*Safety*/
    00160   SOV_THRESHOLD,
    00161   SOV_RECOVERY_THRESHOLD,
    00162   SOV_TIME,
    00163
    00164   /*Balancing*/
    00165   CELL_IMBALANCE_FAIL_THRESHOLD,
    00166   CELL_IMBALANCE_FAIL_TIME,
    00167   BALANCE_TIME,
    00168   BALANCE_VOLTS_THRESHOLD,
    00169   MIN_BALANCE_VOLTS,
    00170   MAX_BALANCE_TIME
    00171
    00172 } param_id_t;
    00173
    00174
    00179 extern unsigned short get_u16_value(param_id_t param_id);
    00180 extern unsigned long get_u32_value(param_id_t param_id);
    00181
    00182 #endif
    00183
    00184 /*EOF*/