USBSystem

See the USBSystem Entity for generic information.

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:

Object containing error code and returned value on success.
errorunsigned byte

An error result from the list of defined error codes

valueunsigned int

Current maximum datarate for the USB HighSpeed signals.

Return type:

brainstem.result.Result

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:

Object containing error code and returned value on success.
errorunsigned byte

An error result from the list of defined error codes

valueunsigned char

Variable to be filled with an enumerated representation of behavior. Available behaviors are product specific. See the reference documentation.

Return type:

brainstem.result.Result

getDataRoleBehaviorConfig(buffer_length=16384)[source]

Gets the current data role behavior configuration. Certain data role behaviors use a list of ports to determine priority host priority.

Parameters:

buffer_length (unsigned int) – Length of the buffer to be filed

Returns:

Object containing error code and returned value on success.
errorunsigned byte

An error result from the list of defined error codes

valuelist(unsigned int)

pointer to the start of a c style buffer to be filled

Return type:

brainstem.result.Result

getDataRoleList()[source]

Gets the data role of all ports with a single call Equivalent to calling PortClass::getDataRole() on each individual port.

Returns:

Object containing error code and returned value on success.
errorunsigned byte

An error result from the list of defined error codes

valueunsigned int

A bit packed representation of the data role for all ports.

Return type:

brainstem.result.Result

getDataSSMaxDatarate()[source]

Gets the USB SuperSpeed Max datarate

Returns:

Object containing error code and returned value on success.
errorunsigned byte

An error result from the list of defined error codes

valueunsigned int

Current maximum datarate for the USB SuperSpeed signals.

Return type:

brainstem.result.Result

getEnabledList()[source]

Gets the current enabled status of all ports with a single call. Equivalent to calling PortClass::setEnabled() on each port.

Returns:

Object containing error code and returned value on success.
errorunsigned byte

An error result from the list of defined error codes

valueunsigned int

Bit packed representation of the enabled status for all ports.

Return type:

brainstem.result.Result

getEnumerationDelay()[source]

Gets the inter-port enumeration delay in milliseconds. Delay is applied upon hub enumeration.

Returns:

Object containing error code and returned value on success.
errorunsigned byte

An error result from the list of defined error codes

valueunsigned int

the current inter-port delay in milliseconds.

Return type:

brainstem.result.Result

getModeList(buffer_length=16384)[source]

Gets the current mode of all ports with a single call. Equivalent to calling PortClass:getMode() on each port.

Parameters:

buffer_length (unsigned int) – Length of the buffer to be filed

Returns:

Object containing error code and returned value on success.
errorunsigned byte

An error result from the list of defined error codes

valuelist(unsigned int)

pointer to the start of a c style buffer to be filled

Return type:

brainstem.result.Result

getOverride()[source]

Gets the current enabled overrides

Returns:

Object containing error code and returned value on success.
errorunsigned byte

An error result from the list of defined error codes

valueunsigned int

Bit mapped representation of the current override configuration.

Return type:

brainstem.result.Result

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:

Object containing error code and returned value on success.
errorunsigned byte

An error result from the list of defined error codes

valueunsigned char

Variable to be filled with an enumerated representation of behavior. Available behaviors are product specific. See the reference documentation.

Return type:

brainstem.result.Result

getPowerBehaviorConfig(buffer_length=16384)[source]

Gets the current power behavior configuration. Certain power behaviors use a list of ports to determine priority when budgeting power.

Parameters:

buffer_length (unsigned int) – Length of the buffer to be filed

Returns:

Object containing error code and returned value on success.
errorunsigned byte

An error result from the list of defined error codes

valuelist(unsigned int)

pointer to the start of a c style buffer to be filled

Return type:

brainstem.result.Result

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:

Object containing error code and returned value on success.
errorunsigned byte

An error result from the list of defined error codes

valueunsigned char

Variable to be filled with the selector mode

Return type:

brainstem.result.Result

getStateList(buffer_length=16384)[source]

Gets the state for all ports with a single call. Equivalent to calling PortClass::getState() on each port.

Parameters:

buffer_length (unsigned int) – Length of the buffer to be filed

Returns:

Object containing error code and returned value on success.
errorunsigned byte

An error result from the list of defined error codes

valuelist(unsigned int)

pointer to the start of a c style buffer to be filled

Return type:

brainstem.result.Result

getUpstream()[source]

Gets the upstream port.

Returns:

Object containing error code and returned value on success.
errorunsigned byte

