Many USB events not implemented

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

Many USB events not implemented

1,560 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by peplin on Tue Feb 19 09:27:32 MST 2013
I've been working to add USB VBUS detection and I was digging more into the documentation of nxpUSBlib. There are all sorts of useful events described in USB/Core/Events.h, e.g. EVENT_USB_Device_Disconnect(), but searching through the code it doesn't look like very many of these are ever actually called.

I can't find anything in the docs that says these are unimplemented, so am I missing something? I'm able to detect VBUS manually and control USB_DeviceState manually, but is this planned to be built-in to the library at some point? I would contribute a patch, but my past experience says there's no chance of it getting merged into the next official release.
标签 (1)
0 项奖励
回复
2 回复数

1,537 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by peplin on Mon Mar 11 15:42:21 MST 2013
Here's one way to detect if USB is disconnected:

https://github.com/openxc/cantranslator/blob/fordboard/src/lpc17xx/usbutil.c#L145

I use two methods:

1. The first method is explicit, we check for the presence of a signal on VBUS: https://github.com/openxc/cantranslator/blob/fordboard/src/lpc17xx/usbutil.c#L86

2. In cases where VBUS is high regardless of a USB host's presence (e.g. if your circuit is design in such a way that an external 12v power source hits the VBUS rail), I watch for a lack of activity on the D- line: https://github.com/openxc/cantranslator/blob/fordboard/src/lpc17xx/usbutil.c#L97

I'd only recommend merging something like the 1st method into the library, or at the very least, documenting that these events are not implemented.
0 项奖励
回复

1,537 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by vitah on Thu Mar 07 21:01:08 MST 2013
Hi peplin,

Perhaps, NXP Dev Team is busy with their works. So you get hard to have a chance.

I think your personal patch is helpful. Would you mind posting your solution here? Then you will help someone on forum for the same issue and they may help you to review and also request it to be added in official release.

you are good man and you may get chance!
0 项奖励
回复