views:

973

answers:

3

Is there a decent USB communication API? Preferably cross-platform (Linux if not, I guess)

I don't have a specific use in mind, I just want to learn about using the USB ports for future electronics projects. I realize this is very general, I'll try to refine the question as the answers point me in the right direction.

Thanks.

+4  A: 

libusb should work for you .. cross platform, user-space USB tools.

eduffy
Is it really cross-platform? From what I'm seeing its not actually ready for deployment on windows. There's a separate win32 port of the older versions, hardly what one calls cross platform.Isn't there a better alternative?
CptAJ
+2  A: 

Depending on your electronics projects, a USB micro controller might be more what you're looking for.

Here is one of my favorite USB devices that do this sort of thing (servo controls, motor controls, LEDs, analog/digital I/O, etc.) phidgets.com

Cross platform, excellent. For example, setting the position of a servo to halfway I could call to the driver:

servo1.setPosition(50);

Easy as pie.

Good luck!

bufferz
Well, not exactly. I am planning on doing something similar but I have no access to those gadgets in my country so I have to build from scratch. I'll probably end up using PICs and such in a design of my own.At any rate, its more fun this way =PSo yeah, I want to understand USB data transfer as best as I can.
CptAJ
+1  A: 

You can try for windows WinUSB( http://msdn.microsoft.com/en-us/library/aa476426.aspx ) User mode windows USB driver handling - starting from Vista ? (yuck) I have never used it, and it will not work on linux :P Why want you crossplatfomr in first place? For libusb for windows, I am not sure if it supports all types of transfers. (depends on version) For device operatons you could use AVRUSB ( http://www.obdev.at/products/vusb/index.html ) You need only avr processor and some realy simple extra hardvare.

CrazyChris