Hi!
Does anyone know how I can set USB suspend and USB resume?
I'd like to use the USB port to programmatically switch on/off the electric power to an external gadget (powered by the USB). There are "USB UART interface IC devices" which might make this possible. For example, see pages 11 and 21 in this IC documentation:
http://www.ftdichip....s/DS_FT232R.pdf
It shows a way to wire it so that one pin will be high and another pin low, when USB suspend, and vice versa for USB resume. Perfect for me, if only I could control USB suspend/resume at will...
Now, don't let the electronics of this deter you. My problem is simply that I need to know how to set USB suspend and USB resume. Preferably with C++ in Linux, but any clue, example or reference to how to use USB suspend/resume would be helpful.
USB suspend/resume (programmable power switch)
Started by plopper, Feb 21 2008 06:33 PM
3 replies to this topic
#1
Posted 21 February 2008 - 06:33 PM
|
|
|
#2
Posted 24 February 2008 - 09:08 AM
I may come up with some sample code for you, but assuming nothing but a x86 platform, you would need to probe the IRQ for the port of the device, and then use the function outb/outportb(<port>,<byte>) to set the high and low byte of the power register.
#3
Posted 24 February 2008 - 05:51 PM
So, in principle one can switch on and off the power of a USB port by "setting the power register" with an outportb command??? Could it really be that easy, or am I misinterpreting you?
#4
Posted 24 February 2008 - 08:38 PM
Yeap, just that easy.
I'm assuming you don't do os-level dev, so I'm trying to find you some resources that will just use a higher level api. Heres an example with source of using the windows api to get a device name, open a pipe, and send raw control packets to a device.
http://www.delcom-en...s/USBPRGMNL.pdf
I'm assuming you don't do os-level dev, so I'm trying to find you some resources that will just use a higher level api. Heres an example with source of using the windows api to get a device name, open a pipe, and send raw control packets to a device.
http://www.delcom-en...s/USBPRGMNL.pdf


Sign In
Create Account

Back to top









