MTK Android Driver :battery

6.PM 充电

6.1 配置文件位置:

CUSTOM_KERNEL_BATTERY= battery

mediatek\custom\\kernel\battery\battery\cust_battery.h

mediatek\custom\\kernel\battery\battery\custom_fuel_gauge.h

 

6.2充电常用参数修改:

..\mediatek\custom\\kernel\battery\battery\cust_battery.h

6.2.1充电电流修改:

#defineUSB_CHARGER_CURRENT                                         Cust_CC_550MA   //  :Cust_CC_450MA

#define AC_CHARGER_CURRENT                                           Cust_CC_800MA   // : Cust_CC_650MA

6.2.2.充电电阻设定(根据硬件的bom):

#defineR_CURRENT_SENSE 2                              //0.2 Ohm// 0.2欧姆

6.2.3  充电温度检测设定

#defineBAT_TEMP_PROTECT_ENABLE    1       //

// #defineBAT_NTC_TSM_1

NTC修改为10K电阻或者47K电阻(NTC 为电池温度保护NegativeTemperature Coefficient)

#define BAT_NTC_101    //#define BAT_NTC_47 0

 

其他:

#defineV_CHARGER_MIN 4400                                      //modify      //4400 // 4.4 V

#defineV_CHARGER_ENABLE 1                                    //1:ON , 0:OFF      //


其他宏定义说明:

#defineR_CURRENT_SENSE 2                              //0.2 Ohm   //检测当前充电的电阻

#define R_BAT_SENSE4                                       //times of voltage  //测量电池电压检测电阻

#define R_I_SENSE 4                                                      //times of voltage  //测量接电感电流传感器电压的电阻

#defineR_CHARGER_SENSE   ((R_CHARGER_1+R_CHARGER_2)/R_CHARGER_2)     

// times ofvoltage  测量充电器检测电压的电阻

#defineV_CHARGER_MAX 6500                                    //6.5 V   充电器的电压最大值

#defineV_CHARGER_MIN 4400                                      //4.4     充电器的电压最小值

#defineV_CHARGER_ENABLE 0                                    //1:ON , 0:OFF    //充电电压保护使能

 

/* Teperaturerelated setting */

#defineRBAT_PULL_UP_R             39000       //检测电池温度的上拉电阻

#defineRBAT_PULL_UP_VOLT          1800     //检测电池温度的下拉电阻

#defineTBAT_OVER_CRITICAL_LOW     68237     //用于计算电阻的值

//#defineTBAT_OVER_CRITICAL_LOW     483954

#defineBAT_TEMP_PROTECT_ENABLE    0           电池温度保护 

#define BAT_NTC_100    负温度系数


 

6.7充电界面显示修改:

\mediatek\custom\\lk\include\target\cust_display.h//坐标

\mediatek\platform\mt6577\lk\mt_logo.c//显示

 

6.8 电池容量、电池曲线修改:

电池容量修改:

mediatek\custom\\kernel\battery\battery\custom_fuel_gauge.h 

#define Q_MAX_POS_50 ((2168* 1316) / 1307)

#define Q_MAX_POS_25   2168

#define Q_MAX_POS_0 ((2168 * 1220) / 1307)

#define Q_MAX_NEG_10  ((2168 * 1162) / 1307)


#define Q_MAX_POS_50_H_CURRENT ((2168 * 1295) / 1307)

#define Q_MAX_POS_25_H_CURRENT ((2168 * 1270) / 1307)
#define Q_MAX_POS_0_H_CURRENT ((2168 * 1102) / 1307)
#define Q_MAX_NEG_10_H_CURRENT ((2168 * 599) / 1307)

 

电池曲线集成方式:(电压-百分比对应表需要电池厂商提供)

mediatek\custom\\kernel\battery\battery\cust_fuel_gauge.h

BATTERY_PROFILE_STRUCbattery_profile_t1[] =// T1 0C

BATTERY_PROFILE_STRUCbattery_profile_t2[] =// T2 25C

你可能感兴趣的:(MTK Android Driver :battery)