| // Copyright 2018 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| library zircon.hw.usb; |
| |
| [repr="C"] |
| enum UsbSpeed : uint8 { |
| UNDEFINED = 0; |
| FULL = 1; |
| LOW = 2; |
| HIGH = 3; |
| SUPER = 4; |
| }; |
| |
| [Packed, repr="C"] |
| struct UsbSetup { |
| uint8 bmRequestType; |
| uint8 bRequest; |
| uint16 wValue; |
| uint16 wIndex; |
| uint16 wLength; |
| }; |
| |
| [Packed, repr="C"] |
| struct UsbDescriptorHeader { |
| uint8 bLength; |
| uint8 bDescriptorType; |
| }; |
| |
| [Packed, repr="C"] |
| struct UsbDeviceDescriptor { |
| uint8 bLength; |
| uint8 bDescriptorType; |
| uint16 bcdUSB; |
| uint8 bDeviceClass; |
| uint8 bDeviceSubClass; |
| uint8 bDeviceProtocol; |
| uint8 bMaxPacketSize0; |
| uint16 idVendor; |
| uint16 idProduct; |
| uint16 bcdDevice; |
| uint8 iManufacturer; |
| uint8 iProduct; |
| uint8 iSerialNumber; |
| uint8 bNumConfigurations; |
| }; |
| |
| [Packed, repr="C"] |
| struct UsbInterfaceDescriptor { |
| uint8 bLength; |
| uint8 bDescriptorType; |
| uint8 bInterfaceNumber; |
| uint8 bAlternateSetting; |
| uint8 bNumEndpoints; |
| uint8 bInterfaceClass; |
| uint8 bInterfaceSubClass; |
| uint8 bInterfaceProtocol; |
| uint8 iInterface; |
| }; |
| |
| [Packed, repr="C"] |
| struct UsbEndpointDescriptor { |
| uint8 bLength; |
| uint8 bDescriptorType; |
| uint8 bEndpointAddress; |
| uint8 bmAttributes; |
| uint16 wMaxPacketSize; |
| uint8 bInterval; |
| }; |
| |
| [Packed, repr="C"] |
| struct UsbSsEpCompDescriptor { |
| uint8 bLength; |
| uint8 bDescriptorType; |
| uint8 bMaxBurst; |
| uint8 bmAttributes; |
| uint16 wBytesPerInterval; |
| }; |