USB Detach

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

USB Detach

1,683件の閲覧回数
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,378件の閲覧回数
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,378件の閲覧回数
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 件の賞賛
返信