⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lcc_cfg.c

📁 是一个手机功能的模拟程序
💻 C
字号:
//TISH040218

T_PWR_CFG_BLOCK   pwr_cfg_init =
{
    // Corresponds to /pwr/i2v.cal and /pwr/vbat.cal
   {// T_PWR_CAL_BLOCK structure             // Calibration matrix
       {//T_PWR_I2V_CAL_BLOCK structure
       1,  //uint16   alfa_num;     // Slope numerator
       1,  //uint16   alfa_denom;   // Slope denominator
       0   //int16    beta;         // Offset
        },
    
        {//T_PWR_VBAT_CAL_BLOCK structure
       20,  //uint16   alfa_num;     // Slope numerator
       3,   //uint16   alfa_denom;   // Slope denominator
       -27  //int16    beta;         // Offset
        }
   },
    
   // Corresponds to /pwr/common.cfg
   {//T_PWR_COMMON_CFG_BLOCK structure   // Common configuration
    10001,  //uint32   sampling;     /* 4 */ // The sampling time [ms] used
    10002,  //uint32   mod_cycle;    /* 4 */ // The modulation cycle time [ms] used when performing modulation (Lithium only)
    4,      //uint8    pins;         /* 1 */ // Number of battery pins 2 - 3 - 4
    1,      //uint8    chg_dedic;    /* 1 */ // Charging performed (TRUE) or not (FALSE) in dedicated mode
    10,     //uint8    alfa1;        /* 1 */ // The regulation parameter N (Exponentially Weighted Moving Average) for Vbat
    5,      //uint8    alfa2;        /* 1 */ // The regulation parameter N (Exponentially Weighted Moving Average) for Tbat
    10,     //uint8    alfa3;        /* 1 */ // The regulation parameter N (Exponentially Weighted Moving Average) for Trf
    4       //uint8    rise_thr;     /* 1 */ // The battery rise temperature follows RF rise temperature threshold (Nickel only)
    },

    // Corresponds to /pwr/bat/bat<N>.cfg
    {//T_PWR_BAT_CFG_BLOCK structure         // Battery configuration
    1,       //uint16   type;          /* 2 */ // Battery type - Nickel or Lithium
    0,       //uint16   rf_temp;       /* 2 */ // Use rf temperature (TRUE) or not (FALSE) if no battery temperature is availlable
    441,     //uint32   id_low;        /* 4 */ // Low battery id limit - used for identification
    481,     //uint32   id_high;       /* 4 */ // High battery id limit - used for identification
    851,     //uint16   cbat;          /* 2 */ // Standard battery capacity [mAh]
    51,      //uint16   ratio;         /* 2 */ // Time ratio of charge current [C] (%) - ratio x cbat = max charger current
    3600001, //uint32   T1;            /* 4 */ // The total time charging counter
    1800001, //uint32   T2;            /* 4 */ // The CV charging complete timer (-Nickel)
    600001,  //uint32   T3;            /* 4 */ // The re-charge attempt timer counter
    4101,    //uint16   chg_start_thr; /* 2 */ // The CV charge begin battery voltage threshold value (-Nickel)
    4201,    //uint16   chg_stop_thr;  /* 2 */ // The (CI and CV) charge end (stop) battery voltage threshold value
    21,      //uint16   chg_ctrl_thr;  /* 2 */ // The minimal charge control ('k_min') value threshold
    99       //uint16   chg_again_thr; /* 2 */ // The charge again capacity threshold (t=20 degrees)
     },
    
    // Corresponds to /pwr/bat/temp<N>.cfg
    {//T_PWR_BAT_TEMP_CFG_BLOCK structure   // Battery temperature configuration
    -20,  //int16      tbat_min;  /* 2 */  // Minimum battery temperature allowed
    45,   //int16      tbat_max;  /* 2*/  // Maximum battery temperature allowed
          //
    0,    //uint16    a0;         /* 2 */  // Capacity temperature compensation a0 (a2*t*t + a1*t +a0)
    0,    //uint16    a1;         /* 2 */  // Capacity temperature compensation a1 (a2*t*t + a1*t +a0)
    0,    //uint16    a2;         /* 2 */  // Capacity temperature compensation a2 (a2*t*t + a1*t +a0)
                                           // Capacity compensation function relative to t=20 degrees
                                           // C(t=0) = C(t=20) + capacity compensation function(t=-20)
     
    {//uint16   cap[9+1];      /* 20 */ // Capacity as a function of voltage measured at t=20 degrees - C(t=20)
    	                            // Capacity vector :
    5400,                           //           100%,
    5200,                           //            90%,
    5000,                           //            80%,
    4800,                           //            70%,
    4600,                           //            60%,
    4400,                           //            50%,
    4200,                           //            40%,
    4000,                           //            30%,
    3800,                           //            20%,
    3500                            //            10%
    },

    10,   //uint16     i_meas1;   /* 2 */  // The choosen measurement current, i_measure (typically 10uA and 50uA)
    50,   //uint16     i_meas2;   /* 2 */  // The choosen measurement current, i_measure (typically 10uA and 50uA)

    {//uint16     v2t_1[8+1];  /* 18 */ // The voltage to temperature mapper for i_measure
    0x22E,
    0x13F, 
    0xCB, 
    0xFFFF, 
    0xFFFF, 
    0xFFFF, 
    0xFFFF, 
    0xFFFF, 
    0xFFFF 
    },
    
    {//uint16     v2t_2[8+1];  /* 18 */ // The voltage to temperature mapper for i_measure
    	                                // Temperature vector :
    0xFFFF,                             //       -20,
    0xFFFF,                             //       -10,
    0x351,                              //         0,
    0x22E,                              //        10,
    0x169,                              //        20,
    0xF9,                               //        30,
    0x96,                               //        40,
    0x68,                               //        50,
    0x4A                                //        60
    }
    },

    // Corresponds to /pwr/chg/chg<N>.cfg
    {//T_PWR_CHG_CFG_BLOCK structure         // Charger configuration
    1,       //uint16   type;       /* 2 */ // Charger type - Regulated (CI or CV) or unregulated (UNREGULATED)
    501,     //uint16   ichg_max;   /* 2 */ // Maximum charger current [mA] - normally decides the fast charging current
    7001,    //uint16   vchg_low;   /* 2 */ // Low charger voltage limit  (Open circuit - used for identification )
    13001    //uint16   vchg_high;  /* 2 */ // High charger voltage limit (Open circuit- used for identification)
    },

    // Corresponds to /mmi/pwr/bsie.cfg
    {//T_PWR_MMI_CFG_BLOCK structure         // MMI configuration
    20000    //uint16    repetition;     // The repetition interval for sending MMI info events
    },

    // The power data block - dynamical data collected
    {//T_PWR_DATA_BLOCK structure           // Data (dynamic) related to configuration
    
    0,       //uint16       bat_id;             // Measured battery ID
    0,       //uint16       chg_id;             // Measured charger ID
             
    0,       //uint16       Vbat;               // Latest measured battery voltage
    0,       //uint16       Vbat_avg;           // Latest _average_ battery voltage
    0,       //uint16       Vbat_avg_mV;        // Latest _average_ battery voltage
             
    0,       //uint16       Tbat;               // Latest measured battery temperature
    0,       //uint16       Tbat_avg;           // Latest _average_ battery temperature
             
    0,       //uint16       T_rf;               // Latest measured RF temperature
    0,       //uint16       T_rf_avg;           // Latest _average_ RF temperature
             
    0,       //uint16       Vchg;               // Latest measured charger voltage
    0,       //uint16       Ichg;               // Latest measured charger current
             
    0,       //uint16       Cbat;               // Battery capacity in %
             
    0,       //char         cfg_id;             // Configuration ID (bat<n>.cfg)
    0,       //char         chg_cfg_id;         // Charger Configuration ID (chg<n>.cfg)
    0,       //char         bforce;             // Force usage of battery configuration
    0,       //char         cforce;             // Force usage of charger configuration
    0,       //uint16       k;                  // Modulation value
    10000    //uint32       T4;                 // The modulation ON T4 timer counter (variable!!)
    }

};

/* Define a pointer to the PWR configuration block */
T_PWR_CFG_BLOCK  *pwr_cfg  = &pwr_cfg_init;


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -