NAME
audio, disk, ether, kb, serial, ptp, usbd – Universal Serial Bus
drivers |
SYNOPSIS
nusb/audio devid nusb/cam [ –d ] devid nusb/disk [ –d ] devid nusb/ether [ –dD ] [ –t ethertype ] [ –a addr ] devid nusb/kb [ –d ] devid nusb/joy [ –d ] devid nusb/serial [ –d ] devid nusb/ptp [ –dD ] devid
nusb/usbd [ –dD ] |
DESCRIPTION
These programs drive USB devices of specific classes via usb(3).
Usually they are started by nusbrc(8) upon attachment of the device
to the bus. All drivers except usbd take the decimal usb devid
of the device they should handle as their last argument. A driver's
instance handles only one device at a time. Drivers that provide file systems make them available as shares under /shr (see shr(3)) or /shr/usb (which is bound after /dev by nusbrc(8)).
Options –d and –D trigger debug diagnostics and file system debugging
diagnostics for most drivers. Repeating any one of these may increase
verbosity. Hubs When the usbevent file is read, it returns a 6–column, space–separated line of text, one for each event. The columns are: attach or detach followed by addr vid did csp and hname. The addr is the decimal device address assigned. Vid and did are formatted as 4 digit hexadecimal. Csp is the device class, subclass, protocol identifier formatted as 6 digit hexadecimal. Usbd assigns a stable device identifier based on the device descriptor for hname. This information is read by nusbrc(8) and the addr and hname are passed to a suitable driver as devid in the form addr:hname.
The usbhubctl file provides per–port power switching control (PPPS)
by writing the following 4–column command format: portpower or
portindicator followed by hub, port and the state on or off where
hub selects the hub device (using its device address addr or hname)
and port is the decimal port
number (counting from 1). Keyboards and mice Joysticks Directional buttons are reported as axes with 3 positions: 0, 128, and 255 for left (or up), center and right (or down) respectively. Messages are in the form axis id position.
On/off buttons are reported as either down or up respectively.
Messages are in the form down|up id. Disks The storage device directory contains the usual files served by sd(3): data, raw, and ctl.
The ctl file supplies the device geometry and partitions when
read. Ptp configures and exposes a camera's (and often a mobile
device's) storage to allow transferring data via the Picture Transfer
Protocol (PTP). Ethernet Serial and JTAG ports
JTAG ports are similar but the files are named jtag and jtagctl. Audio devices Camera devices |
SOURCE
/sys/src/cmd/nusb |
SEE ALSO
camv(1), joy(1), audio(3), ether(3), mouse(3), sd(3), uart(3),
usb(3), shr(3), image(6), nusbrc(8), kbdfs(8) |
HISTORY
Joy first appeared in 9front (March, 2014). Cam first appeared in 9front (March, 2018). |
BUGS
The various device drivers are generic USB drivers and may work
only for certain devices of each class. USB ATA storage devices are not supported. The serial driver works only for the Prolific chip and Ftdi, and control of the dcd and dsr signals and some of the extra features are not implemented. For Ftdi, only the Sheevaplug and Guruplug have been tried. There is support for the EHCI debug port, but it loses bytes.
USB video format settings cannot be changed while camv(1) is running,
and must be set manually by writing them to cam(4)'sctl file before
starting the viewer. |