Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

73 lines
2.2 KiB

  1. /*++
  2. Copyright (c) 2000,2001 Microsoft Corporation
  3. Module Name:
  4. chgrinfo.h
  5. Abstract: Contains SMBus Battery Charger Information definitions.
  6. Environment:
  7. User mode
  8. Author:
  9. Michael Tsang (MikeTs) 26-Jan-2001
  10. Revision History:
  11. --*/
  12. #ifndef _CHGRINFO_H
  13. #define _CHGRINFO_H
  14. //
  15. // Constants
  16. //
  17. #define SMB_CHARGER_ADDRESS 0x09 //Address on bus (0x12)
  18. // Temperature sensor commands
  19. #define CHGRCMD_SPECINFO 0x11 //Read
  20. #define CHGRCMD_CHARGER_MODE 0x12 //Write
  21. #define CHGRCMD_STATUS 0x13 //Read
  22. #define CHGRCMD_CHARGING_CURRENT 0x14 //Write
  23. #define CHGRCMD_CHARGING_VOLTAGE 0x15 //Write
  24. #define CHGRCMD_ALARM_WARNING 0x16 //Write
  25. #define CHGRCMD_LTC_VERSION 0x3c //Read
  26. // SpecInfo bits
  27. #define CHGRSI_SPEC_MASK 0x000f
  28. #define CHGRSI_SELECTOR_SUPPORT 0x0010
  29. // Status bits
  30. #define CHGRSTATUS_CHARGE_INHIBITED 0x0001
  31. #define CHGRSTATUS_MASTER_MODE 0x0002
  32. #define CHGRSTATUS_VOLTAGE_NOTREG 0x0004
  33. #define CHGRSTATUS_CURRENT_NOTREG 0x0008
  34. #define CHGRSTATUS_CTRL_MASK 0x0030
  35. #define CHGRSTATUS_CTRL_BATT 0x0010
  36. #define CHGRSTATUS_CTRL_HOST 0x0030
  37. #define CHGRSTATUS_CURRENT_INVALID 0x0040
  38. #define CHGRSTATUS_VOLTAGE_INVALID 0x0080
  39. #define CHGRSTATUS_THERM_OVERRANGE 0x0100
  40. #define CHGRSTATUS_THERM_COLD 0x0200
  41. #define CHGRSTATUS_THERM_HOT 0x0400
  42. #define CHGRSTATUS_THERM_UNDERRANGE 0x0800
  43. #define CHGRSTATUS_ALARM_INHIBITED 0x1000
  44. #define CHGRSTATUS_POWER_FAIL 0x2000
  45. #define CHGRSTATUS_BATT_PRESENT 0x4000
  46. #define CHGRSTATUS_AC_PRESENT 0x8000
  47. #include <pshpack1.h>
  48. typedef struct _CHGR_INFO
  49. {
  50. WORD wChargerSpecInfo;
  51. WORD wChargerStatus;
  52. WORD wLTCVersion;
  53. } CHGR_INFO, *PCHGR_INFO;
  54. #include <poppack.h>
  55. #define TYPEF_CHGR_SPECINFO (TYPEF_USER + 0x10)
  56. #define TYPEF_CHGR_STATUS (TYPEF_USER + 0x11)
  57. #define CSI TYPEF_CHGR_SPECINFO
  58. #define CST TYPEF_CHGR_STATUS
  59. #endif //ifndef CHGRINFO_H