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.

Port Enable/Disable (Get/Set)

port [index] . getEnabled <= (unsigned char) enabled
port [index] . setEnabled => (unsigned char) enabled

Provides control (Set) and monitoring (Get) over an entire port for a provided index (Power, Data, CC and Vconn). Values either passed in or returned are treated as boolean values.

Power Enable/Disable (Get/Set)

port [index] . getPowerEnabled <= (unsigned char) enabled
port [index] . setPowerEnabled => (unsigned char) enabled

Provides control (Set) and monitoring (Get) over the power for a provided index (Vbus). Values either passed in or returned are treated as boolean values.

Data Enable/Disable (Get/Set)

port [index] . getDataEnabled <= (unsigned char) enabled
port [index] . setDataEnabled => (unsigned char) enabled

Provides control (Set) and monitoring (Get) over the data lines for a provided index (High Speed (HS) and Super Speed (SS)). Values either passed in or returned are treated as boolean values.

High Speed (HS) Data Enable/Disable (Get/Set)

port [index] . getDataHSEnabled <= (unsigned char) enabled
port [index] . setDataHSEnabled => (unsigned char) enabled

Provides control (Set) and monitoring (Get) over the High Speed (HS) data lines for a provided index (HS1 and HS2). Values either passed in or returned are treated as boolean values.

High Speed 1 (HS1) Data Enable/Disable (Get/Set)

port [index] . getDataHS1Enabled <= (unsigned char) enabled
port [index] . setDataHS1Enabled => (unsigned char) enabled

Provides control (Set) and monitoring (Get) over the High Speed 1 (HS1) data lines for a provided index. Values either passed in or returned are treated as boolean values.

High Speed 2 (HS2) Data Enable/Disable (Get/Set)

port [index] . getDataHS2Enabled <= (unsigned char) enabled
port [index] . setDataHS2Enabled => (unsigned char) enabled

Provides control (Set) and monitoring (Get) over the High Speed 2 (HS2) data lines for a provided index. Values either passed in or returned are treated as boolean values.

Super Speed (SS) Data Enable/Disable (Get/Set)

port [index] . getDataSSEnabled <= (unsigned char) enabled
port [index] . setDataSSEnabled => (unsigned char) enabled

Provides control (Set) and monitoring (Get) over the Super Speed (SS) data lines for a provided index (SS1 and SS2). Values either passed in or returned are treated as boolean values.

Super Speed 1 (SS1) Data Enable/Disable (Get/Set)

port [index] . getDataSS1Enabled <= (unsigned char) enabled
port [index] . setDataSS1Enabled => (unsigned char) enabled

Provides control (Set) and monitoring (Get) over the Super Speed 1 (SS1) data lines for a provided index. Values either passed in or returned are treated as boolean values.

Super Speed 2 (SS2) Data Enable/Disable (Get/Set)

port [index] . getDataSS2Enabled <= (unsigned char) enabled
port [index] . setDataSS2Enabled => (unsigned char) enabled

Provides control (Set) and monitoring (Get) over the Super Speed 2 (SS2) data lines for a provided index. Values either passed in or returned are treated as boolean values.

Vconn Enable/Disable (Get/Set)

port [index] . getVconnEnabled <= (unsigned char) enabled
port [index] . setVconnEnabled => (unsigned char) enabled

Provides control (Set) and monitoring (Get) over the Vconn lines for a provided index (Vconn1 and Vconn2 (only one ever exists)). Values either passed in or returned are treated as boolean values.

Vconn 1 Enable/Disable (Get/Set)

port [index] . getVconn1Enabled <= (unsigned char) enabled
port [index] . setVconn1Enabled => (unsigned char) enabled

Provides control (Set) and monitoring (Get) over the Vconn 1 lines for a provided index. Values either passed in or returned are treated as boolean values.

Vconn 2 Enable/Disable (Get/Set)

port [index] . getVconn2Enabled <= (unsigned char) enabled
port [index] . setVconn2Enabled => (unsigned char) enabled

Provides control (Set) and monitoring (Get) over the Vconn 2 lines for a provided index. Values either passed in or returned are treated as boolean values.

CC Enable/Disable (Get/Set)

