Skip to main content

usb.disable()

Disable the imp’s USB

Availability

Device
imp005 and impC001 only

Returns

Nothing

Description

This method disables the USB. This will also close all the endpoints, so any subsequent attempt to use them for transfers will result in an error. Unplugging the device will have the same effect. To re-use the device, you must re-open the endpoint(s) using usb.openendpoint() when the device returns.

Certain classes of USB error, such as unending bulk transfers and halted control transfers, require that the bus be reset. This is done by disabling and re-enabling (re-configuring) the bus by calling usb.disable() and then calling usb.configure() to reconfigure the connected device.

  • For more information on determining the source of USB errors and implementing recovery methods, please see Understanding USB Errors.