mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-16 18:53:29 +00:00
add Interface Association Descriptor
This commit is contained in:
@@ -159,6 +159,7 @@ const (
|
|||||||
descCDCConfigSize = uint16(
|
descCDCConfigSize = uint16(
|
||||||
descLengthConfigure + // Configuration Header
|
descLengthConfigure + // Configuration Header
|
||||||
descLengthInterface + // CDC Interface Descriptor
|
descLengthInterface + // CDC Interface Descriptor
|
||||||
|
descLengthInterfaceAssociation + // IAD
|
||||||
descCDCFuncLengthHeader + // CDC Header
|
descCDCFuncLengthHeader + // CDC Header
|
||||||
descCDCFuncLengthCallManagement + // CDC Call Management Func Descriptor
|
descCDCFuncLengthCallManagement + // CDC Call Management Func Descriptor
|
||||||
descCDCFuncLengthAbstractControl + // CDC Abstract Control Func Descriptor
|
descCDCFuncLengthAbstractControl + // CDC Abstract Control Func Descriptor
|
||||||
@@ -282,9 +283,9 @@ var descCDC = [dcdCount]descCDCClass{
|
|||||||
descTypeDevice, // Descriptor Type
|
descTypeDevice, // Descriptor Type
|
||||||
lsU8(descUSBSpecVersion), // USB Specification Release Number in BCD (low)
|
lsU8(descUSBSpecVersion), // USB Specification Release Number in BCD (low)
|
||||||
msU8(descUSBSpecVersion), // USB Specification Release Number in BCD (high)
|
msU8(descUSBSpecVersion), // USB Specification Release Number in BCD (high)
|
||||||
0, // Class code (assigned by the USB-IF).
|
descDeviceClassCodeMisc, // Class code (assigned by the USB-IF).
|
||||||
0, // Subclass code (assigned by the USB-IF).
|
descDeviceSubClassCommon, // Subclass code (assigned by the USB-IF).
|
||||||
0, // Protocol code (assigned by the USB-IF).
|
descDeviceProtocolIAD, // Protocol code (assigned by the USB-IF).
|
||||||
descEndptMaxPktSize, // Maximum packet size for endpoint zero (8, 16, 32, or 64)
|
descEndptMaxPktSize, // Maximum packet size for endpoint zero (8, 16, 32, or 64)
|
||||||
lsU8(descCommonVendorID), // Vendor ID (low) (assigned by the USB-IF)
|
lsU8(descCommonVendorID), // Vendor ID (low) (assigned by the USB-IF)
|
||||||
msU8(descCommonVendorID), // Vendor ID (high) (assigned by the USB-IF)
|
msU8(descCommonVendorID), // Vendor ID (high) (assigned by the USB-IF)
|
||||||
@@ -320,6 +321,16 @@ var descCDC = [dcdCount]descCDCClass{
|
|||||||
descEndptConfigAttr, // Configuration attributes
|
descEndptConfigAttr, // Configuration attributes
|
||||||
descCDCMaxPowerMa >> 1, // Max power consumption when fully-operational (2 mA units)
|
descCDCMaxPowerMa >> 1, // Max power consumption when fully-operational (2 mA units)
|
||||||
|
|
||||||
|
// Interface Association Descriptor
|
||||||
|
descLengthInterfaceAssociation, // Size of this descriptor in bytes
|
||||||
|
descTypeInterfaceAssociation, // Descriptor Type
|
||||||
|
0x00, // bFirstInterface
|
||||||
|
descCDCInterfaceCount, // bInterfaceCount
|
||||||
|
0x02, // bFunctionClass : Communications and CDC Control (0x02)
|
||||||
|
0x02, // bFunctionSubClass
|
||||||
|
0x00, // bFunctionProtocol
|
||||||
|
0x00, // iFunction
|
||||||
|
|
||||||
// Communication/Control Interface Descriptor
|
// Communication/Control Interface Descriptor
|
||||||
descLengthInterface, // Descriptor length
|
descLengthInterface, // Descriptor length
|
||||||
descTypeInterface, // Descriptor type
|
descTypeInterface, // Descriptor type
|
||||||
|
|||||||
+16
-10
@@ -8,16 +8,17 @@ const descLanguageEnglish = uint16(0x0409) // (US) English
|
|||||||
const (
|
const (
|
||||||
|
|
||||||
// Descriptor length
|
// Descriptor length
|
||||||
descLengthDevice = 18
|
descLengthDevice = 18
|
||||||
descLengthConfigure = 9
|
descLengthConfigure = 9
|
||||||
descLengthInterface = 9
|
descLengthInterface = 9
|
||||||
descLengthEndpoint = 7
|
descLengthInterfaceAssociation = 8
|
||||||
descLengthQualification = 10
|
descLengthEndpoint = 7
|
||||||
descLengthOTG = 5
|
descLengthQualification = 10
|
||||||
descLengthBOS = 5
|
descLengthOTG = 5
|
||||||
descLengthEndpointCompanion = 6
|
descLengthBOS = 5
|
||||||
descLengthUSB20Extension = 7
|
descLengthEndpointCompanion = 6
|
||||||
descLengthSuperspeed = 10
|
descLengthUSB20Extension = 7
|
||||||
|
descLengthSuperspeed = 10
|
||||||
|
|
||||||
// Descriptor type
|
// Descriptor type
|
||||||
descTypeDevice = 0x01
|
descTypeDevice = 0x01
|
||||||
@@ -133,6 +134,11 @@ const (
|
|||||||
descDeviceCapExtAttrLPMPos = 1
|
descDeviceCapExtAttrLPMPos = 1
|
||||||
descDeviceCapExtAttrBESLMsk = 0x04
|
descDeviceCapExtAttrBESLMsk = 0x04
|
||||||
descDeviceCapExtAttrBESLPos = 2
|
descDeviceCapExtAttrBESLPos = 2
|
||||||
|
|
||||||
|
// Device class
|
||||||
|
descDeviceClassCodeMisc = 0xEF
|
||||||
|
descDeviceSubClassCommon = 0x02
|
||||||
|
descDeviceProtocolIAD = 0x01
|
||||||
)
|
)
|
||||||
|
|
||||||
// descEndpointInvalid represents an invalid endpoint address.
|
// descEndpointInvalid represents an invalid endpoint address.
|
||||||
|
|||||||
Reference in New Issue
Block a user