| // Copyright 2021 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. |
| @available(added=7) |
| library fuchsia.hardware.usb.descriptor; |
| |
| // USB standard descriptor specifications. |
| type UsbSpeed = strict enum : uint32 { |
| UNDEFINED = 0; |
| FULL = 1; |
| LOW = 2; |
| HIGH = 3; |
| SUPER = 4; |
| ENHANCED_SUPER = 5; |
| }; |
| |
| @packed |
| type UsbSetup = struct { |
| bm_request_type uint8; |
| b_request uint8; |
| w_value uint16; |
| w_index uint16; |
| w_length uint16; |
| }; |
| |
| @packed |
| type UsbDeviceDescriptor = struct { |
| b_length uint8; |
| b_descriptor_type uint8; |
| bcd_usb uint16; |
| b_device_class uint8; |
| b_device_sub_class uint8; |
| b_device_protocol uint8; |
| b_max_packet_size0 uint8; |
| id_vendor uint16; |
| id_product uint16; |
| bcd_device uint16; |
| i_manufacturer uint8; |
| i_product uint8; |
| i_serial_number uint8; |
| b_num_configurations uint8; |
| }; |
| |
| @packed |
| type UsbSsEpCompDescriptor = struct { |
| b_length uint8; |
| b_descriptor_type uint8; |
| b_max_burst uint8; |
| bm_attributes uint8; |
| w_bytes_per_interval uint16; |
| }; |
| |
| @packed |
| type UsbEndpointDescriptor = struct { |
| b_length uint8; |
| b_descriptor_type uint8; |
| b_endpoint_address uint8; |
| bm_attributes uint8; |
| w_max_packet_size uint16; |
| b_interval uint8; |
| }; |
| |
| @packed |
| type UsbInterfaceDescriptor = struct { |
| b_length uint8; |
| b_descriptor_type uint8; |
| b_interface_number uint8; |
| b_alternate_setting uint8; |
| b_num_endpoints uint8; |
| b_interface_class uint8; |
| b_interface_sub_class uint8; |
| b_interface_protocol uint8; |
| i_interface uint8; |
| }; |