This package contains binding to libusb for the Nim programming language. libusb provides generic access to USB devices. It is portable, requires no special privileges or elevation and supports all versions of the USB protocol.
The following platforms have been built and tested with libusb 1.0.20:
- Mac OSX
All APIs marked as deprecated or intended solely for backwards compatibility have been ommitted from these bindings.
To run programs compiled with the bindings in this package you must have libusb installed on your computer.
If you are using FreeBSD then libusb is most likely already installed on your computer. You can find it in the Ports tree.
If you are using Linux then libusb is most likely already installed on your computer. If your Linux distribution includes a package manager or community repository, it likely also has the latest pre-compiled binaries for libusb.
For example, on ArchLinux you can get the library from the package manager:
sudo pacman -Sy libusb
Alternatively, you can download the latest source code from the libusb GitHub repository and compile the library yourself.
The easiest way to install pre-compiled binaries is through Macports:
sudo port install libusb
Another option is to use Homebrew:
brew install libusb
You may have to add a symbolic link to the installed library, so that your program is able to load it at run-time, for example:
sudo ln -s /opt/local/lib/libusb-1.0.dylib /usr/lib/libusb.dylib
Alternatively, you can download the latest source code from the libusb GitHub repository and compile the library yourself. An Xcode project is included.
Download the latest Windows Binaries snapshot from the libusb web site, copy
libusb-1.0.dll file into your program's folder. Alternatively, you can
download and compile the DLL from the code in the libusb GitHub repository.
This package does not have any dependencies to other Nim packages at this time.
Import the libusb module from this package to make the bindings available in your project: