USBSystem Class

class USBSystemClass : public EntityClass

USBSystem Class The USBSystem class provides high level control of the lower level Port Class.

Public Functions

USBSystemClass()

Constructor.

~USBSystemClass()

Destructor.

!USBSystemClass ()

Finalizer.

void init (BrainStem2CLI::ModuleClass^ module, const unsigned char index)

Initializes the class. Should only be called when manually creating classes.

Parameters:
  • pModule – The module.

  • index – The cmdUSBSYSTEM index to be addressed.

aErr getUpstream(unsigned char %port)

Gets the upstream port.

Parameters:

port – The current upstream port.

Returns:

Returns common entity return values

aErr setUpstream(const unsigned char port)

Sets the upstream port.

Parameters:

port – The upstream port to set.

Returns:

Returns common entity return values

aErr getEnumerationDelay(unsigned int %msDelay)

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

Parameters:

msDelay – the current inter-port delay in milliseconds.

Returns:

Returns common entity return values

aErr setEnumerationDelay(const unsigned int msDelay)

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

msDelay – The delay in milliseconds to be applied between port enables

Returns:

Returns common entity return values

aErr getDataRoleList(unsigned int %roleList)

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

Parameters:

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

Returns:

Returns common entity return values

aErr getEnabledList(unsigned int %enabledList)

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

Parameters:

enabledList – Bit packed representation of the enabled status for all ports.

Returns:

Returns common entity return values

aErr setEnabledList(const unsigned int enabledList)

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

Parameters:

enabledList – Bit packed representation of the enabled status for all ports to be applied.

Returns:

Returns common entity return values

aErr getModeList(unsigned int %buffer, const unsigned int bufLength, unsigned int %unloadedLength)

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

Parameters:
  • buffer – pointer to the start of a c style buffer to be filled

  • bufLength – Length of the buffer to be filed

  • unloadedLength – Length that was actually received and filled.

Returns:

Returns common entity return values

aErr setModeList(unsigned int %buffer, const unsigned int bufLength)

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

Parameters:
  • buffer – Pointer to the start of a c style buffer to be transferred.

  • bufLength – Length of the buffer to be transferred.

Returns:

Returns common entity return values

aErr getStateList(unsigned int %buffer, const unsigned int bufLength, unsigned int %unloadedLength)

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

Parameters:
  • buffer – pointer to the start of a c style buffer to be filled

  • bufLength – Length of the buffer to be filed

  • unloadedLength – Length that was actually received and filled.

Returns:

Returns common entity return values

aErr getPowerBehavior(unsigned char %behavior)

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.

Parameters:

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

Returns:

Returns common entity return values

aErr setPowerBehavior(const unsigned char behavior)

Sets the behavior of how available power is managed. i.e. What happens when requested power is greater than available power.

Parameters:

behavior – An enumerated representation of behavior. Available behaviors are product specific. See the reference documentation.

Returns:

Returns common entity return values

aErr getPowerBehaviorConfig(unsigned int %buffer, const unsigned int bufLength, unsigned int %unloadedLength)

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

Parameters:
  • buffer – pointer to the start of a c style buffer to be filled

  • bufLength – Length of the buffer to be filed

  • unloadedLength – Length that was actually received and filled.

Returns:

Returns common entity return values

aErr setPowerBehaviorConfig(unsigned int %buffer, const unsigned int bufLength)

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

Parameters:
  • buffer – Pointer to the start of a c style buffer to be transferred.

  • bufLength – Length of the buffer to be transferred.

Returns:

Returns common entity return values

aErr getDataRoleBehavior(unsigned char %behavior)

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.

Parameters:

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

Returns:

Returns common entity return values

aErr setDataRoleBehavior(const unsigned char behavior)

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

Returns:

Returns common entity return values

aErr getDataRoleBehaviorConfig(unsigned int %buffer, const unsigned int bufLength, unsigned int %unloadedLength)

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

Parameters:
  • buffer – pointer to the start of a c style buffer to be filled

  • bufLength – Length of the buffer to be filed

  • unloadedLength – Length that was actually received and filled.

Returns:

Returns common entity return values

aErr setDataRoleBehaviorConfig(unsigned int %buffer, const unsigned int bufLength)

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

Parameters:
  • buffer – Pointer to the start of a c style buffer to be transferred.

  • bufLength – Length of the buffer to be transferred.

Returns:

Returns common entity return values

aErr resetEntityToFactoryDefaults(void)

Resets the USBSystemClass Entity to it factory default configuration.

Gets 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 – Variable to be filled with the selector mode

  • mode – Mode to be set.

Returns:

Returns common entity return values Sets the current mode of the selector input. This mode determines what happens and in what order when the external selector input is used.

Returns:

Returns common entity return values

aErr getUpstreamHS(unsigned char %port)

Gets the USB HighSpeed upstream port.

Parameters:

port – The current upstream port.

Returns:

Returns common entity return values

aErr setUpstreamHS(const unsigned char port)

Sets the USB HighSpeed upstream port.

Parameters:

port – The upstream port to set.

Returns:

Returns common entity return values

aErr getUpstreamSS(unsigned char %port)

Gets the USB SuperSpeed upstream port.

Parameters:

port – The current upstream port.

Returns:

Returns common entity return values

aErr setUpstreamSS(const unsigned char port)

Sets the USB SuperSpeed upstream port.

Parameters:

port – The upstream port to set.

Returns:

Returns common entity return values

aErr getOverride(unsigned int %overrides)

Gets the current enabled overrides

Parameters:

overrides – Bit mapped representation of the current override configuration.

Returns:

Returns common entity return values

aErr setOverride(const unsigned int overrides)

Sets the current enabled overrides

Parameters:

overrides – Overrides to be set in a bit mapped representation.

Returns:

Returns common entity return values

aErr getDataHSMaxDatarate(unsigned int %datarate)

Gets the USB HighSpeed Max datarate

Parameters:

datarate – Current maximum datarate for the USB HighSpeed signals.

Returns:

Returns common entity return values

aErr setDataHSMaxDatarate(const unsigned int datarate)

Sets the USB HighSpeed Max datarate

Parameters:

datarate – Maximum datarate for the USB HighSpeed signals.

Returns:

Returns common entity return values

aErr getDataSSMaxDatarate(unsigned int %datarate)

Gets the USB SuperSpeed Max datarate

Parameters:

datarate – Current maximum datarate for the USB SuperSpeed signals.

Returns:

Returns common entity return values

aErr setDataSSMaxDatarate(const unsigned int datarate)

Sets the USB SuperSpeed Max datarate

Parameters:

datarate – Maximum datarate for the USB SuperSpeed signals.

Returns:

Returns common entity return values