Host Connect Detect f() for: USBD_API->hw->Connect(g_hUsb, 1);

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

Host Connect Detect f() for: USBD_API->hw->Connect(g_hUsb, 1);

2,010 次查看
mattferrari
Contributor III

I'm building a USB MSC subsystem.  To initiate the enumeration, I call:    USBD_API->hw->Connect(g_hUsb, 1);

If the Host is present, I enumerate and all is well.

But what if the Host is not present / not connected?

Does the USB Library (LPC11U68) provide a complementary function I can call, or perhaps just a flag I can check to confirm that a connection has been established with the Host?

I need to cover the condition when USBD_API->hw->Connect(g_hUsb, 1) has been called, but the USB cable has not been connected to the Host (user error).  

Right now, my code implementation waits forever and I'd like to be able to check for positive confirmation that a Host on the other end has responded - to see if a Host is even there.

Can anyone point me to such a function or a flag provided by the LPCOpen USB Library for the LPC11U68?

Thanks,

Matt

标签 (2)
0 项奖励
回复
3 回复数

1,735 次查看
soledad
NXP Employee
NXP Employee

Hello Matt,

Please check the below thread and let me know if this helps!!

Detect USB connect/disconnect using USBD ROM Stack? | www.LPCware.com 


Have a great day,
Sol

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复

1,661 次查看
andarm
Contributor II

I can not open link, because of company policy. Could you send it here. Thanks. 

标记 (1)
0 项奖励
回复

1,735 次查看
mattferrari
Contributor III

Thank you for the link.  This thread actually discusses USB Host, not End Point, so it didn't address my concern.  I have just decided to use a timeout and not worry about immediate confirmation of an attached Host, although I think the the USB Host Read Callback function could probably suffice for Host Present verification.  The Host will query the End Point to get information from it and that transaction could be used to do the "Host Present" confirmation I would think, although I don't know if there might be additional considerations with using this approach...

0 项奖励
回复