hid_usage_power.h 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  1. /* This file is the part of the Lightweight USB device Stack for STM32 microcontrollers
  2. *
  3. * Copyright ©2019 Dmitry Filimonchuk <dmitrystu[at]gmail[dot]com>
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License");
  6. * you may not use this file except in compliance with the License.
  7. * You may obtain a copy of the License at
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. * Unless required by applicable law or agreed to in writing, software
  10. * distributed under the License is distributed on an "AS IS" BASIS,
  11. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. * See the License for the specific language governing permissions and
  13. * limitations under the License.
  14. */
  15. #ifndef _USB_HID_POWER_DEVICES_H_
  16. #define _USB_HID_POWER_DEVICES_H_
  17. /**\ingroup USB_HID
  18. * \addtogroup USB_HID_POWER HID Usage Tables for Power Devices.
  19. * \brief Contains USB HID Usage tables definitions for HID Power Devices.
  20. * \details This module based on
  21. * + [Universal Serial Bus Usage Tables for HID Power Devices. Release 1.0](https://usb.org/sites/default/files/documents/pdcv10.pdf)
  22. * @{ */
  23. /**
  24. * Name | Physical Unit | HID unit | HID unit code | HID unit exponent | HID size
  25. * -----------------|---------------|----------|---------------|-------------------|---------
  26. * AC voltage | Volt | Volt | 0x00F0D121 | 7 | 8
  27. * AC current | centiAmp | Amp | 0x00100001 | -2 | 16
  28. * Frequency | Hertz | Hertz | 0xF001 | 0 | 8
  29. * DC voltage | centiVolt | Volt | 0x00F0D121 | 5 | 16
  30. * Time | second | s | 0x1001 | 0 | 16
  31. * DC current | centiAmp | Amp | 0x00100001 | -2 | 16
  32. * Power | VA or W | VA or W | 0xD121 | 7 | 16
  33. * Temperature | K degree | K degree | 0x00010001 | 0 | 16
  34. * Battery capacity | AmpSec | AmpSec | 0x00101001 | 0 | 24
  35. *
  36. */
  37. /**\name Measures and Physical Units ant it's exponents in Reports according to this table.*/
  38. //@{
  39. /**AC voltage unit code. Volt.*/
  40. #define HID_POWER_UNIT_AC_VOLTAGE 0x67, 0x21, 0xD1, 0xF0, 0x00, 0x55, 0x07
  41. /**AC current unit code. centiAmpere.*/
  42. #define HID_POWER_UNIT_AC_CURRENT 0x67, 0x01, 0x00, 0x10, 0x00, 0x55, 0xFE
  43. /**Frequency unit code. Hertz.*/
  44. #define HID_POWER_UNIT_FREQUENCY 0x66, 0x01, 0xF0, 0x55, 0x00
  45. /**DC voltage unit code. Volt.*/
  46. #define HID_POWER_UNIT_DC_VOLTAGE 0x67, 0x21, 0xD1, 0xF0, 0x00, 0x55, 0x07
  47. /**Time unit code. Second.*/
  48. #define HID_POWER_UNIT_TIME 0x66, 0x01, 0x10, 0x55, 0x00
  49. /**DC current unit code. centiAmpere.*/
  50. #define HID_POWER_UNIT_DC_CURRENT 0x67, 0x01, 0x00, 0x10, 0x00, 0x55, 0xFE
  51. /**Power unic code. Watt.*/
  52. #define HID_POWER_UNIT_POWER 0x66, 0x21, 0xD1, 0x55, 0x07
  53. /**Temperature unit code. K degree.*/
  54. #define HID_POWER_UNIT_TEMPERATURE 0x67, 0x01, 0x00, 0x01, 0x00, 0x55, 0x00
  55. /**Battery capacity unit code. AmpSec.*/
  56. #define HID_POWER_UNIT_BATTERY_CAPACITY 0x67, 0x01, 0x10, 0x10, 0x00, 0x55, 0x00
  57. //@}
  58. /** Macro to encode battery manufacturing date.
  59. * \param y Year [1980 - 2108]
  60. * \param m Month [1 - 12]
  61. * \param d Day [1 - 31]
  62. */
  63. #define BATTERY_MGF_DATE(y,m,d) (((((y) - 1980) & 0x7F) << 9) + (((m) & 0x0F) << 5) + ((d) & 0x1F))
  64. /** \addtogroup HID_POWER_DEVICE Power Device Page */
  65. //@{
  66. #define HID_POWER_PAGE 0x84 /**<Power device page*/
  67. /**\name Power Device Structure */
  68. //@{
  69. #define HID_POWER_INAME 0x01 /**<[SV] Index of the name string descriptor.*/
  70. #define HID_POWER_PRESENT_STATUS 0x02 /**<[CL] Collection of Present status information related to an object.*/
  71. #define HID_POWER_CHANGED_STATUS 0x03 /**<[CL] Collection of Changed status information related to an object. */
  72. #define HID_POWER_UPS 0x04 /**<[CA] Collection that defines an Uninterruptible Power Supply.*/
  73. #define HID_POWER_POWER_SUPPLY 0x05 /**<[CA] Collection that defines a Power Supply.*/
  74. #define HID_POWER_BATTERY_SYSTEM 0x10 /**<[CP] Collection that defines a Battery System power module.*/
  75. #define HID_POWER_BATTERY_SYSTEM_ID 0x11 /**<[SV] Number that points to a particular Battery System.*/
  76. #define HID_POWER_BATTERY 0x12 /**<[CP] Collection that defines a Battery.*/
  77. #define HID_POWER_BATTERY_ID 0x13 /**<[SV] Number that points to a particular Battery.*/
  78. #define HID_POWER_CHARGER 0x14 /**<[CP] Collection that defines a Charger.*/
  79. #define HID_POWER_CHARGER_ID 0x15 /**<[SV] Number that points to a particular Charger.*/
  80. #define HID_POWER_POWER_CONVERTER 0x16 /**<[CP] Collection that defines a Power Converter power module.*/
  81. #define HID_POWER_POWER_CONVERTER_ID 0x17 /**<[SV] Number that points to a particular Power Converter.*/
  82. #define HID_POWER_OUTLET_SYSTEM 0x18 /**<[CP] Collection that defines a Outlet System power module.*/
  83. #define HID_POWER_OUTLET_SYSTEM_ID 0x19 /**<[SV] Number that points to a particular Outlet System.*/
  84. #define HID_POWER_INPUT 0x1A /**<[CP] Collection that defines an Input.*/
  85. #define HID_POWER_INPUT_ID 0x1B /**<[SV] Number that points to a particular Input.*/
  86. #define HID_POWER_OUTPUT 0x1C /**<[CP] Collection that defines an Output.*/
  87. #define HID_POWER_OUTPUT_ID 0x1D /**<[SV] Number that points to a particular Output.*/
  88. #define HID_POWER_FLOW 0x1E /**<[CP] Collection that defines a Flow.*/
  89. #define HID_POWER_FLOW_ID 0x1F /**<[SV] Number that points to a particular Flow.*/
  90. #define HID_POWER_OUTLET 0x20 /**<[CP] Collection that defines an Outlet.*/
  91. #define HID_POWER_OUTLET_ID 0x21 /**<[SV] Number that points to a particular Outlet*/
  92. #define HID_POWER_GANG 0x22 /**<[CL/CP] Collection that defines ganged objects.*/
  93. #define HID_POWER_GANG_ID 0x23 /**<[SV] Number that points to a particular Gang.*/
  94. #define HID_POWER_POWER_SUMMARY 0x24 /**<[CL/CP] Collection that defines a Power Summary.*/
  95. #define HID_POWER_POWER_SUMMARY_ID 0x25 /**<[SV] Number that points to a particular Power Summary.*/
  96. //@}
  97. /**\name Power Measures */
  98. //@{
  99. #define HID_POWER_VOLTAGE 0x30 /**<[DV] Actual value of the voltage.*/
  100. #define HID_POWER_CURRENT 0x31 /**<[DV] Actual value of the current.*/
  101. #define HID_POWER_FREQUENCY 0x32 /**<[DV] Actual value of the frequency.*/
  102. #define HID_POWER_APPARENT_POWER 0x33 /**<[DV] Actual value of the apparent power.*/
  103. #define HID_POWER_ACTIVE_POWER 0x34 /**<[DV] Actual value of the active (RMS) power.*/
  104. #define HID_POWER_PERCENT_LOAD 0x35 /**<[DV] Actual value of the percentage of the power capacity presently being used on this input or output line.*/
  105. #define HID_POWER_TEMPERATURE 0x36 /**<[DV] Actual value of the temperature.*/
  106. #define HID_POWER_HUMIDITY 0x37 /**<[DV] Actual value of the humidity.*/
  107. #define HID_POWER_BAD_COUNT 0x38 /**<[DV] Number of times the device, module, or sub-module entered a bad condition.*/
  108. //@}
  109. /**\name Power configuration controls */
  110. //@{
  111. #define HID_POWER_CONFIG_VOLTAGE 0x40 /**<[SV/DV] Nominal value of the voltage.*/
  112. #define HID_POWER_CONFIG_CURRENT 0x41 /**<[SV/DV] Nominal value of the current.*/
  113. #define HID_POWER_CONFIG_FREQUENCY 0x42 /**<[SV/DV] Nominal value of the frequency.*/
  114. #define HID_POWER_CONFIG_APPARENT_POWER 0x43 /**<[SV/DV] Nominal value of the apparent power.*/
  115. #define HID_POWER_CONFIG_ACTIVE_POWER 0x44 /**<[SV/DV] Nominal value of the active (RMS) power.*/
  116. #define HID_POWER_CONFIG_PERCENT_LOAD 0x45 /**<[SV/DV] Nominal value of the percentage load that could be used without critical overload.*/
  117. #define HID_POWER_CONFIG_TEMPERATURE 0x46 /**<[SV/DV] Nominal value of the temperature.*/
  118. #define HID_POWER_CONFIG_HUMIDITY 0x47 /**<[SV/DV] Nominal value of the humidity.*/
  119. //@}
  120. /**\name Power controls */
  121. //@{
  122. #define HID_POWER_SWITCH_ON_CONTROL 0x50 /**<[DV] Controls the Switch ON sequence. \see \ref HID_POWER_SWITCH_VALUES */
  123. #define HID_POWER_SWITCH_OFF_CONTROL 0x51 /**<[DV] Controls the Switch OFF sequence. \see \ref HID_POWER_SWITCH_VALUES */
  124. #define HID_POWER_TOGGLE_CONTROL 0x52 /**<[DV] Controls the Toggle sequence. \see \ref HID_POWER_SWITCH_VALUES */
  125. #define HID_POWER_LOW_VOLTAGE_TRANSFER 0x53 /**<[DV] Minimum line voltage allowed before the PS system transfers to battery backup.*/
  126. #define HID_POWER_HIGH_VOLTAGE_TRANSFER 0x54 /**<[DV] Maximum line voltage allowed before the PS system transfers to battery backup.*/
  127. #define HID_POWER_DELAY_BEFORE_REBOOT 0x55 /**<[DV] Writing this value immediately shuts down (i.e., turns off) the output for a
  128. * period equal to the indicated number of seconds, after which time the output is
  129. * started. If the number of seconds required to perform the request is greater than
  130. * the requested duration, then the requested shutdown and startup cycle shall be
  131. * performed in the minimum time possible, but in no case shall this require more than
  132. * the requested duration plus 60 seconds. If the startup should occur during a utility
  133. * failure, the startup shall not occur until the utility power is restored. \n When read,
  134. * returns the number of seconds remaining in the countdown, or –1 if no countdown is in
  135. * progress.*/
  136. #define HID_POWER_DELAY_BEFORE_STARTUP 0x56 /**<[DV] Writing this value starts the output after the indicated number of seconds.
  137. * Sending this command with 0 causes the startup to occur immediately. Sending this
  138. * command with –1 aborts the countdown. If the output is already on at the time the
  139. * countdown reaches 0, nothing happens. On some systems, if the USB driver on the
  140. * device side is restarted while a startup countdown is in effect, the countdown is
  141. * aborted. If the countdown expires during a utility failure, the startup shall not
  142. * occur until the utility power is restored. Writing this value overrides the effect
  143. * of any countdown in progress. \n When read, returns the number of seconds remaining
  144. * in the countdown, or –1 if no countdown is in progress. */
  145. #define HID_POWER_DELAY_BEFORE_SHUTDOWN 0x57 /**<[DV] Writing this value shuts down either the output after the indicated number of
  146. * seconds, or sooner if the batteries become depleted. Sending this command with 0
  147. * causes the shutdown to occur immediately. Sending this command with –1 aborts the
  148. * countdown. If the system is already in the desired state at the time the countdown
  149. * reaches 0, there is no additional action. On some systems, if the USB driver on the
  150. * device side is restarted while a shutdown countdown is in effect, the countdown may
  151. * be aborted. Writing this value overrides any DelayBeforeShutdown countdown already
  152. * in effect. \n When read, will return the number of seconds remaining until shutdown,
  153. * or –1 if no shutdown countdown is in effect.*/
  154. #define HID_POWER_TEST 0x58 /**<[DV] Test request or result value. \see \ref HID_POWER_TEST_VALUES */
  155. #define HID_POWER_MODULE_RESET 0x59 /**<[DV] Module Reset request value. \see \ref HID_POWER_RESET_VALUES */
  156. #define HID_POWER_AUDIBLE_ALARM_CONTROL 0x5A /**<[DV] Audible alarm value. \see \ref HID_POWER_ALARM_VALUES */
  157. //@}
  158. /**\name Power generic status */
  159. //@{
  160. #define HID_POWER_PRESENT 0x60 /**<[DF] Power present flag.*/
  161. #define HID_POWER_GOOD 0x61 /**<[DF] Power good flag.*/
  162. #define HID_POWER_INTERNAL_FAILURE 0x62 /**<[DF] Inetrnal failure flag.*/
  163. #define HID_POWER_VOLTAGE_OUT_OF_RANGE 0x63 /**<[DF] Voltage out of range flag.*/
  164. #define HID_POWER_FREQUENCY_OUT_OF_RANGE 0x64 /**<[DF] Frequency out of range flag.*/
  165. #define HID_POWER_OVERLOAD 0x65 /**<[DF] Overload flag.*/
  166. #define HID_POWER_OVERCHARGED 0x66 /**<[DF] Overcharged flag.*/
  167. #define HID_POWER_OVERTEMPERATURE 0x67 /**<[DF] Overtemperature flag.*/
  168. #define HID_POWER_SUTDOWN_REQUESTED 0x68 /**<[DF] Shutdown requested flag.*/
  169. #define HID_POWER_SHUTDOWN_IMMINENT 0x69 /**<[DF] Shutdown imminent flag.*/
  170. #define HID_POWER_SWITCH_ON_OFF 0x6B /**<[DF] Switch ON flag.*/
  171. #define HID_POWER_SWITHABLE 0x6C /**<[DF] Swithable flag.*/
  172. #define HID_POWER_USED 0x6D /**<[DF] Used flag.*/
  173. #define HID_POWER_BOOST 0x6E /**<[DF] Voltage boosted flag.*/
  174. #define HID_POWER_BUCK 0x6F /**<[DF] Voltage bucked flag.*/
  175. #define HID_POWER_INITIALIZED 0x70 /**<[DF] Initialized flag.*/
  176. #define HID_POWER_TESTED 0x71 /**<[DF] Tested flag.*/
  177. #define HID_POWER_AWAITING_POWER 0x72 /**<[DF] Awaiting power flag.*/
  178. #define HID_POWER_COMMUNICATION_LOST 0x73 /**<[DF] Communication lost flag.*/
  179. //@}
  180. /**\name Power device identification */
  181. #define HID_POWER_IMANUFACTURER 0xFD /**<[SV] Index of the manufacturer string descriptor.*/
  182. #define HID_POWER_IPRODUCT 0xFE /**<[SV] Index of the prodict string descriptor.*/
  183. #define HID_POWER_ISERIALNUMBER 0xFF /**<[SV] Index of the serial number string descriptor.*/
  184. /**\name Switch ON/OFF/TOGGLE sequence values
  185. * \anchor HID_POWER_SWITCH_VALUES */
  186. #define HID_POWER_STOP_SEQUENCE 0x00 /**<Write value. Stop sequence.*/
  187. #define HID_POWER_START_SEQUENCE 0x01 /**<Write value. Start sequence.*/
  188. #define HID_POWER_SEQUENCE_NONE 0x00 /**<Read value. No sequence.*/
  189. #define HID_POWER_SEQUENCE_STARTED 0x01 /**<Read value. Sequence started.*/
  190. #define HID_POWER_SEQUENCE_INPROGRESS 0x02 /**<Read value. Sequence in progress.*/
  191. #define HID_POWER_SEQUENCE_STOPPED 0x03 /**<Read value. Sequence completed.*/
  192. /**\name Test request/result values
  193. * \anchor HID_POWER_TEST_VALUES */
  194. #define HID_POWER_TEST_NO 0x00 /**<Write value. No test.*/
  195. #define HID_POWER_TEST_QUICK 0x01 /**<Write value. Quck test.*/
  196. #define HID_POWER_TEST_DEEP 0x02 /**<Write value. Deep test.*/
  197. #define HID_POWER_TEST_ABORT 0x03 /**<Write valie. Abort test.*/
  198. #define HID_POWER_TEST_PASSED 0x01 /**<Read value. Test done and passed.*/
  199. #define HID_POWER_TEST_WARNED 0x02 /**<Read value. Test done with warnings.*/
  200. #define HID_POWER_TEST_ERROR 0x03 /**<Read value. Test done with errors.*/
  201. #define HID_POWER_TEST_ABORTED 0x04 /**<Read value. Test aborted.*/
  202. #define HID_POWER_TEST_INPROGRESS 0x05 /**<Read value. Test in progress.*/
  203. #define HID_POWER_TEST_NOT_INITIATED 0x06 /**<Read value. No test inititted.*/
  204. /**\name Module reset values
  205. * \anchor HID_POWER_RESET_VALUES */
  206. #define HID_POWER_RESET_NO 0x00 /**<Read/Write value. No reset.*/
  207. #define HID_POWER_RESET_MODULE 0x01 /**<Read/Write value. Reset module.*/
  208. #define HID_POWER_RESET_ALARMS 0x02 /**<Read/Write value. Reset module's alarms.*/
  209. #define HID_POWER_RESET_COUNTERS 0x03 /**<Read/Write value. Reset module's counters.*/
  210. /**\name Audible alarm values
  211. * \anchor HID_POWER_ALARM_VALUES
  212. * @{ */
  213. #define HID_POWER_ALARM_DISABLED 0x00 /**<Read/Write value. Audible alarm disabled.*/
  214. #define HID_POWER_ALARM_ENABLED 0x01 /**<Read/Write value. Audible alarm enabled.*/
  215. #define HID_POWER_ALARM_MUTED 0x02 /**<Read/Write value. Audible alarm muted.*/
  216. /** @} */
  217. /** @} */
  218. /** \addtogroup HID_BATTERY_DEVICE Battery Device Page
  219. * @{ */
  220. #define HID_BATTERY_PAGE 0x85 /**<[CL] Battery usage page.*/
  221. #define HID_BATTERY_SMB_BATTERY_MODE 0x01 /**<[CL] SMB-specific collection used by the battery for mode setting.*/
  222. #define HID_BATTERY_SMB_BATTERY_STATUS 0x02 /**<[CL] SMB-specific collection used by the battery for Status and Alarm read.*/
  223. #define HID_BATTERY_SMB_ALARM_WARNING 0x03 /**<[CL] SMB-specific collection used by the battery for Alarm transmission to Charger and Host.*/
  224. #define HID_BATTERY_SMB_CHARGER_MODE 0x04 /**<[CL] SMB-specific collection used by the Charger for mode setting.*/
  225. #define HID_BATTERY_SMB_CHARGER_STATUS 0x05 /**<[CL] SMB-specific collection used by the Charger for status transmission.*/
  226. #define HID_BATTERY_SMB_CHARGER_SPECINFO 0x06 /**<[CL] SMB-specific collection used by the Charger for extended status information.*/
  227. #define HID_BATTERY_SMB_SELECTOR_STATE 0x07 /**<[CL] SMB-specific collection to manage Selector Features.*/
  228. #define HID_BATTERY_SMB_SELECTOR_PRESETS 0x08 /**<[CL] SMB-specific collection to select the next battery to power the system in the
  229. * event the current battery is removed or falls below its cutoff voltage.*/
  230. #define HID_BATTERY_SMB_SELECTOR_INFO 0x09 /**<[CL] SMB-specific collection of information used by the host to determine the capabilities of the selector.*/
  231. /**\name Battery system (or selector) settings and controls */
  232. #define HID_BATTERY_OPTIONAL_MFG_FUNC1 0x10 /**<[DV] An optional SMB-manufacturer-specific Read and Write function.*/
  233. #define HID_BATTERY_OPTIONAL_MFG_FUNC2 0x11 /**<[DV] An optional SMB-manufacturer-specific Read and Write function.*/
  234. #define HID_BATTERY_OPTIONAL_MFG_FUNC3 0x12 /**<[DV] An optional SMB-manufacturer-specific Read and Write function.*/
  235. #define HID_BATTERY_OPTIONAL_MFG_FUNC4 0x13 /**<[DV] An optional SMB-manufacturer-specific Read and Write function.*/
  236. #define HID_BATTERY_OPTIONAL_MFG_FUNC5 0x14 /**<[DV] An optional SMB-manufacturer-specific Read and Write function.*/
  237. #define HID_BATTERY_CONNECTION_TO_SMBUS 0x15 /**<[DF] State of connection to the system SMBus.*/
  238. #define HID_BATTERY_OUTPUT_CONNECTION 0x16 /**<[DV] Connection status of the specified Output.*/
  239. #define HID_BATTERY_CHARGER_CONNECTION 0x17 /**<[DV] ID of the specified Charger to the specified Battery.*/
  240. #define HID_BATTERY_BATTERY_INSERTION 0x18 /**<[DF] Insertion status of the specified Battery into the system.*/
  241. #define HID_BATTERY_USE_NEXT 0x19 /**<[DF] Whether or not this Battery will be used for next discharge.*/
  242. #define HID_BATTERY_OK_TO_USE 0x1A /**<[DF] Whether or not this Battery is usable.*/
  243. #define HID_BATTERY_BATTERY_SUPPORTED 0x1B /**<[DF] Whether or not this Battery is supported by the selector.*/
  244. #define HID_BATTERY_SELECTOR_REVISION 0x1C /**<[DV] Version of the Smart Battery Selector specification.*/
  245. #define HID_BATTERY_CHARGING_INDICATOR 0x1D /**<[DF] A bit flag that indicates whether the selector reports the charger’s status in the POWERBY nibble of SelectorState.*/
  246. /**\name Battery controls */
  247. #define HID_BATTERY_MANUFACTURER_ACCESS 0x28 /**<[DV] Read/Write according to the Smart Battery Data Specification.*/
  248. #define HID_BATTERY_REMAINING_CAP_LIMIT 0x29 /**<[DV] */
  249. #define HID_BATTERY_REMAINING_TIME_LIMIT 0x2A /**<[DV] */
  250. #define HID_BATTERY_ATRATE 0x2B /**<[DV] */
  251. #define HID_BATTERY_CAPACITY_MODE 0x2C /**<[DV] Battery capacity units. \see \ref HID_BATTERY_CAPACITY_UNITS */
  252. #define HID_BATTERY_BROADCAST_TO_CHARGER 0x2D /**<[DF] Enable broadcast to charger.*/
  253. #define HID_BATTERY_PRIMARY_BATTERY 0x2E /**<[DF] Battery operates in its primary role.*/
  254. #define HID_BATTERY_CHARGE_CONTROLLER 0x2F /**<[DF] Internal charge control enabled.*/
  255. /**\name Battery status */
  256. #define HID_BATTERY_TERMINATE_CHARGE 0x40 /**<[DF] Terminate charge.*/
  257. #define HID_BATTERY_TERMINATE_DISCHARGE 0x41 /**<[DF] Terminate discharge.*/
  258. #define HID_BATTERY_BELOW_REM_CAP_LIMIT 0x42 /**<[DF] Battery below remained capacity limit.*/
  259. #define HID_BATTERY_REM_TIME_LIMIT_EXPIRED 0x43 /**<[DF] Remaining time limit expired.*/
  260. #define HID_BATTERY_CHARGING 0x44 /**<[DF] Battery charging.*/
  261. #define HID_BATTERY_DISCHARGING 0x45 /**<[DF] Battery discharging.*/
  262. #define HID_BATTERY_FULLY_CHARGED 0x46 /**<[DF] Battery fully charged flag.*/
  263. #define HID_BATTERY_FULLY_DISCHARGED 0x47 /**<[DF] Battery fully discharged flag.*/
  264. #define HID_BATTERY_CONDITIONING_FLAG 0x48 /**<[DF] Battery needs conditioning cycle.*/
  265. #define HID_BATTERY_ATRATE_OK 0x49 /**<[DF] At Rate values recalculated and available.*/
  266. #define HID_BATTERY_SMB_ERROR_CODE 0x4A /**<[DV] An SMB-specific 4-bit error code.*/
  267. #define HID_BATTERY_NEED_REPLACEMENT 0x4B /**<[DF] Battery need replacement flag.*/
  268. /**\name Battery measures */
  269. #define HID_BATTERY_ATRATE_TIME_TO_FILL 0x60 /**<[DV] The predicted remaining time in minutes to fully charge the battery at the AtRate value.*/
  270. #define HID_BATTERY_ATRATE_TIME_TO_EMPTY 0x61 /**<[DV] The predicted operating time if the battery is discharged at the AtRate value.*/
  271. #define HID_BATTERY_AVERAGE_CURRENT 0x62 /**<[DV] An one-minute rolling average of the current being supplied or accepted through the battery terminals.*/
  272. #define HID_BATTERY_MAXERROR 0x63 /**<[DV] The expected margin error (%) in the state of charge calculation.*/
  273. #define HID_BATTERY_REL_STATE_OF_CHARGE 0x64 /**<[DV] The predicted remaining battery capacity expressed as a percentage of the last measured full charge capacity. */
  274. #define HID_BATTERY_ABS_STATE_OF_CHARGE 0x65 /**<[DV] The predicted remaining battery capacity expressed as a percentage of design capacity.*/
  275. #define HID_BATTERY_REMAINING_CAPACITY 0x66 /**<[DV] The predicted remaining capacity.*/
  276. #define HID_BATTERY_FULL_CHARGE_CAPACITY 0x67 /**<[DV] The predicted pack capacity when it is fully charged.*/
  277. #define HID_BATTERY_RUN_TIME_TO_EMPTY 0x68 /**<[DV] The predicted remaining battery life, in minutes, at the present rate of discharge.*/
  278. #define HID_BATTERY_AVG_TIME_TO_EMPTY 0x69 /**<[DV] A one-minute rolling average, in minutes, of the predicted remaining battery time life.*/
  279. #define HID_BATTERY_AVG_TIME_TO_FULL 0x6A /**<[DV] An one-minute rolling average, in minutes, of the predicted remaining time until the battery reaches full charge.*/
  280. #define HID_BATTERY_CYCLE_COUNT 0x6B /**<[DV] The number, in cycles, of charge/discharge cycles the battery has experienced.*/
  281. /**\name Battery settings */
  282. #define HID_BATTERY_BATT_PACK_MODEL_LEVEL 0x80 /**<[SV] Battery model level for the battery pack. \see \ref HID_BATTERY_MODEL_LEVELS */
  283. #define HID_BATTERY_INT_CHARGE_CONTROLLER 0x81 /**<[SF] Charge controller function supported in the battery pack.*/
  284. #define HID_BATTERY_PRIMARY_BATTERY_SUPPORT 0x82 /**<[SF] Primary battery function supported in the battery pack.*/
  285. #define HID_BATTERY_DESIGN_CAPACITY 0x83 /**<[SV] The theoretical capacity of a new pack.*/
  286. #define HID_BATTERY_SPECIFICATION_INFO 0x84 /**<[SV] The version number of the Smart Battery Data Specification.*/
  287. #define HID_BATTERY_MANUFACTURER_DATE 0x85 /**<[SV] The date the pack was manufactured in a packed integer. \see \ref BATTERY_MGF_DATE(y,m,d) */
  288. #define HID_BATTERY_SERIAL_NUMBER 0x86 /**<[SV] The cell pack serial number.*/
  289. #define HID_BATTERY_IMANUFACTURER_NAME 0x87 /**<[SV] Index of a string descriptor containing the battery manufacturer’s name.*/
  290. #define HID_BATTERY_IDEVICE_NAME 0x88 /**<[SV] Index of a string descriptor containing the battery’s name.*/
  291. #define HID_BATTERY_IDEVICE_CHEMISTERY 0x89 /**<[SV] Index of a string descriptor containing the battery’s chemistry.*/
  292. #define HID_BATTERY_MANUFACTURER_DATA 0x8A /**<[SV] A binary data block containing manufacturer specific data.*/
  293. /**\name Battery settings (ACPI specific) */
  294. #define HID_BATTERY_RECHARGEABLE 0x8B /**<[SF] It's a rechargeable battery.*/
  295. #define HID_BATTERY_WARNINIG_CAP_LIMIT 0x8C /**<[SV] OEM-designed battery warning capacity.*/
  296. #define HID_BATTERY_CAP_GRANULARITY1 0x8D /**<[SV] Battery capacity granularity between low and warning.*/
  297. #define HID_BATTERY_CAP_GRANULARITY2 0x8E /**<[SV] Battery capacity granularity between warning and full.*/
  298. #define HID_BATTERY_IOEM_INFORMATION 0x8F /**<[SV] Index of a string descriptor defining OEM specific information for the battery.*/
  299. /**\name Charger controls */
  300. #define HID_BATTERY_INHIBIT_CHARGE 0xC0 /**<[DF] Inhibit charging.*/
  301. #define HID_BATTERY_ENABLE_POLLING 0xC1 /**<[DF] Enable polling.*/
  302. #define HID_BATTERY_RESET_TO_ZERO 0xC2 /**<[DF] Reset Charging Current and Voltage values to zero.*/
  303. /**\name Charger status */
  304. #define HID_BATTERY_AC_PRESENT 0xD0 /**<[DF] AC present.*/
  305. #define HID_BATTERY_BATTERY_PRESENT 0xD1 /**<[DF] Battery present.*/
  306. #define HID_BATTERY_POWER_FAIL 0xD2 /**<[DF] Power fail.*/
  307. #define HID_BATTERY_ALARM_INHIBITED 0xD3 /**<[DF] Alarm inhibited.*/
  308. #define HID_BATTERY_THERMISTOR_UNDER_RANGE 0xD4 /**<[DF] Thermistor under range.*/
  309. #define HID_BATTERY_THERMISTOR_HOT 0xD5 /**<[DF] Thermistor hot.*/
  310. #define HID_BATTERY_THERMISTOR_COLD 0xD6 /**<[DF] Thermistor cold.*/
  311. #define HID_BATTERY_THERMISTOR_OVER_RANGE 0xD7 /**<[DF] Thermistor over range.*/
  312. #define HID_BATTERY_VOLTAGE_OUT_OF_RANGE 0xD8 /**<[DF] Voltage out of range.*/
  313. #define HID_BATTERY_CURRENT_OUT_OF_RANGE 0xD9 /**<[DF] Current out of range.*/
  314. #define HID_BATTERY_CURRENT_NOT_REGULATED 0xDA /**<[DF] Current not regulated.*/
  315. #define HID_BATTERY_VOLTAGE_NOT_REGULATED 0xDB /**<[DF] Voltage not regulated.*/
  316. #define HID_BATTERY_MASTER_MODE 0xDC /**<[DF] Master mode (polling is enabled).*/
  317. /**\name Charger settings */
  318. //@{
  319. #define HID_BATTERY_CHARGER_SELECTOR_SUPP 0xF0 /**<[SF] Charger selector support.*/
  320. #define HID_BATTERY_CHARGER_SPEC 0xF1 /**<[SV] Specification reference. (0001 for SMB charger 1.0).*/
  321. #define HID_BATTERY_LEVEL2 0xF2 /**<[SF] Charger level flag 2*/
  322. #define HID_BATTERY_LEVEL3 0xF3 /**<[SF] Charger level flag 3*/
  323. //@}
  324. /**\name Battery capacity units
  325. * \anchor HID_BATTERY_CAPACITY_UNITS */
  326. //@{
  327. #define HID_BATTERY_CAPACITY_MAH 0x00 /**<Capacity unit is mAH (used in SMB) */
  328. #define HID_BATTERY_CAPACITY_MWH 0x01 /**<Capacity unit is mWH (used in SMB) */
  329. #define HID_BATTERY_CAPACITY_PERCENT 0x02 /**<Capacity unit is percent. */
  330. #define HID_BATTERY_CAPACITY_BOOL 0x03 /**<Boolean unit (OK or not OK) */
  331. //@}
  332. /**\name Battery model levels
  333. * \anchor HID_BATTERY_MODEL_LEVELS */
  334. //@{
  335. #define HID_BATTERY_MODEL_BASIC 0x00 /**<Basic model.*/
  336. #define HID_BATTERY_MODEL_INTELLIGENT 0x01 /**<Intelligent model.*/
  337. #define HID_BATTERY_MODEL_SMART 0x02 /**<Smart battery.*/
  338. //@}
  339. //@}
  340. /** @} */
  341. #endif