USBSystem Class

class USBSystemClass : public Acroname::BrainStem::EntityClass

MARK: USB System Class.

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

Subclassed by aUSBHub3c::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 bufLength, 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

  • bufLength – 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 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(uint32_t *buffer, const size_t bufLength, 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

  • bufLength – 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 bufLength, 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

  • bufLength – 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 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(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 bufLength, 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

  • bufLength – 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 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 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.