Lightweight USB stack  1.0
hid_usage_power.h
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 
16 #ifndef _USB_HID_POWER_DEVICES_H_
17 #define _USB_HID_POWER_DEVICES_H_
18 
44 #define HID_POWER_UNIT_AC_VOLTAGE 0x67, 0x21, 0xD1, 0xF0, 0x00, 0x55, 0x07
45 
46 #define HID_POWER_UNIT_AC_CURRENT 0x67, 0x01, 0x00, 0x10, 0x00, 0x55, 0xFE
47 
48 #define HID_POWER_UNIT_FREQUENCY 0x66, 0x01, 0xF0, 0x55, 0x00
49 
50 #define HID_POWER_UNIT_DC_VOLTAGE 0x67, 0x21, 0xD1, 0xF0, 0x00, 0x55, 0x07
51 
52 #define HID_POWER_UNIT_TIME 0x66, 0x01, 0x10, 0x55, 0x00
53 
54 #define HID_POWER_UNIT_DC_CURRENT 0x67, 0x01, 0x00, 0x10, 0x00, 0x55, 0xFE
55 
56 #define HID_POWER_UNIT_POWER 0x66, 0x21, 0xD1, 0x55, 0x07
57 
58 #define HID_POWER_UNIT_TEMPERATURE 0x67, 0x01, 0x00, 0x01, 0x00, 0x55, 0x00
59 
60 #define HID_POWER_UNIT_BATTERY_CAPACITY 0x67, 0x01, 0x10, 0x10, 0x00, 0x55, 0x00
61 
62 
67 #define BATTERY_MGF_DATE(y,m,d) (((((y) - 1980) & 0x7F) << 9) + (((m) & 0x0F) << 5) + ((d) & 0x1F))
68 
71 #define HID_POWER_PAGE 0x84
74 #define HID_POWER_INAME 0x01
75 #define HID_POWER_PRESENT_STATUS 0x02
76 #define HID_POWER_CHANGED_STATUS 0x03
77 #define HID_POWER_UPS 0x04
78 #define HID_POWER_POWER_SUPPLY 0x05
79 #define HID_POWER_BATTERY_SYSTEM 0x10
80 #define HID_POWER_BATTERY_SYSTEM_ID 0x11
81 #define HID_POWER_BATTERY 0x12
82 #define HID_POWER_BATTERY_ID 0x13
83 #define HID_POWER_CHARGER 0x14
84 #define HID_POWER_CHARGER_ID 0x15
85 #define HID_POWER_POWER_CONVERTER 0x16
86 #define HID_POWER_POWER_CONVERTER_ID 0x17
87 #define HID_POWER_OUTLET_SYSTEM 0x18
88 #define HID_POWER_OUTLET_SYSTEM_ID 0x19
89 #define HID_POWER_INPUT 0x1A
90 #define HID_POWER_INPUT_ID 0x1B
91 #define HID_POWER_OUTPUT 0x1C
92 #define HID_POWER_OUTPUT_ID 0x1D
93 #define HID_POWER_FLOW 0x1E
94 #define HID_POWER_FLOW_ID 0x1F
95 #define HID_POWER_OUTLET 0x20
96 #define HID_POWER_OUTLET_ID 0x21
97 #define HID_POWER_GANG 0x22
98 #define HID_POWER_GANG_ID 0x23
99 #define HID_POWER_POWER_SUMMARY 0x24
100 #define HID_POWER_POWER_SUMMARY_ID 0x25
104 #define HID_POWER_VOLTAGE 0x30
105 #define HID_POWER_CURRENT 0x31
106 #define HID_POWER_FREQUENCY 0x32
107 #define HID_POWER_APPARENT_POWER 0x33
108 #define HID_POWER_ACTIVE_POWER 0x34
109 #define HID_POWER_PERCENT_LOAD 0x35
110 #define HID_POWER_TEMPERATURE 0x36
111 #define HID_POWER_HUMIDITY 0x37
112 #define HID_POWER_BAD_COUNT 0x38
116 #define HID_POWER_CONFIG_VOLTAGE 0x40
117 #define HID_POWER_CONFIG_CURRENT 0x41
118 #define HID_POWER_CONFIG_FREQUENCY 0x42
119 #define HID_POWER_CONFIG_APPARENT_POWER 0x43
120 #define HID_POWER_CONFIG_ACTIVE_POWER 0x44
121 #define HID_POWER_CONFIG_PERCENT_LOAD 0x45
122 #define HID_POWER_CONFIG_TEMPERATURE 0x46
123 #define HID_POWER_CONFIG_HUMIDITY 0x47
127 #define HID_POWER_SWITCH_ON_CONTROL 0x50
128 #define HID_POWER_SWITCH_OFF_CONTROL 0x51
129 #define HID_POWER_TOGGLE_CONTROL 0x52
130 #define HID_POWER_LOW_VOLTAGE_TRANSFER 0x53
131 #define HID_POWER_HIGH_VOLTAGE_TRANSFER 0x54
132 #define HID_POWER_DELAY_BEFORE_REBOOT 0x55
141 #define HID_POWER_DELAY_BEFORE_STARTUP 0x56
150 #define HID_POWER_DELAY_BEFORE_SHUTDOWN 0x57
159 #define HID_POWER_TEST 0x58
160 #define HID_POWER_MODULE_RESET 0x59
161 #define HID_POWER_AUDIBLE_ALARM_CONTROL 0x5A
165 #define HID_POWER_PRESENT 0x60
166 #define HID_POWER_GOOD 0x61
167 #define HID_POWER_INTERNAL_FAILURE 0x62
168 #define HID_POWER_VOLTAGE_OUT_OF_RANGE 0x63
169 #define HID_POWER_FREQUENCY_OUT_OF_RANGE 0x64
170 #define HID_POWER_OVERLOAD 0x65
171 #define HID_POWER_OVERCHARGED 0x66
172 #define HID_POWER_OVERTEMPERATURE 0x67
173 #define HID_POWER_SUTDOWN_REQUESTED 0x68
174 #define HID_POWER_SHUTDOWN_IMMINENT 0x69
175 #define HID_POWER_SWITCH_ON_OFF 0x6B
176 #define HID_POWER_SWITHABLE 0x6C
177 #define HID_POWER_USED 0x6D
178 #define HID_POWER_BOOST 0x6E
179 #define HID_POWER_BUCK 0x6F
180 #define HID_POWER_INITIALIZED 0x70
181 #define HID_POWER_TESTED 0x71
182 #define HID_POWER_AWAITING_POWER 0x72
183 #define HID_POWER_COMMUNICATION_LOST 0x73
186 #define HID_POWER_IMANUFACTURER 0xFD
187 #define HID_POWER_IPRODUCT 0xFE
188 #define HID_POWER_ISERIALNUMBER 0xFF
191 #define HID_POWER_STOP_SEQUENCE 0x00
192 #define HID_POWER_START_SEQUENCE 0x01
193 #define HID_POWER_SEQUENCE_NONE 0x00
194 #define HID_POWER_SEQUENCE_STARTED 0x01
195 #define HID_POWER_SEQUENCE_INPROGRESS 0x02
196 #define HID_POWER_SEQUENCE_STOPPED 0x03
199 #define HID_POWER_TEST_NO 0x00
200 #define HID_POWER_TEST_QUICK 0x01
201 #define HID_POWER_TEST_DEEP 0x02
202 #define HID_POWER_TEST_ABORT 0x03
203 #define HID_POWER_TEST_PASSED 0x01
204 #define HID_POWER_TEST_WARNED 0x02
205 #define HID_POWER_TEST_ERROR 0x03
206 #define HID_POWER_TEST_ABORTED 0x04
207 #define HID_POWER_TEST_INPROGRESS 0x05
208 #define HID_POWER_TEST_NOT_INITIATED 0x06
212 #define HID_POWER_RESET_NO 0x00
213 #define HID_POWER_RESET_MODULE 0x01
214 #define HID_POWER_RESET_ALARMS 0x02
215 #define HID_POWER_RESET_COUNTERS 0x03
220 #define HID_POWER_ALARM_DISABLED 0x00
221 #define HID_POWER_ALARM_ENABLED 0x01
222 #define HID_POWER_ALARM_MUTED 0x02
228 #define HID_BATTERY_PAGE 0x85
229 #define HID_BATTERY_SMB_BATTERY_MODE 0x01
230 #define HID_BATTERY_SMB_BATTERY_STATUS 0x02
231 #define HID_BATTERY_SMB_ALARM_WARNING 0x03
232 #define HID_BATTERY_SMB_CHARGER_MODE 0x04
233 #define HID_BATTERY_SMB_CHARGER_STATUS 0x05
234 #define HID_BATTERY_SMB_CHARGER_SPECINFO 0x06
235 #define HID_BATTERY_SMB_SELECTOR_STATE 0x07
236 #define HID_BATTERY_SMB_SELECTOR_PRESETS 0x08
238 #define HID_BATTERY_SMB_SELECTOR_INFO 0x09
240 #define HID_BATTERY_OPTIONAL_MFG_FUNC1 0x10
241 #define HID_BATTERY_OPTIONAL_MFG_FUNC2 0x11
242 #define HID_BATTERY_OPTIONAL_MFG_FUNC3 0x12
243 #define HID_BATTERY_OPTIONAL_MFG_FUNC4 0x13
244 #define HID_BATTERY_OPTIONAL_MFG_FUNC5 0x14
245 #define HID_BATTERY_CONNECTION_TO_SMBUS 0x15
246 #define HID_BATTERY_OUTPUT_CONNECTION 0x16
247 #define HID_BATTERY_CHARGER_CONNECTION 0x17
248 #define HID_BATTERY_BATTERY_INSERTION 0x18
249 #define HID_BATTERY_USE_NEXT 0x19
250 #define HID_BATTERY_OK_TO_USE 0x1A
251 #define HID_BATTERY_BATTERY_SUPPORTED 0x1B
252 #define HID_BATTERY_SELECTOR_REVISION 0x1C
253 #define HID_BATTERY_CHARGING_INDICATOR 0x1D
255 #define HID_BATTERY_MANUFACTURER_ACCESS 0x28
256 #define HID_BATTERY_REMAINING_CAP_LIMIT 0x29
257 #define HID_BATTERY_REMAINING_TIME_LIMIT 0x2A
258 #define HID_BATTERY_ATRATE 0x2B
259 #define HID_BATTERY_CAPACITY_MODE 0x2C
260 #define HID_BATTERY_BROADCAST_TO_CHARGER 0x2D
261 #define HID_BATTERY_PRIMARY_BATTERY 0x2E
262 #define HID_BATTERY_CHARGE_CONTROLLER 0x2F
264 #define HID_BATTERY_TERMINATE_CHARGE 0x40
265 #define HID_BATTERY_TERMINATE_DISCHARGE 0x41
266 #define HID_BATTERY_BELOW_REM_CAP_LIMIT 0x42
267 #define HID_BATTERY_REM_TIME_LIMIT_EXPIRED 0x43
268 #define HID_BATTERY_CHARGING 0x44
269 #define HID_BATTERY_DISCHARGING 0x45
270 #define HID_BATTERY_FULLY_CHARGED 0x46
271 #define HID_BATTERY_FULLY_DISCHARGED 0x47
272 #define HID_BATTERY_CONDITIONING_FLAG 0x48
273 #define HID_BATTERY_ATRATE_OK 0x49
274 #define HID_BATTERY_SMB_ERROR_CODE 0x4A
275 #define HID_BATTERY_NEED_REPLACEMENT 0x4B
277 #define HID_BATTERY_ATRATE_TIME_TO_FILL 0x60
278 #define HID_BATTERY_ATRATE_TIME_TO_EMPTY 0x61
279 #define HID_BATTERY_AVERAGE_CURRENT 0x62
280 #define HID_BATTERY_MAXERROR 0x63
281 #define HID_BATTERY_REL_STATE_OF_CHARGE 0x64
282 #define HID_BATTERY_ABS_STATE_OF_CHARGE 0x65
283 #define HID_BATTERY_REMAINING_CAPACITY 0x66
284 #define HID_BATTERY_FULL_CHARGE_CAPACITY 0x67
285 #define HID_BATTERY_RUN_TIME_TO_EMPTY 0x68
286 #define HID_BATTERY_AVG_TIME_TO_EMPTY 0x69
287 #define HID_BATTERY_AVG_TIME_TO_FULL 0x6A
288 #define HID_BATTERY_CYCLE_COUNT 0x6B
290 #define HID_BATTERY_BATT_PACK_MODEL_LEVEL 0x80
291 #define HID_BATTERY_INT_CHARGE_CONTROLLER 0x81
292 #define HID_BATTERY_PRIMARY_BATTERY_SUPPORT 0x82
293 #define HID_BATTERY_DESIGN_CAPACITY 0x83
294 #define HID_BATTERY_SPECIFICATION_INFO 0x84
295 #define HID_BATTERY_MANUFACTURER_DATE 0x85
296 #define HID_BATTERY_SERIAL_NUMBER 0x86
297 #define HID_BATTERY_IMANUFACTURER_NAME 0x87
298 #define HID_BATTERY_IDEVICE_NAME 0x88
299 #define HID_BATTERY_IDEVICE_CHEMISTERY 0x89
300 #define HID_BATTERY_MANUFACTURER_DATA 0x8A
302 #define HID_BATTERY_RECHARGEABLE 0x8B
303 #define HID_BATTERY_WARNINIG_CAP_LIMIT 0x8C
304 #define HID_BATTERY_CAP_GRANULARITY1 0x8D
305 #define HID_BATTERY_CAP_GRANULARITY2 0x8E
306 #define HID_BATTERY_IOEM_INFORMATION 0x8F
308 #define HID_BATTERY_INHIBIT_CHARGE 0xC0
309 #define HID_BATTERY_ENABLE_POLLING 0xC1
310 #define HID_BATTERY_RESET_TO_ZERO 0xC2
312 #define HID_BATTERY_AC_PRESENT 0xD0
313 #define HID_BATTERY_BATTERY_PRESENT 0xD1
314 #define HID_BATTERY_POWER_FAIL 0xD2
315 #define HID_BATTERY_ALARM_INHIBITED 0xD3
316 #define HID_BATTERY_THERMISTOR_UNDER_RANGE 0xD4
317 #define HID_BATTERY_THERMISTOR_HOT 0xD5
318 #define HID_BATTERY_THERMISTOR_COLD 0xD6
319 #define HID_BATTERY_THERMISTOR_OVER_RANGE 0xD7
320 #define HID_BATTERY_VOLTAGE_OUT_OF_RANGE 0xD8
321 #define HID_BATTERY_CURRENT_OUT_OF_RANGE 0xD9
322 #define HID_BATTERY_CURRENT_NOT_REGULATED 0xDA
323 #define HID_BATTERY_VOLTAGE_NOT_REGULATED 0xDB
324 #define HID_BATTERY_MASTER_MODE 0xDC
327 #define HID_BATTERY_CHARGER_SELECTOR_SUPP 0xF0
328 #define HID_BATTERY_CHARGER_SPEC 0xF1
329 #define HID_BATTERY_LEVEL2 0xF2
330 #define HID_BATTERY_LEVEL3 0xF3
332 
336 #define HID_BATTERY_CAPACITY_MAH 0x00
337 #define HID_BATTERY_CAPACITY_MWH 0x01
338 #define HID_BATTERY_CAPACITY_PERCENT 0x02
339 #define HID_BATTERY_CAPACITY_BOOL 0x03
345 #define HID_BATTERY_MODEL_BASIC 0x00
346 #define HID_BATTERY_MODEL_INTELLIGENT 0x01
347 #define HID_BATTERY_MODEL_SMART 0x02
350 
351 
354 #endif