port [index] . getCCEnabled <= (unsigned char) enabled
port [index] . setCCEnabled => (unsigned char) enabled

Provides control (Set) and monitoring (Get) over the CC lines for a provided index (CC1 and CC2). Values either passed in or returned are treated as boolean values.

CC 1 Enable/Disable (Get/Set)

port [index] . getCC1Enabled <= (unsigned char) enabled
port [index] . setCC1Enabled => (unsigned char) enabled

Provides control (Set) and monitoring (Get) over the CC 1 lines for a provided index. Values either passed in or returned are treated as boolean values.

CC 2 Enable/Disable (Get/Set)

port [index] . getCC2Enabled <= (unsigned char) enabled
port [index] . setCC2Enabled => (unsigned char) enabled

Provides control (Set) and monitoring (Get) over the CC 2 lines for a provided index. Values either passed in or returned are treated as boolean values.

Vbus Voltage/Current (Get)

port [index] . getVbusVoltage <= (unsigned int) microvolts
port [index] . getVbusCurrent <= (unsigned int) microamps

Provides access to the last read values of Voltage (in microvolts) and Current (in microamps) for the Vbus lines.

Vconn Voltage/Current (Get)

port [index] . getVconnVoltage <= (unsigned int) microvolts
port [index] . getVconnCurrent <= (unsigned int) microamps

Provides access to the last read values of Voltage (in microvolts) and Current (in microamps) for the Vconn lines.

Vbus Accumulated Power (Get/Reset)

port [index] . getVbusAccumulatedPower <= (unsigned int) milliwatthours
port [index] . resetVbusAccumulatedPower => (void)

Returns the accumulated power (energy) sank or sourced by the Vbus line for the given port in units of milliWatt-hours.

Vconn Accumulated Power (Get/Reset)

port [index] . getVconnAccumulatedPower <= (unsigned int) milliwatthours
port [index] . resetVconnAccumulatedPower => (void)

Returns the accumulated power (energy) sank or sourced by the Vconn line for the given port in units of milliWatt-hours.

Port Name (Get/Set)

port [index] . getName <= (unsigned char[]) name
port [index] . setName => (unsigned char[]) name

Allows for setting a friendly name to the port with a 32 character limit.

Downstream Data Speed (Get)

port [index] . getDataSpeed <= (unsigned int)

Gets the speed of the enumerated device.

Data Speed

Bit

Value

Define

1.5 Mbit/s

0

0/1

portDataSpeed_ls_1p5M_Bit

12 Mbit/s

1

0/1

portDataSpeed_fs_12M_Bit

480 Mbit/s

2

0/1

portDataSpeed_hs_480M_Bit

5 Gbit/s

3

0/1

portDataSpeed_ss_5G_Bit

10 Gbit/s

4

0/1

portDataSpeed_ss_10G_Bit

USB 2.0

6

0/1

portDataSpeed_Connected_2p0_Bit

USB 3.0

7

0/1

portDataSpeed_Connected_3p0_Bit

Allocated Power (Get)

port[index] . getAllocatedPower <= (unsigned int) milliwatts

Returns the currently allocated power for the port in milliwatts. This represents the power that has been allocated to this port from the available power budget.

Available Power (Get)

port[index] . getAvailablePower <= (unsigned int) milliwatts

Returns the available power for the port in milliwatts. This represents the power that is available for allocation to this port.

CC1/CC2 Accumulated Power (Get/Set)

port[index] . getCC[1|2]AccumulatedPower <= (unsigned int) milliwatt_hours
port[index] . setCC[1|2]AccumulatedPower => (unsigned int) milliwatt_hours

Returns or sets the accumulated power consumption for the CC1/CC2 line in milliwatt-hours. This tracks the total energy consumed over time.

CC1/CC2 Current (Get)

port[index] . getCC[1|2]Current <= (unsigned int) microamps

Returns the current flowing through the CC1/CC2 line in microamps. This is used for USB-C power delivery monitoring.

CC1/CC2 State (Get)

port[index] . getCC[1|2]State <= (unsigned int) state

Returns the current state of the CC1/CC2 line. The state is a 2-byte value where the upper byte represents the remote device state (device on the other end of the cable) and the lower byte represents the local hub state.

