USB Libraries Help > USB Device Libraries > USB Device Layer Library > Library Interface > a) System Interaction Functions > USB_DEVICE_Deinitialize Function
MPLAB Harmony USB Stack
USB_DEVICE_Deinitialize Function

This function deinitializes the specified instance of the USB device layer, disabling its operation (and any hardware) and invalidates all of the internal data.

C
void USB_DEVICE_Deinitialize(
    SYS_MODULE_OBJ usbDeviceObj
);
Preconditions

Function USB_DEVICE_Initialize must have been called before calling this routine and a valid SYS_MODULE_OBJ must have been returned.

Parameters
Parameters 
Description 
object 
USB device layer object handle, returned by USB_DEVICE_Initialize 
Returns

None.

Remarks

Once the Initialize operation has been called, the deinitialize operation must be called before the Initialize operation can be called again.

Example
// This code example shows how the USB
// Device Layer can be deinitialized. It is assumed the
// USB Device Layer was already initialized.

SYS_MODULE_OBJ usbDeviceobj;

USB_DEVICE_Deinitialize(usbDeviceobj);