1# usb_ddk_types.h 2<!--Kit: Driver Development Kit--> 3<!--Subsystem: Driver--> 4<!--Owner: @lixinsheng2--> 5<!--Designer: @w00373942--> 6<!--Tester: @dong-dongzhen--> 7<!--Adviser: @w_Machine_cc--> 8 9## Overview 10 11Provides the enumerated variables, structures, and macros used in USB DDK APIs. 12 13**File to include**: <usb/usb_ddk_types.h> 14 15**Library**: libusb_ndk.z.so 16 17**System capability**: SystemCapability.Driver.USB.Extension 18 19**Since**: 10 20 21**Related module**: [UsbDDK](capi-usbddk.md) 22 23## Summary 24 25### Structs 26 27| Name| typedef Keyword| Description| 28| -- | -- | -- | 29| [UsbControlRequestSetup](capi-usbddk-usbcontrolrequestsetup.md) | __attribute__((aligned(8))) UsbControlRequestSetup | Control transfer setup data, which corresponds to **Setup Data** in the USB protocol.| 30| [UsbDeviceDescriptor](capi-usbddk-usbdevicedescriptor.md) | __attribute__((aligned(8))) UsbDeviceDescriptor | Standard device descriptor, which corresponds to **Standard Device Descriptor** in the USB protocol.| 31| [UsbConfigDescriptor](capi-usbddk-usbconfigdescriptor.md) | __attribute__((packed)) UsbConfigDescriptor | Standard configuration descriptor, which corresponds to **Standard Configuration Descriptor** in the USB protocol.| 32| [UsbInterfaceDescriptor](capi-usbddk-usbinterfacedescriptor.md) | __attribute__((packed)) UsbInterfaceDescriptor | Standard interface descriptor, which corresponds to **Standard Interface Descriptor** in the USB protocol.| 33| [UsbEndpointDescriptor](capi-usbddk-usbendpointdescriptor.md) | __attribute__((packed)) UsbEndpointDescriptor | Standard endpoint descriptor, which corresponds to **Standard Endpoint Descriptor** in the USB protocol.| 34| [UsbDdkEndpointDescriptor](capi-usbddk-usbddkendpointdescriptor.md) | UsbDdkEndpointDescriptor | Endpoint descriptor.| 35| [UsbDdkInterfaceDescriptor](capi-usbddk-usbddkinterfacedescriptor.md) | UsbDdkInterfaceDescriptor | Interface descriptor.| 36| [UsbDdkInterface](capi-usbddk-usbddkinterface.md) | UsbDdkInterface | USB DDK interface, which is a collection of alternate settings for a particular USB interface.| 37| [UsbDdkConfigDescriptor](capi-usbddk-usbddkconfigdescriptor.md) | UsbDdkConfigDescriptor | Configuration descriptor.| 38| [UsbRequestPipe](capi-usbddk-usbrequestpipe.md) | __attribute__((aligned(8))) UsbRequestPipe | Defines a USB request pipe.| 39| [UsbDeviceMemMap](capi-usbddk-usbdevicememmap.md) | UsbDeviceMemMap | Device memory map created by calling **OH_Usb_CreateDeviceMemMap**. A buffer using the device memory map can provide better performance.| 40| [Usb_DeviceArray](capi-usbddk-usb-devicearray.md) | Usb_DeviceArray | Defines the device ID list, which is used to store the device IDs and device quantity obtained using **OH_Usb_GetDevices**.| 41 42### Enums 43 44| Name| typedef Keyword| Description| 45| -- | -- | -- | 46| [UsbDdkErrCode](#usbddkerrcode) | UsbDdkErrCode | USB DDK error code definitions.| 47 48## Enum Description 49 50### UsbDdkErrCode 51 52``` 53enum UsbDdkErrCode 54``` 55 56**Description** 57 58USB DDK error code definitions. 59 60**Since**: 10 61 62| Enum| Description| 63| -- | -- | 64| USB_DDK_SUCCESS = 0 | Operation succeeded.| 65| USB_DDK_FAILED = -1 | Operation failed.| 66| USB_DDK_INVALID_PARAMETER = -2 | Invalid parameter.| 67| USB_DDK_MEMORY_ERROR = -3 | Memory-related error, for example, insufficient memory, memory data copy failure, or memory application failure.| 68| USB_DDK_INVALID_OPERATION = -4 | Invalid operation.| 69| USB_DDK_NULL_PTR = -5 | Null pointer.| 70| USB_DDK_DEVICE_BUSY = -6 | Device busy.| 71| USB_DDK_TIMEOUT = -7 | Transfer timeout.| 72