CC State Values

Value

Name

Description

0

None

No connection or state

1

Invalid

Invalid or error state

2

RpDefault

Default pull-up resistor (500/900/1500mA)

3

Rp1p5

1.5 Amp pull-up resistor

4

Rp3p0

3.0 Amp pull-up resistor

5

Rd

Pull-down resistor (sink device)

6

Ra

Audio accessory resistor

7

Managed

Managed by firmware

8

Unknown

Unknown state

CC1/CC2 Voltage (Get)

port[index] . getCC[1|2]Voltage <= (unsigned int) microvolts

Returns the voltage on the CC1/CC2 line in microvolts. This is used for USB-C power delivery monitoring.

CC Current Limit (Get/Set)

port[index] . getCCCurrentLimit <= (unsigned char) limit
port[index] . setCCCurrentLimit => (unsigned char) limit

Returns or sets the current limit enumeration for the CC lines. This sets the maximum current value that will be advertised for power delivery negotiation.

CC Current Limit Options

Value

Name

Description

0

None

No current limit

1

Default

Default current limit (500/900mA)

2

1p5

1.5 Amp current limit

3

3p0

3.0 Amp current limit

Current Limit Mode (Get/Set)

port[index] . getCurrentLimitMode <= (unsigned char) mode
port[index] . setCurrentLimitMode => (unsigned char) mode

Returns or sets the current limit mode for the port. This controls how the current limit is applied and enforced.

Data HS Routing Behavior (Get/Set)

port[index] . getDataHSRoutingBehavior <= (unsigned char) behavior
port[index] . setDataHSRoutingBehavior => (unsigned char) behavior

Controls how the HighSpeed lanes will be routed.

Data HS Routing Behavior Options

Value

Name

Description

0

Follow CC

Hi-Speed lines follow the detected CC orientation. Default.

1

Side A

Route the Hi-Speed lines to side A.

2

Side B

Route the Hi-Speed lines to side B.

3

Shorted

Short the Hi-Speed lines on side A and side B together.

HS Data Protocol (Get/Set)

port[index] . getHSDataProtocol <= (unsigned char) protocol
port[index] . setHSDataProtocol => (unsigned char) protocol

HighSpeed protocol controls what the lines are used for and allows for UART injection.

HS Data Protocol Options

Value

Name

Description

0

None

No data mode selection.

1

Automatic

Automatic data protocol selection.

2

USB 2.0

USB 2.0 on the oriented D+/D- pair. Default.

3

USB 2.0 + UART (RX on D+)

USB 2.0 on the active pair. 2-wire UART on the opposite pair: RX on D+ and TX on D-. Requires the RS-232 feature.

4

USB 2.0 + UART (TX on D+)

USB 2.0 on the active pair. 2-wire UART on the opposite pair: TX on D+ and RX on D-. Requires the RS-232 feature.

The 2-wire UART protocol requires the RS-232 feature.

Data Role (Get)

port[index] . getDataRole <= (unsigned char) role

Returns the current data role of the port. This indicates whether the port is acting as a host or device for data communication.

Data SS Routing Behavior (Get/Set)

port[index] . getDataSSRoutingBehavior <= (unsigned char) behavior
port[index] . setDataSSRoutingBehavior => (unsigned char) behavior

Controls how the SuperSpeed lanes will be routed.

Data SS Routing Behavior Options

Value

Name

Description

0

Follow CC

SuperSpeed lanes follow the detected CC orientation. Default.

1

Side A

Route the SuperSpeed lanes to side A.

2

Side B

Route the SuperSpeed lanes to side B.

3

Follow CC (inverted)

SuperSpeed lanes follow the opposite of the detected CC orientation.

SS Data Protocol (Get/Set)

port[index] . getSSDataProtocol <= (unsigned char) protocol
port[index] . setSSDataProtocol => (unsigned char) protocol

SuperSpeed protocol controls how the lanes are configured for alternate modes.

SS Data Protocol Options

Value

Name

Description

0

None

SuperSpeed redrivers disabled.

1

Automatic

Follow the mode negotiated on the Common port. Default.

2

USB 3.2

USB 3.2 SuperSpeed only.

3

USB4 / Thunderbolt

