-
Notifications
You must be signed in to change notification settings - Fork 0
/
usbpd_v3.yaml
754 lines (750 loc) · 18.5 KB
/
usbpd_v3.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
block/USBPD:
description: USBPD protocol.
items:
fieldset/HEADER:
description: Message Header.
bit_size: 16
fields:
- name: EXTENDED
description: Extended message.
bit_offset: 15
bit_size: 1
- name: NUMBER_OF_DATA_OBJECTS
description: Number of data objects.
bit_offset: 12
bit_size: 3
- name: MESSAGE_ID
description: Message ID.
bit_offset: 9
bit_size: 3
- name: PORT_POWER_ROLE
description: Port power role.
bit_offset: 8
bit_size: 1
enum: PORT_POWER_ROLE
- name: SPEC_REVISION
description: Specification revision.
bit_offset: 6
bit_size: 2
enum: SPEC_REVISION
- name: PORT_DATA_ROLE
description: Port data role.
bit_offset: 5
bit_size: 1
enum: PORT_DATA_ROLE
- name: CONTROL_MESSAGE_TYPE
description: Message type.
bit_offset: 0
bit_size: 5
enum: CONTROL_MESSAGE_TYPE
- name: DATA_MESSAGE_TYPE
description: Message type.
bit_offset: 0
bit_size: 5
enum: DATA_MESSAGE_TYPE
- name: EXTENDED_MESSAGE_TYPE
description: Extended message type.
bit_offset: 0
bit_size: 5
enum: EXTENDED_MESSAGE_TYPE
fieldset/EXTENDED_HEADER:
description: Extended message header.
bit_size: 16
fields:
- name: CHUNKED
description: Chunked message.
bit_offset: 15
bit_size: 1
- name: CHUNK_NUMBER
description: Chunk number.
bit_offset: 11
bit_size: 4
- name: REQUEST_CHUNK
description: Request chunk.
bit_offset: 10
bit_size: 1
- name: DATA_SIZE
description: Data size.
bit_offset: 0
bit_size: 8
fieldset/PDO:
description: Power Data Object.
bit_size: 32
fields:
- name: PDO_TYPE
description: Data object type
bit_offset: 30
bit_size: 2
fieldset/FIXED_PDO:
description: Fixed supply PDO.
bit_size: 32
extends: PDO
fields:
- name: DUAL_ROLE_POWER
description: Dual role power.
bit_offset: 29
bit_size: 1
- name: USB_SUSPEND_SUPPORTED
description: USB Suspend supported.
bit_offset: 28
bit_size: 1
- name: UNCONSTRAINED_POWER
description: Unconstrained power.
bit_offset: 27
bit_size: 1
- name: USB_COMMUNICATION_CAPABLE
description: USB communication capable.
bit_offset: 26
bit_size: 1
- name: DUAL_ROLE_DATA
description: Dual role data.
bit_offset: 25
bit_size: 1
- name: UNCHUNKED_EXTENDED_MESSAGES_SUPPORTED
description: Unchunked extended messages supported.
bit_offset: 24
bit_size: 1
- name: EPR_MODE_SUPPORTED
description: Extended power range mode supported.
bit_offset: 23
bit_size: 1
- name: PEAK_CURRENT
description: Peak current.
bit_offset: 20
bit_size: 2
enum: PEAK_CURRENT
- name: VOLTAGE_50MV
description: Voltage in 50mV units.
bit_offset: 10
bit_size: 10
- name: MAX_CURRENT_10MA
description: Maximum current in 10mA units.
bit_offset: 0
bit_size: 10
fieldset/VARIABLE_PDO:
description: Variable supply PDO. (non-battery)
bit_size: 32
extends: PDO
fields:
- name: MAX_VOLTAGE_50MV
description: Maximum voltage in 50mV units.
bit_offset: 20
bit_size: 10
- name: MIN_VOLTAGE_50MV
description: Minimum voltage in 50mV units.
bit_offset: 10
bit_size: 10
- name: MAX_CURRENT_10MA
description: Maximum current in 10mA units.
bit_offset: 0
bit_size: 10
fieldset/BATTERY_PDO:
description: Battery supply PDO.
bit_size: 32
extends: PDO
fields:
- name: MAX_VOLTAGE_50MV
description: Maximum voltage in 50mV units.
bit_offset: 20
bit_size: 10
- name: MIN_VOLTAGE_50MV
description: Minimum voltage in 50mV units.
bit_offset: 10
bit_size: 10
- name: MAX_POWER_250MW
description: Maximum power in 250mW units.
bit_offset: 0
bit_size: 10
fieldset/APDO:
description: Augmented Power Data Object.
bit_size: 32
extends: PDO
fields:
- name: APDO_TYPE
description: Augmented PDO type.
bit_offset: 28
bit_size: 2
fieldset/SPR_PPS_APDO:
description: SPR Programmable Power Supply. (PPS)
bit_size: 32
extends: APDO
fields:
- name: PPS_POWER_LIMITED
description: PPS power limited.
bit_offset: 27
bit_size: 1
- name: MAX_VOLTAGE_100MV
description: Maximum voltage in 100mV units.
bit_offset: 17
bit_size: 8
- name: MIN_VOLTAGE_100MV
description: Minimum voltage in 100mV units.
bit_offset: 8
bit_size: 8
- name: MAX_CURRENT_50MA
description: Maximum current in 50mA units.
bit_offset: 0
bit_size: 7
fieldset/EPR_AVS_APDO:
description: Extended Power Range(EPR) Adjustable Voltage Supply.
bit_size: 32
extends: APDO
fields:
- name: PEAK_CURRENT
description: Peak current.
bit_offset: 26
bit_size: 2
enum: PEAK_CURRENT
- name: MAX_VOLTAGE_100MV
description: Maximum voltage in 100mV units.
bit_offset: 17
bit_size: 8
- name: MIN_VOLTAGE_100MV
description: Minimum voltage in 100mV units.
bit_offset: 8
bit_size: 8
- name: POWER_1W
description: PDP in 1W units.
bit_offset: 0
bit_size: 8
fieldset/SPR_AVS_APDO:
description: Standard Power Range (SPR) Adjustable Voltage Supply.
bit_size: 32
extends: APDO
fields:
- name: PEAK_CURRENT
description: Peak current.
bit_offset: 26
bit_size: 2
enum: PEAK_CURRENT
- name: MAX_CURRENT_FOR_15V_10MA
description: Maximum current in 10mA units for 9V-15V.
bit_offset: 10
bit_size: 10
- name: MAX_CURRENT_FOR_20V_10MA
description: Maximum current in 10mA units for 15V-20V.
bit_offset: 0
bit_size: 10
fieldset/EPRMOD:
description: Table 6.51 “EPR Mode Data Object (EPRMDO)”
bit_size: 32
fields:
- name: ACTION
description: Action
bit_offset: 24
bit_size: 8
enum: EPRMOD_ACTION
- name: DATA
description: EPR Mode Data
bit_offset: 16
bit_size: 8
# Sink only PDO
fieldset/FIXED_PDO_SINK:
description: Fixed supply PDO for sink.
bit_size: 32
extends: PDO
fields:
- name: DUAL_ROLE_POWER
description: Dual role power.
bit_offset: 29
bit_size: 1
- name: HIGH_CAPABILITY
description: High capability.
bit_offset: 28
bit_size: 1
- name: UNCONSTRAINED_POWER
description: Unconstrained power.
bit_offset: 27
bit_size: 1
- name: USB_COMMUNICATION_CAPABLE
description: USB communication capable.
bit_offset: 26
bit_size: 1
- name: DUAL_ROLE_DATA
description: Dual role data.
bit_offset: 25
bit_size: 1
- name: FAST_SWAP_CURRENT
description: Fast Role Swap required USB Type-C® Current
bit_offset: 23
bit_size: 2
- name: VOLTAGE_50MV
description: Voltage in 50mV units.
bit_offset: 10
bit_size: 10
- name: CURRENT_10MA
description: Operating current in 10mA units.
bit_offset: 0
bit_size: 10
# RDO
fieldset/RDO:
description: Request Data Object.
bit_size: 32
fields:
- name: OBJECT_POSITION
description: Object position
bit_offset: 28
bit_size: 3
- name: CAPABILITY_MISMATCH
description: Capability mismatch
bit_offset: 26
bit_size: 1
- name: USB_COMMUNICATION_CAPABLE
description: USB communication capable
bit_offset: 25
bit_size: 1
- name: NO_USB_SUSPEND
description: No USB suspend
bit_offset: 24
bit_size: 1
- name: UNCHUNKED_EXTENDED_MESSAGES_SUPPORTED
description: Unchunked extended messages supported
bit_offset: 23
bit_size: 1
- name: EPR_MODE_CAPABLE
description: EPR mode capable
bit_offset: 22
bit_size: 1
fieldset/FIXED_RDO:
description: Table 6.22 “Fixed and Variable Request Data Object”
bit_size: 32
extends: RDO
fields:
- name: GIVE_BACK
description: Give back flag
bit_offset: 27
bit_size: 1
- name: CURRENT_10MA
description: Operating current in 10mA units
bit_offset: 10
bit_size: 10
- name: MINMAX_CURRENT_10MA
description: Minimum/Maximum operating current in 10mA units
bit_offset: 0
bit_size: 10
fieldset/BATTERY_RDO:
description: Table 6.24 “Battery Request Data Object”
bit_size: 32
extends: RDO
fields:
- name: GIVE_BACK
description: Give back flag
bit_offset: 27
bit_size: 1
- name: POWER_250MW
description: Operating power in 250mW units
bit_offset: 10
bit_size: 10
- name: MINMAX_POWER_250MW
description: Minimum/Maximum operating power in 250mW units
bit_offset: 0
bit_size: 10
fieldset/PPS_RDO:
description: Table 6.26 “PPS Request Data Object”
bit_size: 32
extends: RDO
fields:
- name: VOLTAGE_20MV
description: Output voltage in 20mV units
bit_offset: 9
bit_size: 12
- name: CURRENT_50MA
description: Operating current in 50mA units
bit_offset: 0
bit_size: 7
fieldset/AVS_RDO:
description: Table 6.28 “AVS Request Data Object”
bit_size: 32
extends: RDO
fields:
- name: VOLTAGE_25MV
description: Output voltage in 25mV units (LSB 2bits are 0)
bit_offset: 9
bit_size: 12
- name: CURRENT_50MA
description: Operating current in 50mA units
bit_offset: 0
bit_size: 7
fieldset/BSDO:
description: Table 6.47 “Battery Status Data Object (BSDO)”
bit_size: 32
fields:
- name: BATTERY_CAPACITY
description: Battery capacity
bit_offset: 16
bit_size: 16
# BATTERY_INFO
- name: INVALID
description: Invalid
bit_offset: 8
bit_size: 1
- name: BATTERY_PRESENT
description: Battery present
bit_offset: 9
bit_size: 1
- name: CHARGING_STATUS
description: Charging status
bit_offset: 10
bit_size: 2
enum: BSDO_BATTERY_CHARGING_STATUS
fieldset/ADO:
description: Table 6.48 “Alert Data Object (ADO)”
bit_size: 32
fields:
# Type of Alart
- name: BATTERY_STATUS_CHANGE
description: Battery status change
bit_offset: 25
bit_size: 1
- name: OCP
description: Over current protection
bit_offset: 26
bit_size: 1
- name: OTP
description: Over temperature protection
bit_offset: 27
bit_size: 1
- name: OPERATING_CONDITION_CHANGE
description: Operating condition change
bit_offset: 28
bit_size: 1
- name: SOURCE_INPUT_CHANGE
description: Source input change
bit_offset: 29
bit_size: 1
- name: OVP
description: Over voltage protection
bit_offset: 30
bit_size: 1
- name: EXTENDED
description: Extended altert event
bit_offset: 31
bit_size: 1
# Type of Alter ends
- name: FIXED_BATTERIES
description: Battery number, 0 to 3
bit_offset: 20
bit_size: 4
- name: HOT_SWAPPABLE_BATTERYIES
description: Hot swappable batterie number, 4 to 7
bit_offset: 16
bit_size: 4
- name: EXTENDED_TYPE
description: Extended alert type
bit_offset: 0
bit_size: 4
enum: ADO_EXTENDED_TYPE
fieldset/VDM_HEADER:
description: VDM Header
bit_size: 32
fields:
- name: VID
description: USB Vendor ID
bit_offset: 16
bit_size: 16
- name: TYPE
description: VDM Type
bit_offset: 15
bit_size: 1
fieldset/STRUCTURED_VDM_HEADER:
description: Structured VDM Header
bit_size: 32
extends: VDM_HEADER
fields:
- name: MAJOR_VERSION
description: Major version
bit_offset: 13
bit_size: 2
- name: MINOR_VERSION
description: Minor version
bit_offset: 11
bit_size: 2
- name: OBJECT_POSITION
description: Object position
bit_offset: 8
bit_size: 3
- name: COMMAND_TYPE
description: Command type
bit_offset: 6
bit_size: 2
- name: COMMAND
description: Command
bit_offset: 0
bit_size: 5
enum: VDM_COMMAND_TYPE
enum/PDO_TYPE:
bit_size: 2
variants:
- name: FIXED
description: Fixed supply
value: 0
- name: BATTERY
description: Battery
value: 1
- name: VARIABLE
description: Variable supply
value: 2
- name: AUGMENTED
description: Augmented PDO
value: 3
enum/APDO_TYPE:
bit_size: 2
variants:
- name: SPR_PPS
description: Standard Power Range, Programmable Power Supply
value: 0
- name: EPR_AVS
description: Extended Power Range, Adjustable Voltage Supply
value: 1
- name: SPR_AVS
description: Standard Power Range, Adjustable Voltage Supply
value: 2
enum/PORT_POWER_ROLE:
bit_size: 1
variants:
- name: SINK
description: Sink
value: 0
- name: SOURCE
description: Source
value: 1
enum/PORT_DATA_ROLE:
bit_size: 1
variants:
- name: UFP
description: UFP
value: 0
- name: DFP
description: DFP
value: 1
enum/SPEC_REVISION:
bit_size: 2
variants:
- name: R1_0
description: Revision 1.0
value: 0b00
- name: R2_0
description: Revision 2.0
value: 0b01
- name: R3_0
description: Revision 3.0
value: 0b10
enum/CONTROL_MESSAGE_TYPE:
bit_size: 5
variants:
- name: GoodCRC
description: GoodCRC
value: 0b00000
- name: GotoMin
description: GotoMin
value: 0b00001
- name: Accept
description: Accept
value: 0b00010
- name: Reject
description: Reject
value: 0b00011
- name: Ping
description: Ping
value: 0b00100
- name: PS_RDY
description: PS_RDY
value: 0b00101
- name: Get_Source_Cap
description: Get_Source_Cap
value: 0b00110
- name: Get_Sink_Cap
description: Get_Sink_Cap
value: 0b00111
- name: DR_Swap
description: DR_Swap
value: 0b01000
- name: PR_Swap
description: PR_Swap
value: 0b01001
- name: VCONN_Swap
description: VCONN_Swap
value: 0b01010
- name: Wait
description: Wait
value: 0b01011
- name: Soft_Reset
description: Soft_Reset
value: 0b01100
- name: Not_Supported
description: Not_Supported
value: 0b10000
- name: Get_Source_Cap_Extended
description: Get_Source_Cap_Extended
value: 0b10001
- name: Get_Status
description: Get_Status
value: 0b10010
- name: FR_Swap
description: FR_Swap
value: 0b10011
- name: Get_PPS_Status
description: Get_PPS_Status
value: 0b10100
- name: Get_Country_Codes
description: Get_Country_Codes
value: 0b10101
- name: Get_Sink_Cap_Extended
description: Get_Sink_Cap_Extended
value: 0b10110
- name: Get_Source_Info
description: Get_Source_Info
value: 0b10111
- name: Get_Revision
description: Get_Revision
value: 0b11000
enum/DATA_MESSAGE_TYPE:
bit_size: 5
variants:
- name: Source_Capabilities
description: Source_Capabilities
value: 0b00001
- name: Request
description: Request
value: 0b00010
- name: BIST
description: BIST
value: 0b00011
- name: Sink_Capabilities
description: Sink_Capabilities
value: 0b00100
- name: Battery_Status
description: Battery_Status
value: 0b00101
- name: Alert
description: Alert
value: 0b00110
- name: Get_Country_Info
description: Get_Country_Info
value: 0b00111
- name: Enter_USB
description: Enter_USB
value: 0b01000
- name: EPR_Request
description: EPR_Request
value: 0b01001
- name: EPR_Mode
description: EPR_Mode
value: 0b01010
- name: Source_Info
description: Source_Info
value: 0b01011
- name: Revision
description: Revision
value: 0b01100
- name: Vendor_Defined
description: Vendor_Defined
value: 0b01111
enum/EXTENDED_MESSAGE_TYPE:
description: Table 6.54 “Extended Message Types”
bit_size: 5
variants:
- name: Source_Capabilities_Extended
value: 0b00001
- name: Status
value: 0b00010
- name: Get_Battery_Cap
value: 0b00011
- name: Get_Battery_Status
value: 0b00100
- name: Battery_Capabilities
value: 0b00101
- name: Get_Manufacturer_Info
value: 0b00110
- name: Manufacturer_Info
value: 0b00111
- name: Security_Request
value: 0b01000
- name: Security_Response
value: 0b01001
- name: Firmware_Update_Request
value: 0b01010
- name: Firmware_Update_Response
value: 0b01011
- name: PPS_Status
value: 0b01100
- name: Country_Info
value: 0b01101
- name: Country_Codes
value: 0b01110
- name: Sink_Capabilities_Extended
value: 0b01111
- name: Extended_Control
value: 0b10000
- name: EPR_Source_Capabilities
value: 0b10001
- name: EPR_Sink_Capabilities
value: 0b10010
enum/PEAK_CURRENT:
bit_size: 2
variants:
- name: DEFAULT
description:
value: 0b00
- name: LowOverload
description:
value: 0b01
- name: MediumOverload
description:
value: 0b10
- name: HighOverload
description:
value: 0b11
enum/EPRMOD_ACTION:
bit_size: 8
variants:
- name: ENTER
description: Enter (Sink Only)
value: 0x01
- name: ENTER_ACKNOWLEDGED
description: Enter Acknowledged (Source Only)
value: 0x02
- name: ENTER_SUCCEEDED
description: Enter Succeeded (Source Only)
value: 0x03
- name: ENTER_FAILED
description: Enter Failed (Source Only)
value: 0x04
- name: EXIT
description: Exit (Sink or Source)
value: 0x05
enum/BSDO_BATTERY_CHARGING_STATUS:
bit_size: 2
variants:
- name: Charging
value: 0b00
- name: Discharging
value: 0b01
- name: Idle
value: 0b10
enum/ADO_EXTENDED_TYPE:
bit_size: 4
variants:
- name: DFP_Power_State_Change
value: 1
- name: UFP_Power_Button_Press
value: 2
- name: UFP_Power_Button_Release
value: 3
- name: UFP_Wake
value: 4
enum/VDM_COMMAND_TYPE:
bit_size: 5
variants:
- name: Discover_Identity
value: 0b00001
- name: Discover_SVIDs
value: 0b00010
- name: Discover_Modes
value: 0b00011
- name: Enter_Modal
value: 0b00100
- name: Exit_Modal
value: 0b00101
- name: Attention
value: 0b00110