
QNX®Momentics®DDKUniversal Serial Bus (USB) DevicesFor QNX®Neutrino®6.3.0 or QNX®4© 2007, QNX Software Systems GmbH & Co. KG.
Building DDKs © 2007, QNX Software Systems GmbH & Co. KG.Please refer to the Managing Source Code chapter, and “QNX Source Package” inthe Common W
usbd_urb_status() © 2007, QNX Software Systems GmbH & Co. KG.Return status information on a URBSynopsis:#include <sys/usbdi.h>int usbd_urb_s
© 2007, QNX Software Systems GmbH & Co. KG. usbd_urb_status()USBD_STATUS_BITSTUFFINGThe last packet from the endpoint contained a bit-stuffing viol
usbd_urb_status() © 2007, QNX Software Systems GmbH & Co. KG.Classification:QNX Neutrino, QNX 4SafetyCancellation point NoInterrupt handler NoSigna
Index!_USBDI_NFUNCS 29Aarguments, getting command-line 22assumptions ixBbulk data transfers 8, 70bus topology, getting information about 84Ccallbacks
Index © 2007, QNX Software Systems GmbH & Co. KG.detaching from 8, 34extra memory, getting a pointer to 38features, controlling 43frame number and
© 2007, QNX Software Systems GmbH & Co. KG. IndexMmemorydata transfersallocating 19freeing 45getting physical address of 58management functions 15
Index © 2007, QNX Software Systems GmbH & Co. KG.vendor-specific transfers 8, 78submitting 8, 54usb 11USBdescriptors, getting and setting 8, 32link
© 2007, QNX Software Systems GmbH & Co. KG. Indexusbd_status() 80usbd_string_descriptor_t 56usbd_string() 82USBD_TIME_DEFAULT 54USBD_TIME_INFINITY
© 2007, QNX Software Systems GmbH & Co. KG. Building DDKsprebuilt install srcddk_install_dirplatformsmouseprinterkeyboarddevuhardwareincludeclassD
Typographical conventions © 2007, QNX Software Systems GmbH & Co. KG.In ksh and bash shells, All shell scripts are executed in a sub-shell by defa
© 2007, QNX Software Systems GmbH & Co. KG. Technical supportReference ExampleUser-interface components CancelWe use an arrow (→) in directions fo
Chapter 1Before You BeginIn this chapter. . .System requirements 3USB devices supported 3Known limitations 3September 10, 2007 Chapter 1 • Before You
© 2007, QNX Software Systems GmbH & Co. KG. Known limitationsSystem requirementsThis USB DDK is designed to work with both QNX Neutrino 6 and with
Known limitations © 2007, QNX Software Systems GmbH & Co. KG.Photon and text modeIf you’re using Photon as well as text mode, you won’t be able to
Chapter 2OverviewIn this chapter. . .The USB stack and library 7How a class driver works 8September 10, 2007 Chapter 2 • Overview 5
© 2000–2007, QNX Software Systems GmbH & Co. KG. All rights reserved.Published under license by:QNX Software Systems International Corporation175
© 2007, QNX Software Systems GmbH & Co. KG. The USB stack and libraryThe USB stack and libraryUSB (Universal Serial Bus) is a hardware and protoco
How a class dr iver works © 2007, QNX Software Systems GmbH & Co. KG.class of device, just as if they’d been started by the enumerator. When a dev
Chapter 3USB UtilitiesSeptember 10, 2007 Chapter 3 • USB Utilities 9
© 2007, QNX Software Systems GmbH & Co. KG.The USB Software Development Kit contains the following command-line utilities.For more information, se
Chapter 4USB Library ReferenceIn this chapter. . .Functions arranged by category 15usbd_abort_pipe() 18usbd_alloc() 19usbd_alloc_urb() 21usbd_args_loo
© 2007, QNX Software Systems GmbH & Co. KG.usbd_string() 82usbd_topology(), usbd_topology_ext() 84usbd_urb_status() 8614 Chapter 4 • USB Library R
© 2007, QNX Software Systems GmbH & Co. KG. Functions arranged by categoryThis chapter includes descriptions of the USB functions in alphabetical
ContentsAbout the USB DDK viiWhat you’ll find in this guide ixAssumptions ixBuilding DDKs ixTypographical conventions xiiNote to Windows users xiiiTech
Functions arranged by category © 2007, QNX Software Systems GmbH & Co. KG.usbd_setup_isochronous()Set up a URB for an isochronous transfer.usbd_se
© 2007, QNX Software Systems GmbH & Co. KG. Functions arranged by categoryusbd_device_lookup()Map the device instance identifier to an opaque devic
usbd_abort_pipe() © 2007, QNX Software Systems GmbH & Co. KG.Abort all requests on a pipeSynopsis:#include <sys/usbdi.h>int usbd_abort_pipe(
© 2007, QNX Software Systems GmbH & Co. KG. usbd_alloc()Allocate a memory area to use for data transfersSynopsis:#include <sys/usbdi.h>void
usbd_alloc() © 2007, QNX Software Systems GmbH & Co. KG.See also:usbd_alloc_urb(), usbd_free(), usbd_free_urb(), usbd_mphys()20 Chapter 4 • USB Li
© 2007, QNX Software Systems GmbH & Co. KG. usbd_alloc_urb()Allocate a USB Request Block for subsequent URB-based operationsSynopsis:#include <
usbd_args_lookup() © 2007, QNX Software Systems GmbH & Co. KG.Look up a driver’s command-line argumentsSynopsis:#include <sys/usbdi.h>void u
© 2007, QNX Software Systems GmbH & Co. KG. usbd_attach()Attach to a USB deviceSynopsis:#include <sys/usbdi.h>int usbd_attach( struct usbd_c
usbd_attach() © 2007, QNX Software Systems GmbH & Co. KG.LoopingAnother way to attach is to loop and attach to all devices (in which case you buil
© 2007, QNX Software Systems GmbH & Co. KG. usbd_close_pipe()Close a pipe previously opened by usbd_open_pipe()Synopsis:#include <sys/usbdi.h&g
© 2007, QNX Software Systems GmbH & Co. KG.Miscellaneous and convenience functions 16usbd_abort_pipe() 18usbd_alloc() 19usbd_alloc_urb() 21usbd_ar
usbd_configuration_descriptor() © 2007, QNX Software Systems GmbH & Co. KG.Get the configuration descriptor for a specific configuration settingSynops
© 2007, QNX Software Systems GmbH & Co. KG. usbd_configuration_descriptor()SafetyCancellation point NoInterrupt handler NoSignal handler NoThread Y
usbd_connect() © 2007, QNX Software Systems GmbH & Co. KG.Connect a client driver to the USB stackSynopsis:#include <sys/usbdi.h>int usbd_co
© 2007, QNX Software Systems GmbH & Co. KG. usbd_connect()ident A pointer to a usbd_device_ident_t structure that identifiesthe devices you’re inte
usbd_connect() © 2007, QNX Software Systems GmbH & Co. KG.ESRCH USB server not running.EACCESS Permission denied to USB server.EAGAIN Can’t create
© 2007, QNX Software Systems GmbH & Co. KG. usbd_connect()Caveats:The usbd_connect() function creates a thread on your behalf that’s used by the l
usbd_descriptor() © 2007, QNX Software Systems GmbH & Co. KG.Get or set USB descriptorsSynopsis:#include <sys/usbdi.h>int usbd_descriptor( s
© 2007, QNX Software Systems GmbH & Co. KG. usbd_descriptor()ENODEV Device was removed.EIO I/O error on USB device.Classification:QNX Neutrino, QNX
usbd_detach() © 2007, QNX Software Systems GmbH & Co. KG.Detach from the USB deviceSynopsis:#include <sys/usbdi.h>int usbd_detach( struct us
© 2007, QNX Software Systems GmbH & Co. KG. usbd_detach()See also:usbd_attach(), usbd_close_pipe(), usbd_connect(), usbd_disconnect(),usbd_open_pi
© 2007, QNX Software Systems GmbH & Co. KG.usbd_topology(), usbd_topology_ext() 84usbd_urb_status() 86Index 89September 10, 2007 Contents v
usbd_device_descriptor() © 2007, QNX Software Systems GmbH & Co. KG.Get the device descriptor for a specific deviceSynopsis:#include <sys/usbdi.
© 2007, QNX Software Systems GmbH & Co. KG. usbd_device_descriptor()Classification:QNX Neutrino, QNX 4SafetyCancellation point NoInterrupt handler
usbd_device_extra() © 2007, QNX Software Systems GmbH & Co. KG.Get a pointer to the memory allocated by the extra parameterSynopsis:#include <s
© 2007, QNX Software Systems GmbH & Co. KG. usbd_device_lookup()Map the device instance identifier to an opaque device handle (from usbd_attach())S
usbd_disconnect() © 2007, QNX Software Systems GmbH & Co. KG.Disconnect a client driver from the USB stackSynopsis:#include <sys/usbdi.h>int
© 2007, QNX Software Systems GmbH & Co. KG. usbd_endpoint_descriptor()Get the endpoint descriptor for a specific endpoint settingSynopsis:#include
usbd_endpoint_descriptor() © 2007, QNX Software Systems GmbH & Co. KG.Classification:QNX Neutrino, QNX 4SafetyCancellation point NoInterrupt handle
© 2007, QNX Software Systems GmbH & Co. KG. usbd_feature()Control a feature for a USB deviceSynopsis:#include <sys/usbdi.h>int usbd_feature(
usbd_feature() © 2007, QNX Software Systems GmbH & Co. KG.SafetyCancellation point YesInterrupt handler NoSignal handler NoThread YesSee also:usbd
© 2007, QNX Software Systems GmbH & Co. KG. usbd_free()Free the memory area allocated by usbd_alloc()Synopsis:#include <sys/usbdi.h>void usb
usbd_free_urb() © 2007, QNX Software Systems GmbH & Co. KG.Free the USB Request Block allocated by usbd_alloc_urb()Synopsis:#include <sys/usbdi
© 2007, QNX Software Systems GmbH & Co. KG. usbd_get_frame()Get the current frame number and frame length for a deviceSynopsis:int usbd_get_frame(
usbd_hcd_ext_info(), usbd_hcd_info() © 2007, QNX Software Systems GmbH & Co. KG.Get information on the USB host controller and DDK librarySynopsis
© 2007, QNX Software Systems GmbH & Co. KG. usbd_hcd_ext_info(), usbd_hcd_info()vusbd The version number of the USB DDK.controller The name of the
usbd_hub_descriptor() © 2007, QNX Software Systems GmbH & Co. KG.Get the hub descriptor for a specific (hub) deviceSynopsis:#include <sys/usbdi.
© 2007, QNX Software Systems GmbH & Co. KG. usbd_hub_descriptor()See also:usbd_args_lookup(), usbd_configuration_descriptor(), usbd_device_lookup()
usbd_interface_descriptor() © 2007, QNX Software Systems GmbH & Co. KG.Get the interface descriptor for a specific interface settingSynopsis:#inclu
© 2007, QNX Software Systems GmbH & Co. KG. usbd_interface_descriptor()Returns:A pointer to usbd_interface_descriptor_t on success, or NULL on err
usbd_io() © 2007, QNX Software Systems GmbH & Co. KG.Submit a previously set up URB to the USB stackSynopsis:#include <sys/usbdi.h>int usbd_
© 2007, QNX Software Systems GmbH & Co. KG. usbd_io()Returns:EBADF Improper usbd_connect() call.EINVAL Improper usbd_connect() call.ENODEV Device
About the USB DDKSeptember 10, 2007 About the USB DDK vii
usbd_languages_descriptor() © 2007, QNX Software Systems GmbH & Co. KG.Get the table of supported LANGIDs for the given deviceSynopsis:#include &l
© 2007, QNX Software Systems GmbH & Co. KG. usbd_languages_descriptor()See also:usbd_args_lookup(), usbd_configuration_descriptor(), usbd_device_lo
usbd_mphys() © 2007, QNX Software Systems GmbH & Co. KG.Get the physical address of memory allocated by usbd_alloc()Synopsis:#include <sys/usbd
© 2007, QNX Software Systems GmbH & Co. KG. usbd_open_pipe()Initialize the pipe described by the device or endpoint descriptorSynopsis:#include &l
usbd_open_pipe() © 2007, QNX Software Systems GmbH & Co. KG.See also:usbd_abort_pipe(), usbd_close_pipe(), usbd_pipe_endpoint(), usbd_reset_pipe()
© 2007, QNX Software Systems GmbH & Co. KG. usbd_parse_descriptors()Parse device descriptors looking for a specific entrySynopsis:#include <sys/
usbd_parse_descriptors() © 2007, QNX Software Systems GmbH & Co. KG.(ROOT)|(DEVICE) - (HUB) - (LANGUAGE TABLE)|(CONFIG) - ... (CONFIG)|(INTERFAC
© 2007, QNX Software Systems GmbH & Co. KG. usbd_pipe_device()Retrieve the device associated with the pipeSynopsis:#include <sys/usbdi.h>str
usbd_pipe_endpoint() © 2007, QNX Software Systems GmbH & Co. KG.Retrieve the endpoint number associated with the pipeSynopsis:#include <sys/usb
© 2007, QNX Software Systems GmbH & Co. KG. usbd_reset_device()Reset a USB deviceSynopsis:#include <sys/usbdi.h>int usbd_reset_device( struc
usbd_reset_pipe() © 2007, QNX Software Systems GmbH & Co. KG.Clear a stall condition on an endpoint identified by the pipe handleSynopsis:#include
© 2007, QNX Software Systems GmbH & Co. KG. usbd_select_config()Select the configuration for a USB deviceSynopsis:#include <sys/usbdi.h>int us
usbd_select_interface() © 2007, QNX Software Systems GmbH & Co. KG.Select the interface for a USB deviceSynopsis:#include <sys/usbdi.h>int u
© 2007, QNX Software Systems GmbH & Co. KG. usbd_select_interface()See also:usbd_select_config()September 10, 2007 Chapter 4 • USB Library Referenc
usbd_setup_bulk() © 2007, QNX Software Systems GmbH & Co. KG.Set up a URB for a bulk data transferSynopsis:#include <sys/usbdi.h>int usbd_se
© 2007, QNX Software Systems GmbH & Co. KG. usbd_setup_bulk()SafetySignal handler NoThread YesCaveats:To ensure that the correct physical address
usbd_setup_control() © 2007, QNX Software Systems GmbH & Co. KG.Set up a URB for a control transferThis function isn’t currently implemented. To s
© 2007, QNX Software Systems GmbH & Co. KG. usbd_setup_control()addr The address for the start of the transfer. You must use the buffer allocatedb
usbd_setup_interrupt() © 2007, QNX Software Systems GmbH & Co. KG.Set up a URB for an interrupt transferSynopsis:#include <sys/usbdi.h>int u
© 2007, QNX Software Systems GmbH & Co. KG. usbd_setup_interrupt()SafetySignal handler NoThread YesSee also:usbd_setup_bulk(), usbd_setup_control(
© 2007, QNX Software Systems GmbH & Co. KG. AssumptionsWhat you’ll find in this guideThe USB Driver Development Kit will help you write drivers for
usbd_setup_isochronous() © 2007, QNX Software Systems GmbH & Co. KG.Set up a URB for an isochronous transferSynopsis:#include <sys/usbdi.h>i
© 2007, QNX Software Systems GmbH & Co. KG. usbd_setup_isochronous()SafetyCancellation point NoInterrupt handler NoSignal handler NoThread YesSee
usbd_setup_vendor() © 2007, QNX Software Systems GmbH & Co. KG.Set up a URB for a vendor-specific transferSynopsis:#include <sys/usbdi.h>int
© 2007, QNX Software Systems GmbH & Co. KG. usbd_setup_vendor()Library:libusbdiDescription:This routine sets up a URB for a vendor-specific transfe
usbd_status() © 2007, QNX Software Systems GmbH & Co. KG.Get specific device statusSynopsis:#include <sys/usbdi.h>int usbd_status( struct usb
© 2007, QNX Software Systems GmbH & Co. KG. usbd_status()SafetyCancellation point NoInterrupt handler NoSignal handler NoThread YesSee also:usbd_d
usbd_string() © 2007, QNX Software Systems GmbH & Co. KG.Get a string descriptorSynopsis:#include <sys/usbdi.h>char *usbd_string( struct usb
© 2007, QNX Software Systems GmbH & Co. KG. usbd_string()SafetySignal handler NoThread NoSee also:usbd_args_lookup(), usbd_configuration_descriptor
usbd_topology(), usbd_topology_ext() © 2007, QNX Software Systems GmbH & Co. KG.Get the USB bus physical topologySynopsis:#include <sys/usbdi.h
© 2007, QNX Software Systems GmbH & Co. KG. usbd_topology(), usbd_topology_ext()The structure contains an array of usb_port_attachment_t structure
Comments to this Manuals