Mac Dev Center Mac OS X Reference Library Drivers, Kernel, & Hardware: User-Space Device Access I/O Kit Framework Reference
|
USBSpec.h |
Constants and definitions of parameters that are used in communcating with USB devices and interfaces.
Apple USB Vendor ID |
enum { kAppleVendorID = 0x05AC };
Apple's vendor ID, assigned by the USB-IF
Device Class Codes |
enum { kUSBCompositeClass = 0, kUSBCommClass = 2, // Deprecated kUSBCommunicationClass = 2, kUSBHubClass = 9, kUSBDataClass = 10, kUSBPersonalHealthcareClass = 15, kUSBDiagnosticClass = 220, kUSBWirelessControllerClass = 224, kUSBMiscellaneousClass = 239, kUSBApplicationSpecificClass = 254, kUSBVendorSpecificClass = 255 };
Constants for USB Device classes (bDeviceClass).
Device Request |
enum { kUSBRqGetStatus = 0, kUSBRqClearFeature = 1, kUSBRqGetState = 2, kUSBRqSetFeature = 3, kUSBRqReserved2 = 4, kUSBRqSetAddress = 5, kUSBRqGetDescriptor = 6, kUSBRqSetDescriptor = 7, kUSBRqGetConfig = 8, kUSBRqSetConfig = 9, kUSBRqGetInterface = 10, kUSBRqSetInterface = 11, kUSBRqSyncFrame = 12 };
Specifies values for the bRequest field of a Device Request.
Device Request Recipient |
enum { kUSBDevice = 0, kUSBInterface = 1, kUSBEndpoint = 2, kUSBOther = 3 };
This recipient is encoded in the bmRequestType field of a Device Request. It specifies the type of recipient for a request: the device, the interface, or an endpoint.
Device Request Type |
enum { kUSBStandard = 0, kUSBClass = 1, kUSBVendor = 2 };
This type is encoded in the bmRequestType field of a Device Request. It specifies the type of request: standard, class or vendor specific.
DFU Class Attributes |
enum { kUSBDFUAttributesMask = 0x07, kUSBDFUCanDownloadBit = 0, kUSBDFUCanUploadBit = 1, kUSBDFUManifestationTolerantBit = 2 };
Endpoint Descriptor bits |
enum { kUSBbEndpointAddressMask = 0x0f, kUSBbEndpointDirectionBit = 7, kUSBbEndpointDirectionMask = ( 1 << kUSBbEndpointDirectionBit ), kUSBEndpointDirectionOut = 0x00, kUSBEndpointDirectionIn = 0x80, kUSBEndpointbmAttributesTransferTypeMask = 0x03, kUSBEndpointbmAttributesSynchronizationTypeMask = 0x0c, kUSBEndpointbmAttributesSynchronizationTypeShift = 2, kUSBEndpointbmAttributesUsageTypeMask = 0x30, kUSBEndpointbmAttributesUsageTypeShift = 4 };
Bit definitions for endpoint descriptor fields
Endpoint direction |
enum { kUSBOut = 0, kUSBIn = 1, kUSBNone = 2, kUSBAnyDirn = 3 };
Used in IOUSBFindEndpointRequest's direction field
Endpoint type |
enum { kUSBControl = 0, kUSBIsoc = 1, kUSBBulk = 2, kUSBInterrupt = 3, kUSBAnyType = 0xFF };
Used in IOUSBFindEndpointRequest's type field
Feature Selectors |
enum { kUSBFeatureEndpointStall = 0, kUSBFeatureDeviceRemoteWakeup = 1 };
Used with SET/CLEAR_FEATURE requests.
HID Protocol |
enum { kHIDBootProtocolValue = 0, kHIDReportProtocolValue = 1 };
Used in the SET_PROTOCOL device request
HID report types |
enum { kHIDRtInputReport = 1, kHIDRtOutputReport = 2, kHIDRtFeatureReport = 3 };
Constants for the three kinds of HID reports.
HID requests |
enum { kHIDRqGetReport = 1, kHIDRqGetIdle = 2, kHIDRqGetProtocol = 3, kHIDRqSetReport = 9, kHIDRqSetIdle = 10, kHIDRqSetProtocol = 11 };
Constants for HID requests.
Interface Class |
enum { kUSBAudioClass = 1, // Deprecated kUSBAudioInterfaceClass = 1, kUSBCommunicationControlInterfaceClass = 2, kUSBCommunicationDataInterfaceClass = 10, kUSBHIDClass = 3, kUSBHIDInterfaceClass = 3, kUSBPhysicalInterfaceClass = 5, kUSBImageInterfaceClass = 6, kUSBPrintingClass = 7, // Deprecated kUSBPrintingInterfaceClass = 7, kUSBMassStorageClass = 8, // Deprecated kUSBMassStorageInterfaceClass = 8, kUSBChipSmartCardInterfaceClass = 11, kUSBContentSecurityInterfaceClass = 13, kUSBVideoInterfaceClass = 14, kUSBPersonalHealthcareInterfaceClass = 15, kUSBDiagnosticDeviceInterfaceClass = 220, kUSBWirelessControllerInterfaceClass = 224, kUSBApplicationSpecificInterfaceClass = 254, kUSBVendorSpecificInterfaceClass = 255 };
Constants for Interface classes (bInterfaceClass).
Interface Protocol |
enum { // For kUSBHIDInterfaceClass // kHIDNoInterfaceProtocol = 0, kHIDKeyboardInterfaceProtocol = 1, kHIDMouseInterfaceProtocol = 2, kUSBVendorSpecificProtocol = 0xff, // For kUSBDiagnosticDeviceInterfaceClass // kUSB2ComplianceDeviceProtocol = 0x01, // For kUSBWirelessControllerInterfaceClass // kUSBBluetoothProgrammingInterfaceProtocol = 0x01, // For kUSBMiscellaneousClass // KUSBInterfaceAssociationDescriptorProtocol = 0x01 };
Reported in the bInterfaceProtocol field of the Interface Descriptor.
Interface SubClass |
enum { kUSBCompositeSubClass = 0, kUSBHubSubClass = 0, // For the kUSBAudioInterfaceClass // kUSBAudioControlSubClass = 0x01, kUSBAudioStreamingSubClass = 0x02, kUSBMIDIStreamingSubClass = 0x03, // For the kUSBApplicationSpecificInterfaceClass // kUSBDFUSubClass = 0x01, kUSBIrDABridgeSubClass = 0x02, kUSBTestMeasurementSubClass = 0x03, // For the kUSBMassStorageInterfaceClass // kUSBMassStorageRBCSubClass = 0x01, kUSBMassStorageATAPISubClass = 0x02, kUSBMassStorageQIC157SubClass = 0x03, kUSBMassStorageUFISubClass = 0x04, kUSBMassStorageSFF8070iSubClass = 0x05, kUSBMassStorageSCSISubClass = 0x06, // For the kUSBHIDInterfaceClass // kUSBHIDBootInterfaceSubClass = 0x01, // For the kUSBCommunicationDataInterfaceClass // kUSBCommDirectLineSubClass = 0x01, kUSBCommAbstractSubClass = 0x02, kUSBCommTelephoneSubClass = 0x03, kUSBCommMultiChannelSubClass = 0x04, kUSBCommCAPISubClass = 0x05, kUSBCommEthernetNetworkingSubClass = 0x06, kUSBATMNetworkingSubClass = 0x07, // For the kUSBDiagnosticDeviceInterfaceClass // kUSBReprogrammableDiagnosticSubClass = 0x01, // For the kUSBWirelessControllerInterfaceClass // kUSBRFControllerSubClass = 0x01, // For the kUSBMiscellaneousClass // kUSBCommonClassSubClass = 0x02, // For the kUSBVideoInterfaceClass // kUSBVideoControlSubClass = 0x01, kUSBVideoStreamingSubClass = 0x02, kUSBVideoInterfaceCollectionSubClass = 0x03 };
Constants for USB Interface SubClasses (bInterfaceSubClass).
Printer Class Requests |
enum { kUSPrintingClassGetDeviceID = 0, kUSPrintingClassGePortStatus = 1, kUSPrintingClassSoftReset = 2 };
The bRequest parameter for Printing Class Sepcific Requests
USB Descriptors |
enum { kUSBAnyDesc = 0, // Wildcard for searches kUSBDeviceDesc = 1, kUSBConfDesc = 2, kUSBStringDesc = 3, kUSBInterfaceDesc = 4, kUSBEndpointDesc = 5, kUSBDeviceQualifierDesc = 6, kUSBOtherSpeedConfDesc = 7, kUSBInterfacePowerDesc = 8, kUSBOnTheGoDesc = 9, kUSDebugDesc = 10, kUSBInterfaceAssociationDesc = 11, kUSBHIDDesc = 0x21, kUSBReportDesc = 0x22, kUSBPhysicalDesc = 0x23, kUSBHUBDesc = 0x29 };
Specifies values for diffent descriptor types.
USB Power constants |
enum { kUSB100mAAvailable = 50, kUSB500mAAvailable = 250, kUSB100mA = 50, kUSBAtrBusPowered = 0x80, kUSBAtrSelfPowered = 0x40, kUSBAtrRemoteWakeup = 0x20 };
Constants relating to USB Power.
USB Release constants |
enum { kUSBRel10 = 0x0100, kUSBRel11 = 0x0110, kUSBRel20 = 0x0200 };
Constants relating to USB releases as found in the bcdUSB field of the Device Descriptor.
kUSB1284DeviceID |
#define kUSB1284DeviceID "1284 Device ID"
Various constants used to describe the fields in the various USB Device Descriptors and IORegistry names used for some of those fields
kUSBAlternateSetting |
#define kUSBAlternateSetting "bAlternateSetting"
Various constants used to describe the fields in the various USB Device Descriptors and IORegistry names used for some of those fields
kUSBConfigurationValue |
#define kUSBConfigurationValue "bConfigurationValue"
Various constants used to describe the fields in the various USB Device Descriptors and IORegistry names used for some of those fields
kUSBDeviceClass Descriptor and IORegistry constants |
#define kUSBDeviceClass "bDeviceClass"
Various constants used to describe the fields in the various USB Device Descriptors and IORegistry names used for some of those fields
kUSBDeviceMaxPacketSize |
#define kUSBDeviceMaxPacketSize "bMaxPacketSize0"
Various constants used to describe the fields in the various USB Device Descriptors and IORegistry names used for some of those fields
kUSBDeviceNumConfigs |
#define kUSBDeviceNumConfigs "bNumConfigurations"
Various constants used to describe the fields in the various USB Device Descriptors and IORegistry names used for some of those fields
kUSBDeviceProtocol |
#define kUSBDeviceProtocol "bDeviceProtocol"
Various constants used to describe the fields in the various USB Device Descriptors and IORegistry names used for some of those fields
kUSBDeviceReleaseNumber |
#define kUSBDeviceReleaseNumber "bcdDevice"
Various constants used to describe the fields in the various USB Device Descriptors and IORegistry names used for some of those fields
kUSBDeviceSubClass |
#define kUSBDeviceSubClass "bDeviceSubClass"
Various constants used to describe the fields in the various USB Device Descriptors and IORegistry names used for some of those fields
kUSBInterfaceClass |
#define kUSBInterfaceClass "bInterfaceClass"
Various constants used to describe the fields in the various USB Device Descriptors and IORegistry names used for some of those fields
kUSBInterfaceNumber |
#define kUSBInterfaceNumber "bInterfaceNumber"
Various constants used to describe the fields in the various USB Device Descriptors and IORegistry names used for some of those fields
kUSBInterfaceProtocol |
#define kUSBInterfaceProtocol "bInterfaceProtocol"
Various constants used to describe the fields in the various USB Device Descriptors and IORegistry names used for some of those fields
kUSBInterfaceStringIndex |
#define kUSBInterfaceStringIndex "iInterface"
Various constants used to describe the fields in the various USB Device Descriptors and IORegistry names used for some of those fields
kUSBInterfaceSubClass |
#define kUSBInterfaceSubClass "bInterfaceSubClass"
Various constants used to describe the fields in the various USB Device Descriptors and IORegistry names used for some of those fields
kUSBManufacturerStringIndex |
#define kUSBManufacturerStringIndex "iManufacturer"
Various constants used to describe the fields in the various USB Device Descriptors and IORegistry names used for some of those fields
kUSBNumEndpoints |
#define kUSBNumEndpoints "bNumEndpoints"
Various constants used to describe the fields in the various USB Device Descriptors and IORegistry names used for some of those fields
kUSBProductID |
#define kUSBProductID "idProduct" // good name
Various constants used to describe the fields in the various USB Device Descriptors and IORegistry names used for some of those fields
kUSBProductName |
#define kUSBProductName "idProduct" /* good name \ */ // bad name - keep for backward compatibility
Various constants used to describe the fields in the various USB Device Descriptors and IORegistry names used for some of those fields
kUSBProductString |
#define kUSBProductString "USB Product Name"
Various constants used to describe the fields in the various USB Device Descriptors and IORegistry names used for some of those fields
kUSBProductStringIndex |
#define kUSBProductStringIndex "iProduct"
Various constants used to describe the fields in the various USB Device Descriptors and IORegistry names used for some of those fields
kUSBSerialNumberString |
#define kUSBSerialNumberString "USB Serial Number"
Various constants used to describe the fields in the various USB Device Descriptors and IORegistry names used for some of those fields
kUSBSerialNumberStringIndex |
#define kUSBSerialNumberStringIndex "iSerialNumber"
Various constants used to describe the fields in the various USB Device Descriptors and IORegistry names used for some of those fields
kUSBVendorID |
#define kUSBVendorID "idVendor" // good name
Various constants used to describe the fields in the various USB Device Descriptors and IORegistry names used for some of those fields
kUSBVendorName |
#define kUSBVendorName "idVendor" /* good name \ */ // bad name - keep for backward compatibility
Various constants used to describe the fields in the various USB Device Descriptors and IORegistry names used for some of those fields
kUSBVendorString |
#define kUSBVendorString "USB Vendor Name"
Various constants used to describe the fields in the various USB Device Descriptors and IORegistry names used for some of those fields
Last Updated: 2009-10-15