ml5238_reg.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. /*****************************************************************************
  2. ml5238_reg.h
  3. Copyright (C) 2012 LAPIS Semiconductor Co., Ltd.
  4. All rights reserved.
  5. LAPIS Semiconductor shall not be liable for any direct, indirect,
  6. consequential or incidental damages arising from using or modifying this
  7. program.
  8. History
  9. 2012.11.20 ver.2.00
  10. 2012.09.13 ver.1.00
  11. ******************************************************************************/
  12. #ifndef _ML5238_REG_H_
  13. #define _ML5238_REG_H_
  14. #define ML5238_NOOP (0x00u)
  15. #define ML5238_VMON (0x01u)
  16. #define ML5238_IMON (0x02u)
  17. #define ML5238_FET (0x03u)
  18. #define ML5238_PSENSE (0x04u)
  19. #define ML5238_RSENSE (0x05u)
  20. #define ML5238_POWER (0x06u)
  21. #define ML5238_STATUS (0x07u)
  22. #define ML5238_CBALH (0x08u)
  23. #define ML5238_CBALL (0x09u)
  24. #define ML5238_SETSC (0x0Au)
  25. /**********************************
  26. NOOP(0x00)
  27. **********************************/
  28. #define NOOP_NO0 (0x01u)
  29. #define NOOP_NO1 (0x02u)
  30. #define NOOP_NO2 (0x04u)
  31. #define NOOP_NO3 (0x08u)
  32. #define NOOP_NO4 (0x10u)
  33. #define NOOP_NO5 (0x20u)
  34. #define NOOP_NO6 (0x40u)
  35. #define NOOP_NO7 (0x80u)
  36. /**********************************
  37. VMON(0x01)
  38. **********************************/
  39. #define VMON_CN0 (0x01u)
  40. #define VMON_CN1 (0x02u)
  41. #define VMON_CN2 (0x04u)
  42. #define VMON_CN3 (0x08u)
  43. #define VMON_OUT (0x10u)
  44. /**********************************
  45. IMON(0x02)
  46. **********************************/
  47. #define IMON_GIM (0x01u)
  48. #define IMON_ZERO (0x02u)
  49. #define IMON_GCAL0 (0x04u)
  50. #define IMON_GCAL1 (0x08u)
  51. #define IMON_OUT (0x10u)
  52. /**********************************
  53. FET(0x03)
  54. **********************************/
  55. #define FET_DF (0x01u)
  56. #define FET_CF (0x02u)
  57. #define FET_DRV (0x10u)
  58. /**********************************
  59. PSENSE(0x04)
  60. **********************************/
  61. #define PSENSE_PSL (0x01u)
  62. #define PSENSE_RPSL (0x02u)
  63. #define PSENSE_IPSL (0x04u)
  64. #define PSENSE_EPSL (0x08u)
  65. #define PSENSE_PSH (0x10u)
  66. #define PSENSE_RPSH (0x20u)
  67. #define PSENSE_IPSH (0x40u)
  68. #define PSENSE_EPSH (0x80u)
  69. /**********************************
  70. RSENSE(0x05)
  71. **********************************/
  72. #define RSENSE_RS (0x01u)
  73. #define RSENSE_RRS (0x02u)
  74. #define RSENSE_IRS (0x04u)
  75. #define RSENSE_ERS (0x08u)
  76. #define RSENSE_SC (0x10u)
  77. #define RSENSE_RSC (0x20u)
  78. #define RSENSE_ISC (0x40u)
  79. #define RSENSE_ESC (0x80u)
  80. /**********************************
  81. POWER(0x06)
  82. **********************************/
  83. #define POWER_PSV (0x01u)
  84. #define POWER_PDWN (0x10u)
  85. #define POWER_PUPIN (0x80u)
  86. /**********************************
  87. STATUS(0x07)
  88. **********************************/
  89. #define STATUS_DF (0x01u)
  90. #define STATUS_CF (0x02u)
  91. #define STATUS_PSV (0x04u)
  92. #define STATUS_INT (0x08u)
  93. #define STATUS_RPSL (0x10u) /* charger disconnecting for charger over-current */
  94. #define STATUS_RPSH (0x20u) /* charger disconnecring for power down*/
  95. #define STATUS_RRS (0x40u) /* load disconnect */
  96. #define STATUS_RSC (0x80u) /* short current detect*/
  97. /**********************************
  98. CBALH(0x08)
  99. **********************************/
  100. #define CBALH_SW9 (0x01u)
  101. #define CBALH_SW10 (0x02u)
  102. #define CBALH_SW11 (0x04u)
  103. #define CBALH_SW12 (0x08u)
  104. #define CBALH_SW13 (0x10u)
  105. #define CBALH_SW14 (0x20u)
  106. #define CBALH_SW15 (0x40u)
  107. #define CBALH_SW16 (0x80u)
  108. /**********************************
  109. CBALL(0x09)
  110. **********************************/
  111. #define CBALL_SW1 (0x01u)
  112. #define CBALL_SW2 (0x02u)
  113. #define CBALL_SW3 (0x04u)
  114. #define CBALL_SW4 (0x08u)
  115. #define CBALL_SW5 (0x10u)
  116. #define CBALL_SW6 (0x20u)
  117. #define CBALL_SW7 (0x40u)
  118. #define CBALL_SW8 (0x80u)
  119. /**********************************
  120. SETSC(0x0A)
  121. **********************************/
  122. #define SETSC_SC0 (0x01u)
  123. #define SETSC_SC1 (0x02u)
  124. #endif /*_ML5238_REG_H_*/