bq27220_reg.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. #pragma once
  2. #define BQ27220_ADDRESS 0xAA
  3. #define BQ27220_I2C_TIMEOUT 50
  4. #define CommandControl 0x00
  5. #define CommandAtRate 0x02
  6. #define CommandAtRateTimeToEmpty 0x04
  7. #define CommandTemperature 0x06
  8. #define CommandVoltage 0x08
  9. #define CommandBatteryStatus 0x0A
  10. #define CommandCurrent 0x0C
  11. #define CommandRemainingCapacity 0x10
  12. #define CommandFullChargeCapacity 0x12
  13. #define CommandAverageCurrent 0x14
  14. #define CommandTimeToEmpty 0x16
  15. #define CommandTimeToFull 0x18
  16. #define CommandStandbyCurrent 0x1A
  17. #define CommandStandbyTimeToEmpty 0x1C
  18. #define CommandMaxLoadCurrent 0x1E
  19. #define CommandMaxLoadTimeToEmpty 0x20
  20. #define CommandRawCoulombCount 0x22
  21. #define CommandAveragePower 0x24
  22. #define CommandInternalTemperature 0x28
  23. #define CommandCycleCount 0x2A
  24. #define CommandStateOfCharge 0x2C
  25. #define CommandStateOfHealth 0x2E
  26. #define CommandChargeVoltage 0x30
  27. #define CommandChargeCurrent 0x32
  28. #define CommandBTPDischargeSet 0x34
  29. #define CommandBTPChargeSet 0x36
  30. #define CommandOperationStatus 0x3A
  31. #define CommandDesignCapacity 0x3C
  32. #define CommandSelectSubclass 0x3E
  33. #define CommandMACData 0x40
  34. #define CommandMACDataSum 0x60
  35. #define CommandMACDataLen 0x61
  36. #define CommandAnalogCount 0x79
  37. #define CommandRawCurrent 0x7A
  38. #define CommandRawVoltage 0x7C
  39. #define CommandRawIntTemp 0x7E
  40. #define Control_CONTROL_STATUS 0x0000
  41. #define Control_DEVICE_NUMBER 0x0001
  42. #define Control_FW_VERSION 0x0002
  43. #define Control_BOARD_OFFSET 0x0009
  44. #define Control_CC_OFFSET 0x000A
  45. #define Control_CC_OFFSET_SAVE 0x000B
  46. #define Control_OCV_CMD 0x000C
  47. #define Control_BAT_INSERT 0x000D
  48. #define Control_BAT_REMOVE 0x000E
  49. #define Control_SET_SNOOZE 0x0013
  50. #define Control_CLEAR_SNOOZE 0x0014
  51. #define Control_SET_PROFILE_1 0x0015
  52. #define Control_SET_PROFILE_2 0x0016
  53. #define Control_SET_PROFILE_3 0x0017
  54. #define Control_SET_PROFILE_4 0x0018
  55. #define Control_SET_PROFILE_5 0x0019
  56. #define Control_SET_PROFILE_6 0x001A
  57. #define Control_CAL_TOGGLE 0x002D
  58. #define Control_SEALED 0x0030
  59. #define Control_RESET 0x0041
  60. #define Control_EXIT_CAL 0x0080
  61. #define Control_ENTER_CAL 0x0081
  62. #define Control_ENTER_CFG_UPDATE 0x0090
  63. #define Control_EXIT_CFG_UPDATE_REINIT 0x0091
  64. #define Control_EXIT_CFG_UPDATE 0x0092
  65. #define Control_RETURN_TO_ROM 0x0F00
  66. #define AddressGaugingConfig 0x929B
  67. #define AddressFullChargeCapacity 0x929D
  68. #define AddressDesignCapacity 0x929F
  69. #define AddressEMF 0x92A3
  70. #define AddressC0 0x92A9
  71. #define AddressR0 0x92AB
  72. #define AddressT0 0x92AD
  73. #define AddressR1 0x92AF
  74. #define AddressTC 0x92B1
  75. #define AddressC1 0x92B2
  76. #define AddressEDV0 0x92B4
  77. #define AddressEDV1 0x92B7
  78. #define AddressEDV2 0x92BA
  79. #define AddressStartDOD0 0x92BD
  80. #define AddressStartDOD10 0x92BF
  81. #define AddressStartDOD20 0x92C1
  82. #define AddressStartDOD30 0x92C3
  83. #define AddressStartDOD40 0x92C5
  84. #define AddressStartDOD50 0x92C7
  85. #define AddressStartDOD60 0x92C9
  86. #define AddressStartDOD70 0x92CB
  87. #define AddressStartDOD80 0x92CD
  88. #define AddressStartDOD90 0x92CF
  89. #define AddressStartDOD100 0x92D1