Suggestion: add connected/disconnected callbacks to USBDevice

11 Jun 2014

Hey guys. Is there a chance we could get connected/disconnected callbacks in the USBDevice library for self-powered devices? I'm working on a battery-powered project, and I had to roll my own solution that polls the VBUSDEBOUNCED bit on the LPC11U35 in the USB thread in order to generate these events. This works, but it's not ideal. In fact, USBDevice in it's current state doesn't seem to have a concept of being "disconnected". This pull request over at GitHub should help with that, but it's still not a perfect solution.

12 Jun 2014

Hi,

I am not much familiar with USBDevice at the moment. I asked you on github, if there's any proposal for this suggestion?

12 Jun 2014

Martin Kojtal wrote:

Hi,

I am not much familiar with USBDevice at the moment. I asked you on github, if there's any proposal for this suggestion?

Hi Martin. Unfortunately, that's a little bit above my skill level at the moment... I'm hoping other people (smarter than me, lol) will want this as well and we can figure something out. I looked into doing it on the LPC11U35, but I can't see a way to attach an interrupt to VBUSDEBOUNCED. That seems odd to me, since VBUSDEBOUNCED automatically connects and disconnects the USB peripheral. I can observe this on the LPC11U35 QuickStart Board because it has a green LED that indicates when USB_CONNECT is asserted.