USB Entity

API Documentation: [cpp] [python] [.NET] [CCA] [REST]

The USB Entity provides the software control interface for USB related features. This entity is supported by BrainStem products which have programmatically controlled USB features.


Alt. Mode Configuration

The USB-C-Switch Pro provides an intermediary receiver and amplifier on the HS and SS data lines. Alt-modes such as DisplayPort require different directional uses of the SS data lines. As such, it is required to define the alt-mode and direction of the connection. These modes are responsible for setting the direction of the SS data lines and related SBU lines.

Note

For advanced control see Alt-Mode Configurations.

stem.usb.getAltModeConfig(0, configuration) [cpp] [python] [NET] [LabVIEW] [REST]

stem.usb.setAltModeConfig(0, configuration) [cpp] [python] [NET] [LabVIEW] [REST]

where configuration is an integer value defined below. Details of the pin mapping and data direction are also depicted below.

Index

Alt Mode Configuration

Define

0

SS Redrivers Disabled

usbAltMode_disabled

1

USB 3.2 Enabled (No DisplayPort)

usbAltMode_normal

2

4-Lane DisplayPort Host on Common Port

usbAltMode_4LaneDP_ComToHost

3

4-Lane DisplayPort Host on Mux Port

usbAltMode_4LaneDP_MuxToHost

4

2-Lane DisplayPort with USB 3.2 – Host on Common Port

usbAltMode_2LaneDP_ComToHost_wUSB3

5

2-Lane DisplayPort with USB 3.2 – Host on Mux Port

usbAltMode_2LaneDP_MuxToHost_wUSB3

6

2-Lane DisplayPort Host on Common Port with USB 3.2 Inverted

usbAltMode_2LaneDP_ComToHost_wUSB3_Inverted

7

2-Lane DisplayPort Host on Mux Port with USB 3.2 Inverted

usbAltMode_2LaneDP_MuxToHost_wUSB3_Inverted

8

USB4 / TB Host on Common Port

usbAltMode_USB4_ComToHost

9

USB4 / TB Host on Mux Port

usbAltMode_USB4_MuxToHost

10

USB4 / TB Host on Common Port Inverted

usbAltMode_USB4_ComToHost_Inverted

11

USB4 / TB Host on Mux Port Inverted

usbAltMode_USB4_MuxToHost_Inverted

12

Automatic

usbAltMode_Auto

Cable Flip

In normal operation, USB-C-Switch Pro connects signals on side A of the Common port to side A of the active Mux port. USB-C-Switch Pro can flip this mapping programmatically, rerouting CC/VCONN,SBU, and USB data so that side A of the Common Port connects to side B of the Mux ports.

stem.usb.getCableFlip(setting) [cpp] [python] [NET] [LabVIEW] [REST]

stem.usb.setCableFlip(setting) [cpp] [python] [NET] [LabVIEW] [REST]

where the parameter (setting) is an interger value of 0 or 1, where 0 is normal and 1 is full cable flip.

Individual functional groups of the USB connection can be flipped using the portMode option.

Port Operational State

The portState option provide an interface to the state of the common port and internals of the USB-C-Switch Pro system.

stem.usb.getPortState(0, state) [cpp] [python] [NET] [LabVIEW] [REST]

where (state) is a 32-bit word, defined below.

Bit

Port State Bit Map

0

Vbus enable

1

HS Side A Data enable

2

HS Side B Data enable

3

SBU enable

4

SS Lane 1 Data enable

5

SS Lane 2 Data enable

6

CC1 enable

7

CC2 enable

13:8

Reserved

14

CC Flip enable

15

Super-Speed Flip enable

16

SBU Flip enable

17

High-Speed Flip enable

19:18

Daughter-Card status

23:20

Reserved

24

KAC enable

31:25

Reserved

SBU Manipulation

stem.usb.setSBUEnable(0, enabled) [cpp] [python] [NET] [LabVIEW] [REST]

stem.usb.getSBUEnable(0, enabled) [cpp] [python] [NET] [LabVIEW] [REST]

where (enable) is a Boolean vale of 0 or 1.