USBSystem Class

class USBSystemClass : public Acroname::BrainStem::EntityClass

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

Subclassed by aMTMIOSerial::HubClass, aUSBHub2x4::HubClass, aUSBHub3c::HubClass, aUSBHub3p::HubClass

Public Functions

USBSystemClass(void)

Constructor.

~USBSystemClass(void)

Destructor.

void init(Module *pModule, const uint8_t index)

Initialize the class.

Parameters:
  • pModule – The module to which this entity belongs.

  • index – The index of the entity, i.e. the port

aErr getUpstream(uint8_t *port)

Gets the upstream port.

Parameters:

port – The current upstream port.

Returns:

Returns common entity return values

aErr setUpstream(const uint8_t port)

Sets the upstream port.

Parameters:

port – The upstream port to set.

Returns:

Returns common entity return values

aErr getEnumerationDelay(uint32_t *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 uint32_t msDelay)

Sets the inter-port enumeration delay in milliseconds. 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(uint32_t *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(uint32_t *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 uint32_t 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(uint32_t *buffer, const size_t bufferLength, size_t *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

  • bufferLength – Length of the buffer to be filed

  • unloadedLength – Length that was actually received and filled.

Returns:

Returns common entity return values

aErr setModeList(uint32_t *buffer, const size_t bufferLength)

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.

  • bufferLength – Length of the buffer to be transferred.

Returns:

Returns common entity return values

aErr getStateList(uint32_t *buffer, const size_t bufferLength, size_t *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

  • bufferLength – Length of the buffer to be filed

  • unloadedLength – Length that was actually received and filled.

Returns:

Returns common entity return values

aErr getPowerBehavior(uint8_t *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 uint8_t 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(uint32_t *buffer, const size_t bufferLength, size_t *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

  • bufferLength – Length of the buffer to be filed

  • unloadedLength – Length that was actually received and filled.

Returns:

Returns common entity return values

aErr setPowerBehaviorConfig(uint32_t *buffer, const size_t bufferLength)

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.

  • bufferLength – Length of the buffer to be transferred.

Returns:

Returns common entity return values

aErr getDataRoleBehavior(uint8_t *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 uint8_t 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(uint32_t *buffer, const size_t bufferLength, size_t *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

  • bufferLength – Length of the buffer to be filed

  • unloadedLength – Length that was actually received and filled.

Returns:

Returns common entity return values

aErr setDataRoleBehaviorConfig(uint32_t *buffer, const size_t bufferLength)

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.

  • bufferLength – Length of the buffer to be transferred.

Returns:

Returns common entity return values

aErr getSelectorMode(uint8_t *mode)

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

Returns:

Returns common entity return values

aErr setSelectorMode(const uint8_t mode)

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 to be set.

Returns:

Returns common entity return values

aErr resetEntityToFactoryDefaults(void)

Resets the USBSystemClass Entity to it factory default configuration.

aErr getUpstreamHS(uint8_t *port)

Gets the USB HighSpeed upstream port.

Parameters:

port – The current upstream port.

Returns:

Returns common entity return values

aErr setUpstreamHS(const uint8_t port)

Sets the USB HighSpeed upstream port.

Parameters:

port – The upstream port to set.

Returns:

Returns common entity return values

aErr getUpstreamSS(uint8_t *port)

Gets the USB SuperSpeed upstream port.

Parameters:

port – The current upstream port.

Returns:

Returns common entity return values

aErr setUpstreamSS(const uint8_t port)

Sets the USB SuperSpeed upstream port.

Parameters:

port – The upstream port to set.

Returns:

Returns common entity return values

aErr getOverride(uint32_t *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 uint32_t overrides)

Sets the current enabled overrides

Parameters:

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

Returns:

Returns common entity return values

aErr setDataHSMaxDatarate(const uint32_t datarate)

Sets the USB HighSpeed Max datarate

Parameters:

datarate – Maximum datarate for the USB HighSpeed signals.

Returns:

Returns common entity return values

aErr getDataHSMaxDatarate(uint32_t *datarate)

Gets the USB HighSpeed Max datarate

Parameters:

datarate – Current maximum datarate for the USB HighSpeed signals.

Returns:

Returns common entity return values

aErr setDataSSMaxDatarate(const uint32_t datarate)

Sets the USB SuperSpeed Max datarate

Parameters:

datarate – Maximum datarate for the USB SuperSpeed signals.

Returns:

Returns common entity return values

aErr getDataSSMaxDatarate(uint32_t *datarate)

Gets the USB SuperSpeed Max datarate

Parameters:

datarate – Current maximum datarate for the USB SuperSpeed signals.

Returns:

Returns common entity return values