cust_battery.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. #ifndef _CUST_BAT_H_
  2. #define _CUST_BAT_H_
  3. #include <platform/mt_typedefs.h>
  4. typedef enum
  5. {
  6. Cust_CC_1600MA = 0x0,
  7. Cust_CC_1500MA = 0x1,
  8. Cust_CC_1400MA = 0x2,
  9. Cust_CC_1300MA = 0x3,
  10. Cust_CC_1200MA = 0x4,
  11. Cust_CC_1100MA = 0x5,
  12. Cust_CC_1000MA = 0x6,
  13. Cust_CC_900MA = 0x7,
  14. Cust_CC_800MA = 0x8,
  15. Cust_CC_700MA = 0x9,
  16. Cust_CC_650MA = 0xA,
  17. Cust_CC_550MA = 0xB,
  18. Cust_CC_450MA = 0xC,
  19. Cust_CC_400MA = 0xD,
  20. Cust_CC_200MA = 0xE,
  21. Cust_CC_70MA = 0xF,
  22. Cust_CC_0MA = 0xDD
  23. }cust_charging_current_enum;
  24. typedef struct{
  25. unsigned int BattVolt;
  26. unsigned int BattPercent;
  27. }VBAT_TO_PERCENT;
  28. /* Battery Temperature Protection */
  29. #define MAX_CHARGE_TEMPERATURE 50
  30. #define MIN_CHARGE_TEMPERATURE 0
  31. #define ERR_CHARGE_TEMPERATURE 0xFF
  32. /* Recharging Battery Voltage */
  33. #define RECHARGING_VOLTAGE 4110
  34. /* Charging Current Setting */
  35. #define USB_CHARGER_CURRENT Cust_CC_450MA
  36. #define AC_CHARGER_CURRENT Cust_CC_650MA
  37. /* Battery Meter Solution */
  38. #define CONFIG_ADC_SOLUTION 1
  39. /* Battery Voltage and Percentage Mapping Table */
  40. VBAT_TO_PERCENT Batt_VoltToPercent_Table[] = {
  41. /*BattVolt,BattPercent*/
  42. {3400,0},
  43. {3686,10},
  44. {3740,20},
  45. {3771,30},
  46. {3789,40},
  47. {3820,50},
  48. {3873,60},
  49. {3943,70},
  50. {4013,80},
  51. {4100,90},
  52. {4189,100},
  53. };
  54. /* Precise Tunning */
  55. //#define BATTERY_AVERAGE_SIZE 600
  56. #define BATTERY_AVERAGE_SIZE 60
  57. #define CHARGING_IDLE_MODE 1
  58. #define CHARGING_PICTURE 1
  59. /* Common setting */
  60. #define R_CURRENT_SENSE 2 // 0.2 Ohm
  61. #define R_BAT_SENSE 4 // times of voltage
  62. #define R_I_SENSE 4 // times of voltage
  63. #define R_CHARGER_1 330
  64. #define R_CHARGER_2 39
  65. #define R_CHARGER_SENSE ((R_CHARGER_1+R_CHARGER_2)/R_CHARGER_2) // times of voltage
  66. #define V_CHARGER_MAX 6500 // 6.5 V
  67. #define V_CHARGER_MIN 4400 // 4.4 V
  68. #define V_CHARGER_ENABLE 0 // 1:ON , 0:OFF
  69. #define BACKLIGHT_KEY 10 // camera key
  70. /* Teperature related setting */
  71. #define RBAT_PULL_UP_R 39000
  72. #define RBAT_PULL_UP_VOLT 1800
  73. #define TBAT_OVER_CRITICAL_LOW 68237
  74. //#define TBAT_OVER_CRITICAL_LOW 483954
  75. #define BAT_TEMP_PROTECT_ENABLE 1
  76. #define BAT_NTC_10 1
  77. #define BAT_NTC_47 0
  78. /* The option of new charging animation */
  79. #define ANIMATION_NEW
  80. #if defined(MTK_BQ24196_SUPPORT)\
  81. ||defined(MTK_BQ24296_SUPPORT)\
  82. ||defined(MTK_BQ24160_SUPPORT)\
  83. ||defined(MTK_BQ24261_SUPPORT)
  84. #define SWCHR_POWER_PATH
  85. #endif
  86. #endif /* _CUST_BAT_H_ */