USB Detach

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

USB Detach

1,742 次查看
jmag99
Contributor II

I am using the MQX USB device stack.  I am wondering if there is a way to force the usb connection to detach and shut down until the user unplugs and re-plugs the USB cable to the device.

0 项奖励
回复
2 回复数

1,437 次查看
CarlosCasillas
NXP Employee
NXP Employee

Hi,

If you want to reset the USB interface (resulting in a detach event), you could use the following functions (considering the CDC example):

  • USB_Class_CDC_DeInit --> for de-initialize the USB CDC (disappears from Device Manager).
  • USB_Class_CDC_Init --> for re-initialize the USB CDC (appears again on Device Manager).

Hope this will be useful for you.

Best regards!

/Carlos

0 项奖励
回复

1,437 次查看
jmag99
Contributor II

Unfortunately, the HID class does not have the same function.  I added one, but it does not do what I needed.  Instead, I have put the USB peripheral into standby and controlled the pull-ups manually.  Removing the D+ pullup, using the OTGCTL register, causes the device to detach through a software means.  It can be recovered by just putting the pull-up control back and re-enabling the peripheral (plus plugging in the cable).

0 项奖励
回复