[Haskell-cafe] USB Drivers in Haskell
Bjorn Bringert
bringert at cs.chalmers.se
Fri Aug 25 09:41:19 EDT 2006
On 25 aug 2006, at 05.02, Jason Dagit wrote:
> Hello,
>
> I recently became the owner a USB gadget that tracks movement via GPS
> and also tracks heart rate (it's a training device for athletes).
> This device comes with software that is windows only and...doesn't
> like up to it's potential (to put it politely). Being a programmer
> type and someone that prefers to use either linux or osx I quickly
> realized I should write my own software to use the gadget.
> Fortunately, the company that makes the device provides documentation
> to write drivers for the device (including a minimal example USB
> driver for win32).
>
> So then I looked around the net for a few open source things, such as
> open source drivers for the device or a Haskell library to help me
> start writing drivers for the gadget. I didn't see anything relevant
> after a few minutes of searching so I figure that means there isn't
> much.
>
> Did I miss a Haskell library for writing device drivers, specifically
> USB drivers? Would this be hard to write? I would prefer to support
> osx and linux at a minimum and I think it would be ideal to shoot for
> cross platform (win32, osx, linux and *bsd). I have this feeling that
> it could be done by writing platform specific wrappers using hsc2hs on
> each platform then bringing them together through a unified 'low'
> level Haskell api. The Haskell api would then be exposed as a module
> for application developers.
>
> Any thoughts?
>
> For the interested, the documentation I spoke of can be found here:
> http://www.garmin.com/support/commProtocol.html
For cross-platform USB drivers, you may want to have a look at libusb
[1]. I have only used it under Linux, but it seems to support Linux,
*BSD and OS X. There also seems to be a win32 port [2]. A Haskell
binding to libusb would be very welcome.
/Björn
[1] http://libusb.sourceforge.net/
[2] http://libusb-win32.sourceforge.net/
More information about the Haskell-Cafe
mailing list