BeagleBoard Linux Code for Accessing USB Devices
These are some Linux routines that demonstrate how to access USB devices from USB host port. The routines have been tested on a BeagleBoard-xM running Ubuntu 11.04.
Send comments, suggestions, etc. to jan (at) Lvr.com.
Control the LEDs
Provides led_initialize() and led_control() functions to initialize and control the usr0 and usr1 LEDs on the BeagleBoard. Other routines on this page use these functions.
Keypress Detect (HID class)
Decodes keypresses and turns the usr0 LED on or off according to the key pressed. Non-blocking. Uses the ncurses library.
Decodes keypresses and turns the usr0 LED on or off according to the key pressed. Non-blocking. Doesn't require the ncurses library.
Generic HID with hidapi
Demonstrates communicating with generic HID-class USB devices using hidapi and libusb-1.0. More info
Generic HID with libusb
Demonstrates communicating with generic HID-class USB devices using libusb-1.0.
WinUSB with libusb
Demonstrates communicating with a device designed for use with WinUSB or another vendor-defined driver. Uses libusb-1.0.
Mass Storage Write
Writes data to a USB drive at /usb/sda. To avoid writing to a no-longer-attached drive, verifies that the drive is mounted before writing to it.
Mass Storage Read
Reads data from a file on a USB drive and turns the usr0 and usr1 LEDs on or off according to the data read.
Prints a file to the default printer. Uses the CUPS API.
Virtual Serial Port
Communicates with a remote serial port using a USB/serial-port adapter.