Port Entity¶
API Documentation: [cpp] [python] [.NET] [CCA] [REST]
The Port Entity provides control over the most basic items related to a USB Port. This includes actions ranging from a complete port enable and disable to the individual interface control. Voltage and current measurements are also included for devices which support the Port Entity.
Cable flip
Alt mode configuration
Error clearing
Connect mode
SBU enable/disable
Ports are referenced by their instance index port[x] as shown below.
Port Label |
Index (port[x]) |
|---|---|
Mux 0-3 |
0-3 |
Control |
4 |
Common |
5 |
Data and Power Control (Common Port)¶
Enable or disable the entire port, including both data and power lines.
Enable or disable VBUS power only (independent of data path).
Enable or disable USB data lines (both USB 2.0 Hi-Speed and USB 3.x SuperSpeed) without affecting VBUS.
Enable or disable only the USB 2.0 Hi-Speed data lines.
Enable or disable only the USB 3.x SuperSpeed lanes.
Enable or disable both CC lines simultaneously.
Enable or disable individual CC1 / CC2 pins.
Electrical Measurements (Common, Mux, and Control Ports)¶
Voltage (µV)¶
Current (µA)¶
Note
SBU1 / SBU2 expose voltage only.
Port Mode¶
Port Mode provides a higher-level shortcut that bundles these controls into a single bit-mapped configuration, allowing you to enable or disable groups of lines and set routing behaviors in one operation.
Bit |
Port Mode Bit Map |
|---|---|
0 |
Reserved |
1 |
Reserved |
2 |
Keep Alive Charging Enable |
3 |
Reserved |
4 |
HS Data enable |
5 |
Reserved |
6 |
VBUS enable |
7 |
SS Data enable |
8:11 |
Reserved |
12 |
CC1 enable |
13 |
CC2 enable |
14 |
SBU enable |
15 |
CC Flip enable |
16 |
Super-Speed Flip enable |
17 |
SBU Flip enable |
18 |
Hi-Speed Flip enable |
19:31 |
Reserved |
Accumulated Power¶
Reads total accumulated energy (mWh) sourced or sunk on VBUS and VCONN.
Resets accumulated energy and measurement interval.