Page 1 of 1

USB Connect/Disconnect Hooks

Posted: Fri Oct 31, 2014 3:49 pm
by Tabulous
is there anyway to get these notifications ? i.e. when USB is inserted get a notification callback ?

Re: USB Connect/Disconnect Hooks

Posted: Fri Oct 31, 2014 4:36 pm
by Giovanni
You get a callback on enumeration, you could try sensing the 5V for insertion (using EXT may be) if your board supports that.

Giovanni

Re: USB Connect/Disconnect Hooks

Posted: Sun Nov 02, 2014 10:10 am
by Tabulous
Giovanni wrote:You get a callback on enumeration, you could try sensing the 5V for insertion (using EXT may be) if your board supports that.

Giovanni


what callback is that ? the usb_event ?

Re: USB Connect/Disconnect Hooks

Posted: Sun Nov 02, 2014 11:43 am
by Giovanni
The USB driver does not support callbacks for insertion. You can use the EXT driver IF the 5V can be detected on an input pin.

Giovanni

Re: USB Connect/Disconnect Hooks

Posted: Sun Nov 02, 2014 2:52 pm
by Tabulous
Is there any technical reason why having connect / disconnect notification in the driver is an issue ?

To me it seems logical to have this ? i know the ST driver as something to support this

Re: USB Connect/Disconnect Hooks

Posted: Thu Nov 06, 2014 4:51 pm
by mobyfab
In my case I just connect the 5v USB to an npn transistor and use it to pull a gpio down.

When the gpio goes down I call usbConnectBus which pulls D+ up using a pin, and vice versa.

Works fine using the pal or exti driver :)

Re: USB Connect/Disconnect Hooks

Posted: Thu Nov 06, 2014 5:33 pm
by Giovanni
Tabulous wrote:Is there any technical reason why having connect / disconnect notification in the driver is an issue ?

To me it seems logical to have this ? i know the ST driver as something to support this


Because the feature is not necessarily present in the USB peripheral.

Giovanni