USB4 or Thunderbolt.

4

4-lane DisplayPort

DisplayPort on all four SuperSpeed lanes.

5

2-lane DisplayPort + USB 3.2

Two DisplayPort lanes with USB 3.2 on the remaining pair.

Port Errors (Get)

port[index] . getErrors <= (unsigned int) errors

Returns the current error status for the port. The error value is a bitfield indicating various port-related error conditions.

HS Boost (Get/Set)

port[index] . getHSBoost <= (unsigned char) boost
port[index] . setHSBoost => (unsigned char) boost

Returns or sets the high-speed boost setting for the port. This controls signal amplification for high-speed data transmission.

Port Mode (Get/Set)

port[index] . getMode <= (unsigned int) mode
port[index] . setMode => (unsigned int) mode

Returns or sets the operating mode for the port. The mode is a bitfield that controls various port behaviors and capabilities.

Power Limit Mode (Get/Set)

port[index] . getPowerLimitMode <= (unsigned char) mode
port[index] . setPowerLimitMode => (unsigned char) mode

Returns or sets the power limit mode for the port. This controls how the power limit is applied and enforced.

Power Mode (Get/Set)

port[index] . getPowerMode <= (unsigned char) mode
port[index] . setPowerMode => (unsigned char) mode

Returns or sets the power mode for the port. This controls the power delivery behavior and capabilities.

Data SBU Routing Behavior (Get/Set)

port[index] . getDataSBURoutingBehavior <= (unsigned char) behavior
port[index] . setDataSBURoutingBehavior => (unsigned char) behavior

Controls how the SBU lanes will be routed.

Data SBU Routing Behavior Options

Value

Name

Description

0

Follow CC

SBU lines follow the detected CC orientation. Default.

1

Follow CC (inverted)

SBU lines follow the opposite of the detected CC orientation.

2

Side A

Route the SBU lines to side A.

3

Side B

Route the SBU lines to side B.

SBU Data Protocol (Get/Set)

port[index] . getSBUDataProtocol <= (unsigned char) protocol
port[index] . setSBUDataProtocol => (unsigned char) protocol

SBU protocol controls what the lines are used for.

SBU Data Protocol Options

Value

Name

Description

0

None

Sideband decode and inject disabled.

1

Automatic

Follow the sideband use negotiated on the Common port. Default.

2

2-wire UART

UART on the sideband pins selected by SBU routing. RX on the A debug channel and TX on the B debug channel. Requires the RS-232 feature.

3

2-wire DAP

2-wire debug with SWCLK on SBU1 and SWDIO on SBU2.

4

Link training

Decode USB4 or Thunderbolt link training on both SBU lines. Requires PD Logging.

5

DisplayPort Aux

DisplayPort Aux channel.

The 2-wire UART protocol requires the RS-232 feature. Link training requires PD Logging.

SBU1 Voltage (Get)

port[index] . getSBU1Voltage <= (unsigned int) microvolts

Returns the voltage on the SBU1 line in microvolts. SBU (Sideband Use) lines are used for alternate modes in USB-C.

SBU2 Voltage (Get)

port[index] . getSBU2Voltage <= (unsigned int) microvolts

Returns the voltage on the SBU2 line in microvolts. SBU (Sideband Use) lines are used for alternate modes in USB-C.

Port State (Get)

port[index] . getState <= (unsigned int) state

Returns the current state of the port. The state is a bitfield indicating the status of various port components and features.

Voltage Setpoint (Get/Set)

port[index] . getVoltageSetpoint <= (unsigned int) millivolts
port[index] . setVoltageSetpoint => (unsigned int) millivolts

Returns or sets the voltage setpoint for the port in millivolts. This controls the target voltage for the port’s power output.

Vbus Accumulated Power (Set)

port[index] . setVbusAccumulatedPower => (unsigned int) milliwatt_hours

Sets the accumulated power consumption for the Vbus line in milliwatt-hours. This is used to reset or initialize the power tracking.

Vconn Accumulated Power (Set)

port[index] . setVconnAccumulatedPower => (unsigned int) milliwatt_hours

Sets the accumulated power consumption for the Vconn line in milliwatt-hours. This is used to reset or initialize the power tracking.