An error result from the list of defined error codes

valueunsigned char

The current upstream port.

Return type:

brainstem.result.Result

getUpstreamHS()[source]

Gets the USB HighSpeed upstream port.

Returns:

Object containing error code and returned value on success.
errorunsigned byte

An error result from the list of defined error codes

valueunsigned char

The current upstream port.

Return type:

brainstem.result.Result

getUpstreamSS()[source]

Gets the USB SuperSpeed upstream port.

Returns:

Object containing error code and returned value on success.
errorunsigned byte

An error result from the list of defined error codes

valueunsigned char

The current upstream port.

Return type:

brainstem.result.Result

setDataHSMaxDatarate(datarate)[source]

Sets the USB HighSpeed Max datarate

Parameters:

datarate (unsigned int) – Maximum datarate for the USB HighSpeed signals.

Returns:

An error result from the list of defined error codes in brainstem.result.Result

Return type:

unsigned byte

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 (unsigned char) – An enumerated representation of behavior. Available behaviors are product specific. See the reference documentation.

Returns:

An error result from the list of defined error codes in brainstem.result.Result

Return type:

unsigned byte

setDataRoleBehaviorConfig(buffer)[source]

Sets the current data role behavior configuration. Certain data role behaviors use a list of ports to determine host priority.

Parameters:

buffer (list(unsigned int)) – Pointer to the start of a c style buffer to be transferred.

Returns:

An error result from the list of defined error codes in brainstem.result.Result

Return type:

unsigned byte

setDataSSMaxDatarate(datarate)[source]

Sets the USB SuperSpeed Max datarate

Parameters:

datarate (unsigned int) – Maximum datarate for the USB SuperSpeed signals.

Returns:

An error result from the list of defined error codes in brainstem.result.Result

Return type:

unsigned byte

setEnabledList(enabled_list)[source]

Sets the enabled status of all ports with a single call. Equivalent to calling PortClass::setEnabled() on each port.

Parameters:

enabled_list (unsigned int) – Bit packed representation of the enabled status for all ports to be applied.

Returns:

An error result from the list of defined error codes in brainstem.result.Result

Return type:

unsigned byte

setEnumerationDelay(ms_delay)[source]

Sets the inter-port enumeration delay in milliseconds. Delay is applied upon hub enumeration.

Parameters:

ms_delay (unsigned int) – The delay in milliseconds to be applied between port enables

Returns:

An error result from the list of defined error codes in brainstem.result.Result

Return type:

unsigned byte

setModeList(buffer)[source]

Sets the mode of all ports with a single call. Equivalent to calling PortClass::setMode() on each port

Parameters:

buffer (list(unsigned int)) – Pointer to the start of a c style buffer to be transferred.

Returns:

An error result from the list of defined error codes in brainstem.result.Result

Return type:

unsigned byte

setOverride(overrides)[source]

Sets the current enabled overrides

Parameters:

overrides (unsigned int) – Overrides to be set in a bit mapped representation.

Returns:

An error result from the list of defined error codes in brainstem.result.Result

Return type:

unsigned byte

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 (unsigned char) – An enumerated representation of behavior. Available behaviors are product specific. See the reference documentation.

Returns:

An error result from the list of defined error codes in brainstem.result.Result

Return type:

unsigned byte

setPowerBehaviorConfig(buffer)[source]

Sets the current power behavior configuration. Certain power behaviors use a list of ports to determine priority when budgeting power.

Parameters:

buffer (list(unsigned int)) – Pointer to the start of a c style buffer to be transferred.

Returns:

An error result from the list of defined error codes in brainstem.result.Result

Return type:

unsigned byte

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 (unsigned char) – Mode to be set.

Returns:

An error result from the list of defined error codes in brainstem.result.Result

Return type:

unsigned byte

setUpstream(port)[source]

Sets the upstream port.

Parameters:

port (unsigned char) – The upstream port to set.

Returns:

An error result from the list of defined error codes in brainstem.result.Result

Return type:

unsigned byte

setUpstreamHS(port)[source]

Sets the USB HighSpeed upstream port.

Parameters:

port (unsigned char) – The upstream port to set.

Returns:

An error result from the list of defined error codes in brainstem.result.Result

Return type:

unsigned byte

setUpstreamSS(port)[source]

Sets the USB SuperSpeed upstream port.

Parameters:

port (unsigned char) – The upstream port to set.

Returns:

An error result from the list of defined error codes in brainstem.result.Result

Return type:

unsigned byte