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:
- 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:
- 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:
- 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:
- 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:
- 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:
- 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:
- 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:
- 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:
- 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:
- 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:
- 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:
- 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:
- 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:
- 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:
- 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:
- 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