The usb package

[Tags:bsd3, library]

This library enables you to communicate with USB devices from userspace. It is implemented as a high-level wrapper around bindings-libusb (http://hackage.haskell.org/package/bindings-libusb) which is a low-level binding to the C library: libusb-1.* (http://libusb.org/) or its fork: libusbx-1.* (http://libusbx.org/).

The USB transfer functions in this library have a simple synchronous interface (they block) but are implemented using the libusb asynchronous interface. They integrate with the GHC event manager making them efficient (no busy-loops) and interruptible (throwing an exception to the thread executing a transfer immediately cancels the transfer).

If the GHC event manager is not available (because you're either not using GHC or because you're on Windows) the library degrades gracefully to the libusb synchronous implementation.

This documentation assumes knowledge of how to operate USB devices from a software standpoint (descriptors, configurations, interfaces, endpoints, control/bulk/interrupt/isochronous transfers, etc). Full information can be found in the USB 2.0 specification (http://www.usb.org/developers/docs/).

For an example how to use this library see the usb-example package (https://github.com/basvandijk/usb-example) or the ls-usb package (http://hackage.haskell.org/package/ls-usb).

Besides this API documentation the following sources might be interesting:


[Skip to Readme]

Properties

Versions 0.1, 0.1.0.1, 0.2, 0.2.0.1, 0.3, 0.3.0.1, 0.3.1, 0.4, 0.5, 0.5.0.1, 0.6, 0.6.0.1, 0.6.0.2, 0.6.0.3, 0.6.0.4, 0.6.0.5, 0.6.0.6, 0.6.0.7, 0.6.0.8, 0.7, 0.8, 1.0, 1.1, 1.1.0.1, 1.1.0.2, 1.1.0.3, 1.1.0.4, 1.2, 1.2.0.1, 1.3.0.0, 1.3.0.1, 1.3.0.2, 1.3.0.3, 1.3.0.4
Change log NEWS
Dependencies base (>=4 && <4.7), base-unicode-symbols (>=0.1.1 && <0.3), bindings-libusb (>=1.4.4 && <1.5), bytestring (>=0.9 && <0.11), containers (>=0.1 && <0.6), ghc-prim (>=0.2 && <0.4), text (>=0.5 && <0.12), vector (>=0.5 && <0.11) [details]
License BSD3
Copyright 2009–2012 Bas van Dijk <v.dijk.bas@gmail.com>
Author Bas van Dijk <v.dijk.bas@gmail.com>
Maintainer Bas van Dijk <v.dijk.bas@gmail.com>
Stability Unknown
Category System, Hardware
Home page http://basvandijk.github.com/usb
Bug tracker https://github.com/basvandijk/usb/issues
Source repository head: git clone git://github.com/basvandijk/usb.git
Uploaded Mon Nov 26 22:55:48 UTC 2012 by BasVanDijk
Distributions NixOS:1.3.0.4
Downloads 6733 total (143 in the last 30 days)
Votes
0 []
Status Docs uploaded by user
Build status unknown [no reports yet]

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees

Readme for usb

Readme for usb-1.2

This library enables you to communicate with USB devices from userspace. It is implemented as a high-level wrapper around bindings-libusb which is a low-level binding to the C library: libusb-1.*.

The USB transfer functions in this library have a simple synchronous interface (they block) but are implemented using the libusb asynchronous interface. They integrate with the GHC event manager making them efficient (no busy-loops) and interruptible (throwing an exception to the thread executing a transfer immediately cancels the transfer).

If the GHC event manager is not available (because you're either not using GHC or because you're on Windows) the library degrades gracefully to the libusb synchronous implementation.

The documentation assumes knowledge of how to operate USB devices from a software standpoint (descriptors, configurations, interfaces, endpoints, control/bulk/interrupt/isochronous transfers, etc). Full information can be found in the USB 2.0 Specification.

For an example how to use this library see either the usb-example or ls-usb package.

Also see the usb-safe package which wraps this package and provides some strong safety guarantees for working with USB devices.

Finally have a look at the usb-iteratee package which provides iteratee enumerators for enumerating bulk, interrupt and isochronous endpoints.

Besides the API documentation the following sources might be interesting: