USBHUB
 
Component USBHUB
USB HUB device
Component Level: High
Methods:
(Methods are user-callable functions/subroutines intended for the component functions control. Please see the Embedded Components page for more information.)
  • Enable - This method enables the USB HUB device.

      ANSIC prototype: byte Enable(void)
    • Return value:byte - Error code, possible codes:
      ERR_OK - OK
      ERR_SPEED - This device does not work in the active speed mode.

  • Disable - This method disables the USB HUB device. Because this HUB has no internal pull-up on D0+ and external pull-up must be used. Before disabling the device this pull-up should be disconnect.

      ANSIC prototype: byte Disable(void)
    • Return value:byte - Error code, possible codes:
      ERR_OK - OK
      ERR_SPEED - This device does not work in the active speed mode.

  • EnableEvent - Enable the events.

      ANSIC prototype: byte EnableEvent(void)
    • Return value:byte - Error code, possible codes:
      ERR_OK - OK
      ERR_SPEED - This device does not work in the active speed mode

  • DisableEvent - Disable the events.

      ANSIC prototype: byte DisableEvent(void)
    • Return value:byte - Error code, possible codes:
      ERR_OK - OK
      ERR_SPEED - This device does not work in the active speed mode

  • LocalPowerSourceChange - This method must be called when state of local (external) power source of the hub has been changed.

      ANSIC prototype: byte LocalPowerSourceChange(bool LocalPowerSource)
    • LocalPowerSource:bool - true - local power supply is good, false - local power supply lost (inactiv)
    • Return value:byte - Error code, possible codes:
      ERR_OK - OK.
      ERR_SPEED - This device does not work in the active speed mode.
      ERR_DISABLED - Device is disabled.

  • PortOvercurrent - This function must be called when the over-current on the port is detected or when the over-current on the port stop.

      ANSIC prototype: byte PortOvercurrent(bool Overcurrent, byte Port)
    • Overcurrent:bool - Set to true if over-current is detected, set to false after over-current stop.
    • Port:byte - Number of port to change over-current state.
    • Return value:byte - Error code, possible codes:
      ERR_OK - OK.
      ERR_SPEED - This device does not work in the active speed mode.
      ERR_DISABLED - Device is disabled.

  • HubOvercurrent - This function is called to report hub's over-current state if the hub has only one power switch (Ganged power switching mode).

      ANSIC prototype: byte HubOvercurrent(bool Overcurrent)
    • Overcurrent:bool - Set to true if over-current is detected, set to false after over-current end.
    • Return value:byte - Error code, possible codes:
      ERR_OK - OK.
      ERR_SPEED - This device does not work in the active speed mode.
      ERR_DISABLED - Device is disabled.


Note: Some methods can be implemented as macros.