3.2.4.4 USB_HOST_BusEnable Function
C
USB_HOST_RESULT USB_HOST_BusEnable(
USB_HOST_BUS bus
);
Summary
The function starts the operation of the USB Host Bus. It enables the root hub associated with specified bus and starts the process of detecting attached devices and enumerating them. The USB_HOST_EventHandlerSet() function should have been called to register an application host layer event handler before the bus is enabled (before the USB_HOST_BusEnable() function is called). This will ensure that the application does not miss any events.
Precondition
The USB_HOST_Initialize() function should have been called before calling this function.
Parameters
Parameters | Description |
bus | The bus to be enabled. If this is set to USB_HOST_BUS_ALL, all buses will be enabled. |
Returns
USB_HOST_RESULT_SUCCESS if the request was accepted. USB_HOST_RESULT_BUS_UNKNOWN if the specified bus is invalid (it does not exist in the system). USB_HOST_RESULT_FAILURE if an unknown failure occurred.
Remarks
The Host Layer may generate events after the USB_HOST_BusEnable() function is called. The application should have registered an event handler using the USB_HOST_EventHandlerSet() function to handle these events. The USB_HOST_EventHandlerSet() function should have been called before the USB_HOST_BusEnable() function is called.