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 ( 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.

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 (

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

Besides this API documentation the following sources might be interesting:


Versions0.1,, 0.2,, 0.3,, 0.3.1, 0.4, 0.5,, 0.6,,,,,,,,, 0.7, 0.8, 1.0, 1.1,,,,, 1.2,,,,,
Change logChangelog
Dependenciesbase (>=4 && <4.9), bindings-libusb (>=1.4.5 && <1.5), bytestring (>=0.9 && <0.11), containers (>=0.1 && <0.6), ghc-prim (>=0.2 && <0.5), text (>=0.5 && <1.3), vector (>=0.5 && <0.11)
Copyright2009–2014 Bas van Dijk <>
AuthorBas van Dijk <>
MaintainerBas van Dijk <>
CategorySystem, Hardware
Home page
Bug tracker
Source repositoryhead: git clone git://
UploadedWed May 6 22:23:55 UTC 2015 by BasVanDijk
Downloads4407 total (249 in last 30 days)
StatusDocs available [build log]
Last success reported on 2015-05-06 [all 1 reports]




Maintainers' corner

For package maintainers and hackage trustees