USB System¶
- class brainstem.entity.USBSystem(module, index)[source]¶
The USBSystem class provides high level control of the lower level Port Class.
- getDataHSMaxDatarate()[source]¶
Gets the USB HighSpeed Max datarate
- Returns:
value (int): Current maximum datarate for the USB HighSpeed signals. error: Non-zero BrainStem error code on failure.
- Return type:
Result (object)
- getDataRoleBehavior()[source]¶
Gets the behavior of how upstream and downstream ports are determined. i.e. How do you manage requests for data role swaps and new upstream connections.
- Returns:
value (int): An enumerated representation of the current behavior. error: Non-zero BrainStem error code on failure.
- Return type:
Result (object)
- getDataRoleBehaviorConfig()[source]¶
Gets the current data role behavior configuration Certain data role behaviors use a list of ports to determine priority host priority.
- Returns:
value (tuple(int)): A list of ports which indicate priority sequencing. error: Non-zero BrainStem error code on failure.
- Return type:
Result (object)
- getDataRoleList()[source]¶
Gets the data role of all ports with a single call Equivalent to calling Port.getDataRole() on each individual port.
- Returns:
value (int): Bit packed representation of the data role for all ports. error: Non-zero BrainStem error code on failure.
- Return type:
Result (object)
- getDataSSMaxDatarate()[source]¶
Gets the USB SuperSpeed Max datarate
- Returns:
value (int): Current maximum datarate for the USB SuperSpeed signals. error: Non-zero BrainStem error code on failure.
- Return type:
Result (object)
- getEnabledList()[source]¶
Gets the current enabled status of all ports with a single call. Equivalent to calling PortClass::setEnabled() on each port.
- Returns:
value (int): Bit packed representation of the enabled status for all ports. error: Non-zero BrainStem error code on failure.
- Return type:
Result (object)
- getEnumerationDelay()[source]¶
Gets the inter-port enumeration delay in milli-seconds (mS). Delay is applied upon hub enumeration.
- Returns:
value (int): Current inter-port delay in milli-seconds (mS). error: Non-zero BrainStem error code on failure.
- Return type:
Result (object)
- getModeList()[source]¶
Gets the current mode of all ports with a single call. Equivalent to calling PortClass:getMode() on each port.
- Returns:
value (tuple(int)): List of modes of each port. error: Non-zero BrainStem error code on failure.
- Return type:
Result (object)
- getOverride()[source]¶
Gets the current enabled overrides
- Returns:
value (int): Bit mapped representation of the current override configuration. error: Non-zero BrainStem error code on failure.
- Return type:
Result (object)
- getPowerBehavior()[source]¶
Gets the behavior of the power manager. The power manager is responsible for budgeting the power of the system. i.e. What happens when requested power greater than available power.
- Returns:
value (int): An enumerated representation of the current behavior. error: Non-zero BrainStem error code on failure.
- Return type:
Result (object)
- getPowerBehaviorConfig()[source]¶
Gets the current power behavior configuration Certain power behaviors use a list of ports to determine priority when budgeting power.
- Returns:
value (tuple(int)): A list of ports which indicate priority sequencing. error: Non-zero BrainStem error code on failure.
- Return type:
Result (object)
- getSelectorMode()[source]¶
Gets the current mode of the selector input. This mode determines what happens and in what order when the external selector input is used.
- Returns:
value (int): The current mode error: Non-zero BrainStem error code on failure.
- Return type:
Result (object)
- getStateList()[source]¶
Gets the state for all ports with a single call. Equivalent to calling PortClass::getState() on each port.
- Returns:
value (tuple(int)): List of states for each port. error: Non-zero BrainStem error code on failure.
- Return type:
Result (object)
- getUpstream()[source]¶
Gets the current upstream port.
- Returns:
value: Index of upstream port. error: Non-zero BrainStem error code on failure.
- Return type:
Result (object)
- getUpstreamHS()[source]¶
Gets the current USB HighSpeed upstream port.
- Returns:
value: Index of upstream port. error: Non-zero BrainStem error code on failure.
- Return type:
Result (object)
- getUpstreamSS()[source]¶
Gets the current USB SuperSpeed upstream port.
- Returns:
value: Index of upstream port. error: Non-zero BrainStem error code on failure.
- Return type:
Result (object)
- resetEntityToFactoryDefaults()[source]¶
Resets the USBSystemClass Entity to it factory default configuration.
- Returns (int):
Non-zero BrainStem error code on failure.
- setDataHSMaxDatarate(datarate)[source]¶
Sets the USB HighSpeed Max datarate
- Parameters:
datarate (int) – Maximum datarate for the USB HighSpeed signals.
- Returns (int):
Non-zero BrainStem error code on failure.
- setDataRoleBehavior(behavior)[source]¶
Sets the behavior of how upstream and downstream ports are determined. i.e. How do you manage requests for data role swaps and new upstream connections.
- Parameters:
behavior (int) – An enumerated representation of the behavior to be set.
- Returns (int):
Non-zero BrainStem error code on failure.
- setDataRoleBehaviorConfig(config)[source]¶
Sets the current data role behavior configuration Certain data role behaviors use a list of ports to determine host priority.
- Parameters:
config (tuple(int)) – List of ports which indicate priority sequencing.
- Returns (int):
Non-zero BrainStem error code on failure.
- setDataSSMaxDatarate(datarate)[source]¶
Sets the USB SuperSpeed Max datarate
- Parameters:
datarate (int) – Maximum datarate for the USB SuperSpeed signals.
- Returns (int):
Non-zero BrainStem error code on failure.
- setEnabledList(enabledList)[source]¶
Sets the enabled status of all ports with a single call. Equivalent to calling PortClass::setEnabled() on each port.
- Parameters:
enabledList (int) – Bit packed representation of the enabled status for all ports to be applied.
- Returns (int):
Non-zero BrainStem error code on failure.
- setEnumerationDelay(delay)[source]¶
Set the inter-port enumeration delay in milliseconds. This setting should be saved with a stem.system.save() call. Delay is applied upon hub enumeration.
- Parameters:
delay (int) – Delay in milli-seconds (mS) to be applied between port enables.
- Returns (int):
Non-zero BrainStem error code on failure.
- setModeList(modeList)[source]¶
Sets the mode of all ports with a single call. Equivalent to calling PortClass::setMode() on each port
- Parameters:
modeList (tuple(int)) – List of modes to be set for each port.
- Returns (int):
Non-zero BrainStem error code on failure.
- setOverride(overrides)[source]¶
Sets the current overrides.
- Parameters:
overrides (int) – Overrides to be set in a bit mapped representation.
- Returns (int):
Non-zero BrainStem error code on failure.
- setPowerBehavior(behavior)[source]¶
Sets the behavior of how available power is managed. i.e. What happens when requested power is greater than available power.
- Parameters:
behavior (int) – An enumerated representation of the behavior to be set.
- Returns (int):
Non-zero BrainStem error code on failure.
- setPowerBehaviorConfig(config)[source]¶
Sets the current power behavior configuration Certain power behaviors use a list of ports to determine priority when budgeting power.
- Parameters:
config (tuple(int)) – List of ports which indicate priority sequencing.
- Returns (int):
Non-zero BrainStem error code on failure.
- setSelectorMode(mode)[source]¶
Sets the current mode of the selector input. This mode determines what happens and in what order when the external selector input is used.
- Parameters:
mode (mode) – Mode to be set.
- Returns (int):
Non-zero BrainStem error code on failure.
- setUpstream(port)[source]¶
Sets the upstream port.
- Parameters:
port (int) – Upstream port to be applied.
- Returns (int):
Non-zero BrainStem error code on failure.