cust_battery.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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 USB_CHARGER_CURRENT Cust_CC_900MA
  37. //#define AC_CHARGER_CURRENT Cust_CC_650MA
  38. #define AC_CHARGER_CURRENT Cust_CC_1200MA
  39. /* Battery Meter Solution */
  40. #define CONFIG_ADC_SOLUTION 1
  41. /* Battery Voltage and Percentage Mapping Table */
  42. VBAT_TO_PERCENT Batt_VoltToPercent_Table[] = {
  43. /*BattVolt,BattPercent*/
  44. {3400,0},
  45. {3686,10},
  46. {3740,20},
  47. {3771,30},
  48. {3789,40},
  49. {3820,50},
  50. {3873,60},
  51. {3943,70},
  52. {4013,80},
  53. {4100,90},
  54. {4189,100},
  55. };
  56. /* Precise Tunning */
  57. //#define BATTERY_AVERAGE_SIZE 600
  58. //#define BATTERY_AVERAGE_SIZE 60
  59. #define BATTERY_AVERAGE_SIZE 30 //fixed value
  60. #define CHARGING_IDLE_MODE 1
  61. #define CHARGING_PICTURE 1
  62. /* Common setting */
  63. #define R_CURRENT_SENSE 2 // 0.2 Ohm
  64. #define R_BAT_SENSE 4 // times of voltage
  65. #define R_I_SENSE 4 // times of voltage
  66. #define R_CHARGER_1 330
  67. #define R_CHARGER_2 39
  68. #define R_CHARGER_SENSE ((R_CHARGER_1+R_CHARGER_2)/R_CHARGER_2) // times of voltage
  69. #define V_CHARGER_MAX 6500 // 6.5 V
  70. #define V_CHARGER_MIN 4400 // 4.4 V
  71. #define V_CHARGER_ENABLE 0 // 1:ON , 0:OFF
  72. #define BACKLIGHT_KEY 10 // camera key
  73. /* Teperature related setting */
  74. #define RBAT_PULL_UP_R 16900
  75. #define RBAT_PULL_DOWN_R 27000
  76. #define RBAT_PULL_UP_VOLT 1800
  77. #define TBAT_OVER_CRITICAL_LOW 68237
  78. //#define TBAT_OVER_CRITICAL_LOW 483954
  79. #define BAT_TEMP_PROTECT_ENABLE 1
  80. #define BAT_NTC_10 1
  81. #define BAT_NTC_47 0
  82. /* The option of new charging animation */
  83. #define ANIMATION_NEW
  84. #endif /* _CUST_BAT_H_ */