LorDClockaN

ds2746 param original

Jul 12th, 2011
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.47 KB | None | 0 0
  1. /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  2.  
  3. Copyright (c) 2010 High Tech Computer Corporation
  4.  
  5. Module Name:
  6.  
  7. ds2746_param_config.c
  8.  
  9. Abstract:
  10.  
  11. This module tells batt_param.c module what the battery characteristic is.
  12. And also which charger/gauge component hardware uses, to decide if software/hardware function is available.
  13.  
  14. Original Auther:
  15.  
  16. Andy.ys Wang June-01-2010
  17.  
  18. ---------------------------------------------------------------------------------*/
  19.  
  20.  
  21. #ifndef __BATT_PARAM_CONFIG_H__
  22. #define __BATT_PARAM_CONFIG_H__
  23. #define HTC_BATT_BOARD_NAME "ACE"
  24.  
  25. /*========================================================================================
  26.  
  27. battery parameter defines (depend on board design)
  28.  
  29. ========================================================================================*/
  30.  
  31. static BOOL support_ds2746_gauge_ic = TRUE;
  32.  
  33. /*This table is calculated according to temp formula for temp mapping.
  34. If temp_adc is located on 0-95, then the temp_01c is 700.
  35. 96-99, then the temp_01c is 690.
  36. 100-102, then the temp_01c is 680.
  37. ...
  38. 1117777777-1145, then the temp_01c is 0.
  39. 1146-1175, then the temp_01c is -1.
  40. ...
  41. 1433-2046, then the temp_01c is -11.
  42. */
  43. UINT32 TEMP_MAP_300K_100_4360[] =
  44. {
  45. 0, 96, 100, 103, 107, 111, 115, 119, 123, 127,
  46. 133, 137, 143, 148, 154, 159, 165, 172, 178, 185,
  47. 192, 199, 207, 215, 223, 232, 241, 250, 260, 270,
  48. 280, 291, 301, 314, 326, 339, 352, 366, 380, 394,
  49. 410, 425, 442, 458, 476, 494, 512, 531, 551, 571,
  50. 592, 614, 636, 659, 682, 706, 730, 755, 780, 806,
  51. 833, 860, 887, 942, 943, 971, 1000, 1028, 1058, 1087,
  52. 1117, 1146, 1176, 1205, 1234, 1264, 1293, 1321, 1350, 1378,
  53. 1406, 1433, 2047,
  54. };
  55.  
  56. UINT32 TEMP_MAP_300K_47_3440[] =
  57. {
  58. 0, 68, 70, 72, 74, 76, 78, 81, 83, 85,
  59. 88, 91, 93, 96, 99, 102, 105, 109, 112, 116,
  60. 119, 123, 127, 131, 135, 139, 144, 148, 153, 158,
  61. 163, 169, 174, 180, 186, 192, 199, 205, 212, 219,
  62. 227, 234, 242, 250, 259, 268, 277, 286, 296, 306,
  63. 317, 327, 339, 350, 362, 374, 387, 401, 414, 428,
  64. 443, 458, 474, 490, 506, 523, 540, 558, 577, 596,
  65. 615, 656, 677, 698, 720, 742, 765, 789, 812, 837,
  66. 861, 886, 2047,
  67. };
  68.  
  69. UINT32 TEMP_MAP_1000K_100_4360[] =
  70. {
  71. 0, 30, 31, 32, 34, 35, 36, 38, 39, 40,
  72. 42, 44, 45, 47, 49, 51, 53, 55, 57, 60,
  73. 62, 64, 67, 70, 73, 76, 79, 82, 86, 89,
  74. 93, 97, 101, 106, 111, 115, 120, 126, 131, 137,
  75. 143, 150, 156, 163, 171, 178, 187, 195, 204, 213,
  76. 223, 233, 244, 255, 267, 279, 292, 306, 320, 334,
  77. 350, 365, 382, 399, 418, 436, 456, 476, 497, 519,
  78. 542, 566, 590, 615, 641, 668, 695, 723, 752, 782,
  79. 812, 843, 2047,
  80. };
  81.  
  82. UINT32 *TEMP_MAP = TEMP_MAP_300K_100_4360;
  83.  
  84. /* use default parameter if it doesn't be passed from board */
  85. #define PD_M_COEF_DEFAULT (30)
  86. #define PD_M_RESL_DEFAULT (100)
  87. #define PD_T_COEF_DEFAULT (250)
  88. #define CAPACITY_DEDUCTION_DEFAULT (0)
  89.  
  90. UINT32 M_PARAMETER_DEFAULT[] =
  91. {
  92. /* capacity (in 0.01%) -> voltage (in mV)*/
  93. 10000, 4135, 7500, 3960, 4700, 3800, 1700, 3727, 900, 3674, 300, 3640, 0, 3420,
  94. };
  95.  
  96. /*========================================================================================
  97.  
  98. battery formula coef definition, can be re-programable
  99.  
  100. ========================================================================================*/
  101.  
  102. /* adc converter*/
  103.  
  104. static INT32 voltage_adc_to_mv_coef = 244;
  105. static INT32 voltage_adc_to_mv_resl = 100;
  106. static INT32 current_adc_to_mv_coef = 625;
  107. static INT32 current_adc_to_mv_resl = 1580;
  108. static INT32 discharge_adc_to_mv_coef = 625;
  109. static INT32 discharge_adc_to_mv_resl = 1580;
  110. static INT32 acr_adc_to_mv_coef = 625;
  111. static INT32 acr_adc_to_mv_resl = 1580;
  112. static INT32 charge_counter_zero_base_mAh = 500;
  113.  
  114. static INT32 id_adc_overflow = 3067; /* 3067 < id_adc: rawdata overflow */
  115. static INT32 id_adc_resl = 2047;
  116. static INT32 temp_adc_resl = 2047;
  117.  
  118. /* kadc parameter*/
  119.  
  120. static INT32 pd_m_bias_mA; /* the bias current when calculating pd_m*/
  121.  
  122. /* over temperature algorithm*/
  123.  
  124. static INT32 over_high_temp_lock_01c = 450;
  125. static INT32 over_high_temp_release_01c = 420;
  126. static INT32 over_low_temp_lock_01c; /*over_low_temp_lock_01c = 0*/
  127. static INT32 over_low_temp_release_01c = 30;
  128.  
  129. /* function config*/
  130.  
  131. static BOOL is_allow_batt_id_change = TRUE; // MATT
  132. extern BOOL is_need_battery_id_detection;
  133.  
  134. /*boot up voltage*/
  135.  
  136. /*dead battery is voltage < M_0*/
  137. #define BATTERY_DEAD_VOLTAGE_LEVEL 3420
  138. #define BATTERY_DEAD_VOLTAGE_RELEASE 3450
  139.  
  140. #define TEMP_MAX 70
  141. #define TEMP_MIN -11
  142. #define TEMP_NUM 83
  143.  
  144. #endif
Advertisement
Add Comment
Please, Sign In to add comment