---
title: Introduction to USB Device Interface Guide
framework: devicedrivers
role: article
path: apple-archive/documentation/DeviceDrivers/Conceptual/USBBook/USBIntro
---

# Introduction to USB Device Interface Guide

Provides background information and sample code for developing applications to communicate with or control USB devices and interfaces.

## Organization of This Document

This document contains the following chapters:

- [USB Device Overview](../USBOverview/USBOverview.html#//apple_ref/doc/uid/TP40002644-TPXREF101) provides an overview of USB device architecture and terminology and describes how USB devices are represented in OS X. - [Working With USB Device Interfaces](../USBDeviceInterfaces/USBDevInterfaces.html#//apple_ref/doc/uid/TP40002645-TPXREF101) describes how to use the device interface mechanism to create a command-line tool that accesses a USB device. - [Document Revision History](../USBRevisionHistory/USBRevHistory.html#//apple_ref/doc/uid/TP40002646-SW1) lists the revisions of this document.

## See Also

The ADC Reference Library contains several documents on device driver development for OS X and numerous sample drivers and applications.

- *[Accessing Hardware From Applications](../../AccessingHardware/AH_Intro/AH_Intro.html#//apple_ref/doc/uid/TP30000376)* describes various ways to access devices from outside the kernel, including the device interface mechanism provided by the I/O Kit. For an overview of the I/O Kit terms and concepts used in this document, read the chapter [Device Access and the I/O Kit](../../AccessingHardware/AH_Device_Access_IOKit/AH_Device_Access_IOKit.html#//apple_ref/doc/uid/TP30000378). - *[I/O Kit Framework Reference](https://developer.apple.com/documentation/iokit)* contains API reference for I/O Kit methods and functions and for specific device families. - [Sample Code > Hardware & Drivers > USB](../../../../../navigation/redirect.html#//apple_ref/doc/uid/TP30000925-TP40003576-TP30000583) includes both application-level and in-kernel code samples. Of particular relevance to this document is the application-level sample *[USBPrivateDataSample](../../../../../samplecode/USBPrivateDataSample/Introduction/Intro.html#//apple_ref/doc/uid/DTS10000456)*. - OS X Man Pages provides access to existing reference documentation for BSD and POSIX functions and tools in a convenient HTML format. - The [usb](http://lists.apple.com/mailman/listinfo/usb) mailing list provides a forum for discussing technical issues relating to USB devices in OS X.

If you need to develop an in-kernel driver for a USB modem or networking device, refer to the following:

- *[IOKit Fundamentals](../../IOKitFundamentals/Introduction/Introduction.html#//apple_ref/doc/uid/TP0000011)* describes the architecture of the I/O Kit, the object-oriented framework for developing OS X device drivers. - ADC members can view the AppleUSBCDCDriver project in the source code for OS X v10.3.7 and later, available at [Darwin Releases](http://www.opensource.apple.com/darwinsource/). To find the source code, select a version of OS X equal to or greater than v10.3.7 and click Source (choose the source for the PPC version, if there's a choice). This displays a new page, which lists the open source projects available for the version of OS X you've chosen. Scroll down to AppleUSBCDCDriver and click it to view the source. Be prepared to supply your ADC member name and password. - Additional code samples that demonstrate specific in-kernel driver programming techniques are included as part of the OS X Developer Tools installation package in `/Developer/Examples/Kernel/IOKit/usb`.

If you're ready to create a universal binary version of your USB device-access application to run in an Intel-based Macintosh, see *[Universal Binary Programming Guidelines, Second Edition](../../../../MacOSX/Conceptual/universal_binary/universal_binary_intro/universal_binary_intro.html#//apple_ref/doc/uid/TP40002217)*. The *Universal Binary Programming Guidelines* describes the differences between the Intel and PowerPC architectures and provides tips for developing a universal binary.

If you are working with a device that complies with the USB mass storage specification but declares its device class to be vendor specific, see *[Mass Storage Device Driver Programming Guide](../../MassStorage/01_Introduction/Introduction.html#//apple_ref/doc/uid/TP40000974)* for information on how to ensure the correct built-in driver loads for the device.

Apple provides additional USB information (including the OS X USB Debug Kits) at [http://developer.apple.com/hardwaredrivers/usb/index.html](http://developer.apple.com/hardwaredrivers/usb/index.html) .

A detailed description of the USB device specification is beyond the scope of this document—for more information, see *Universal Serial Bus Specification Revision 2.0* available at [http://www.usb.org](http://www.usb.org) .

[Next](../USBOverview/USBOverview.html)

Copyright © 2002, 2012 Apple Inc. All Rights Reserved. [Terms of Use](http://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](http://www.apple.com/privacy/) | Updated: 2012-01-09
