harmony 鸿蒙usb_ddk_types.h
usb_ddk_types.h
Overview
Provides the enumerated variables, structures, and macros used in USB DDK APIs.
Since
10
Related Modules
Summary
Structs
Name | Description |
---|---|
UsbControlRequestSetup | Setup data for control transfer, corresponding to Setup Data in the USB protocol. |
UsbDeviceDescriptor | Standard device descriptor, corresponding to Standard Device Descriptor in the USB protocol. |
UsbConfigDescriptor | Standard configuration descriptor, corresponding to Standard Configuration Descriptor in the USB protocol. |
UsbInterfaceDescriptor | Standard interface descriptor, corresponding to Standard Interface Descriptor in the USB protocol. |
UsbEndpointDescriptor | Standard endpoint descriptor, corresponding to Standard Endpoint Descriptor in the USB protocol. |
UsbDdkEndpointDescriptor | Endpoint descriptor. |
UsbDdkInterfaceDescriptor | Interface descriptor. |
UsbDdkInterface | USB DDK interface, which is a collection of alternate settings for a particular USB interface. |
UsbDdkConfigDescriptor | Configuration descriptor. |
UsbRequestPipe | Request pipe. |
UsbDeviceMemMap | Device memory map created by calling OH_Usb_CreateDeviceMemMap(). A buffer using the device memory map can provide better performance. |
Usb_DeviceArray | Defines the device ID list, which is used to store the device IDs and device quantity obtained using OH_Usb_GetDevices(). |
Types
Name | Description |
---|---|
typedef struct UsbDdkEndpointDescriptor UsbDdkEndpointDescriptor | Endpoint descriptor. |
typedef struct UsbDdkInterfaceDescriptor UsbDdkInterfaceDescriptor | Interface descriptor. |
typedef struct UsbDdkInterface UsbDdkInterface | USB interface. |
typedef struct UsbDdkConfigDescriptor UsbDdkConfigDescriptor | Configuration descriptor. |
typedef struct UsbDeviceMemMap UsbDeviceMemMap | Device memory map created by calling OH_Usb_CreateDeviceMemMap(). A buffer using the device memory map can provide better performance. |
typedef struct Usb_DeviceArray Usb_DeviceArray | Defines the device ID list, which is used to store the device IDs and device quantity obtained using OH_Usb_GetDevices(). |
Enums
Name | Description |
---|---|
UsbDdkErrCode { USB_DDK_SUCCESS = 0, USB_DDK_FAILED = -1, USB_DDK_INVALID_PARAMETER = -2, USB_DDK_MEMORY_ERROR = -3, USB_DDK_INVALID_OPERATION = -4, USB_DDK_NULL_PTR = -5, USB_DDK_DEVICE_BUSY = -6, USB_DDK_TIMEOUT = -7 } |
USB DDK error code definition. |
Variables
Name | Description |
---|---|
bmRequestType | Request type. |
bRequest | Specific request. |
wValue | Value corresponding to wValue in the USB protocol. Its meaning varies according to the request. |
wIndex | Index corresponding to wIndex in the USB protocol. It is usually used to transfer the index or offset. Its meaning varies according to the request. |
wLength | Data length corresponding to wLength in the USB protocol. If data is transferred, this field indicates the number of transferred bytes. |
bLength | Size of the descriptor, in bytes. |
bDescriptorType | Descriptor type. |
bcdUSB | USB protocol release number. |
bDeviceClass | Interface class code allocated by the USB-IF. |
bDeviceSubClass | Device subclass code allocated by USB-IF. The value is limited by that of bDeviceClass. |
bDeviceProtocol | Protocol code allocated by USB-IF. The value is limited by that of bDeviceClass and bDeviceSubClass. |
bMaxPacketSize0 | Maximum packet size of endpoint 0. Only values 8, 16, 32, and 64 are valid. |
idVendor | Vendor ID allocated by USB-IF. |
idProduct | Product ID allocated by the vendor. |
bcdDevice | Device release number. |
iManufacturer | Index of the string descriptor that describes the vendor. |
iProduct | Index of the string descriptor that describes the product. |
iSerialNumber | Index of the string descriptor that describes the device SN. |
bNumConfigurations | Configuration quantity. |
wTotalLength | Total length of the configuration descriptor, including the configuration, interface, endpoint, and class- or vendor-specific descriptors. |
bNumInterfaces | Number of interfaces supported by the configuration. |
bConfigurationValue | Configuration index, which is used to select the configuration. |
iConfiguration | Index of the string descriptor that describes the configuration. |
bmAttributes | Configuration attributes, including the power mode and remote wakeup. |
bMaxPower | Maximum power consumption of the bus-powered USB device, in 2 mA. |
bInterfaceNumber | Interface ID. |
bAlternateSetting | Value used to select the alternate setting of the interface. |
bNumEndpoints | Number of endpoints (excluding endpoint 0) used by the interface. |
bInterfaceClass | Interface class code allocated by the USB-IF. |
bInterfaceSubClass | Device subclass code allocated by USB-IF. The value is limited by that of bInterfaceClass. |
bInterfaceProtocol | Protocol code allocated by USB-IF. The value is limited by that of bInterfaceClass and bInterfaceSubClass. |
iInterface | Index of the string descriptor that describes the interface. |
bEndpointAddress | Endpoint address, including the endpoint number and endpoint direction. |
bmAttributes | Endpoint attributes, including the transfer type, synchronization type, and usage type. |
wMaxPacketSize | Maximum packet size supported by an endpoint. |
bInterval | Interval for polling endpoints for data transfer. |
bRefresh | Refresh rate for audio devices. |
bSynchAddress | Endpoint synchronization address for audio devices. |
interfaceHandle | Interface operation handle. |
endpoint | Endpoint address. |
timeout | Timeout duration, in milliseconds. |
deviceIds | Start address of the device ID array. |
num | Device quantity. |
Variable Description
bAlternateSetting
uint8_t bAlternateSetting
Description
Value used to select the alternate setting of the interface.
bcdDevice
uint16_t bcdDevice
Description
Device release number.
bcdUSB
uint16_t bcdUSB
Description
USB protocol release number.
bConfigurationValue
uint8_t bConfigurationValue
Description
Configuration index, which is used to select the configuration.
bDescriptorType
uint8_t bDescriptorType
Description
Descriptor type.
bDeviceClass
uint8_t bDeviceClass
Description
Interface class code allocated by the USB-IF.
bDeviceProtocol
uint8_t bDeviceProtocol
Description
Protocol code allocated by USB-IF. The value is limited by that of bDeviceClass and bDeviceSubClass.
bDeviceSubClass
uint8_t bDeviceSubClass
Description
Device subclass code allocated by USB-IF. The value is limited by that of bDeviceClass.
bEndpointAddress
uint8_t bEndpointAddress
Description
Endpoint address, including the endpoint number and endpoint direction.
bmAttributes
uint8_t bmAttributes
Description
Endpoint attributes, including the transfer type, synchronization type, and usage type.
bInterfaceClass
uint8_t bInterfaceClass
Description
Interface class code allocated by the USB-IF.
bInterfaceNumber
uint8_t bInterfaceNumber
Description
Interface ID.
bInterfaceProtocol
uint8_t bInterfaceProtocol
Description
Protocol code allocated by USB-IF. The value is limited by that of bInterfaceClass and bInterfaceSubClass.
bInterfaceSubClass
uint8_t bInterfaceSubClass
Description
Device subclass code allocated by USB-IF. The value is limited by that of bInterfaceClass.
bInterval
uint8_t bInterval
Description
Interval for polling endpoints for data transfer.
bLength
uint8_t bLength
Description
Size of the descriptor, in bytes.
bmAttributes
uint8_t bmAttributes
Description
Configuration attributes, including the power mode and remote wakeup.
bMaxPacketSize0
uint8_t bMaxPacketSize0
Description
Maximum packet size of endpoint 0. Only values 8, 16, 32, and 64 are valid.
bMaxPower
uint8_t bMaxPower
Description
Maximum power consumption of the bus-powered USB device, in 2 mA.
bNumConfigurations
uint8_t bNumConfigurations
Description
Configuration quantity.
bNumEndpoints
uint8_t bNumEndpoints
Description
Number of endpoints (excluding endpoint 0) used by the interface.
bNumInterfaces
uint8_t bNumInterfaces
Description
Number of interfaces supported by the configuration.
bRefresh
uint8_t bRefresh
Description
Refresh rate for audio devices.
bSynchAddress
uint8_t bSynchAddress
Description
Endpoint synchronization address for audio devices.
endpoint
uint8_t endpoint
Description
Endpoint address.
iConfiguration
uint8_t iConfiguration
Description
Index of the string descriptor that describes the configuration.
idProduct
uint16_t idProduct
Description
Product ID allocated by the vendor.
idVendor
uint16_t idVendor
Description
Vendor ID allocated by USB-IF.
iInterface
uint8_t iInterface
Description
Index of the string descriptor that describes the interface.
iManufacturer
uint8_t iManufacturer
Description
Index of the string descriptor that describes the vendor.
wIndex
uint16_t wIndex
Description
Index corresponding to wIndex in the USB protocol. It is usually used to transfer the index or offset. Its meaning varies according to the request.
interfaceHandle
uint64_t interfaceHandle
Description
Interface operation handle.
iProduct
uint8_t iProduct
Description
Index of the string descriptor that describes the product.
iSerialNumber
uint8_t iSerialNumber
Description
Index of the string descriptor that describes the device SN.
wLength
uint16_t wLength
Description
Data length corresponding to wLength in the USB protocol. If data is transferred, this field indicates the number of transferred bytes.
bRequest
uint8_t bRequest
Description
Specific request.
bmRequestType
uint8_t bmRequestType
Description
Request type.
timeout
uint32_t timeout
Description
Timeout duration, in milliseconds.
wValue
uint16_t wValue
Description
Value corresponding to wValue in the USB protocol. Its meaning varies according to the request.
wMaxPacketSize
uint16_t wMaxPacketSize
Description
Maximum packet size supported by an endpoint.
wTotalLength
uint16_t wTotalLength
Description
Total length of the configuration descriptor, including the configuration, interface, endpoint, and class- or vendor-specific descriptors.
deviceIds
uint64_t* deviceIds
Description
Defines the start address of the device ID array. The number of device IDs cannot exceed 128.
num
uint32_t num
Description
Defines the device quantity. Device IDs are obtained by traversing deviceIds based on the value of this parameter. If the value is 0, there is no USB device.
你可能感兴趣的鸿蒙文章
- 所属分类: 后端技术
- 本文标签:
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
8、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