USB Libraries Help > USB Host Libraries > USB Host Layer Library > Library Interface > a) Functions > USB_HOST_Deinitialize Function
MPLAB Harmony USB Stack
USB_HOST_Deinitialize Function

Deinitializes the USB Host Layer. All internal data structures will be reset.

C
void USB_HOST_Deinitialize(
    SYS_MODULE_OBJ hostLayerObject
);
Preconditions

Function USB_HOST_Initialize should have been called before calling this function.

Parameters
Parameters 
Description 
object 
USB Host layer object handle, returned from the USB_HOST_Initialize routine 
Returns

None.

Remarks

Once the Initialize operation has been called, the Deinitialize operation must be called before the Initialize operation can be called again. This routine will NEVER block waiting for hardware.

Example
SYS_MODULE_OBJ      object;     //  Returned from USB_HOST_Initialize
SYS_STATUS          status;

USB_HOST_Deinitialize(object);

status = USB_HOST_Status(object);
if (SYS_MODULE_DEINITIALIZED != status)
{
    // Can check again later if you need to know 
    // when the driver is deinitialized.
}