Pure Go USB stack
usb
is a pure Go implementation of the USB stack (no CGo). It is a libusb
alternative for situations you need a go-native library.
usb
currently only supports linux, but with enough interest or requests, we can add more platforms.
package main
import "github.com/pzl/usb"
func main() {
dev, err := usb.VidPid(0x0c45, 0x6300) // get device by IDs
if err != nil {
// handle...
}
}
The top-level of this project can be used as a high-level library. See the docs at godoc.
The gusb
sub-directory can be used as a more low-level library, if that suits your needs. Documentation also at godoc.
Conversion from libusb is underway. Almost all enumeration and device descriptor function is implemented. IO (both sync and async) is in progress.
See API for a direct mapping of libusb calls to usb
methods.
- 0.0.1
- Work in Progress
MIT
Copyright 2019 Dan Panzarella
See LICENSE
file for full License details