各位大侠:<br />小弟正在使用CDC类开发USB转RS232,但不知下面的CDC类的特殊描述符是什么意思???<br /><br />/* The Configuration Descriptor */ <br />CONST PACKED_USB_CONFIG_DESCR PackedConfigDescr = <br />{ <br /> 9, /* bLength */ <br /> USB_CONFIGURATION_DESCRIPTOR_TYPE, /* descriptor type */ <br /> SWAP( PACKED_USB_CONFIG_DESCR_LEN ), /* length of packed config descr. (16b) */ <br /> 0x02, /* number of interfaces */ <br /> 0x01, /* configuration value */ <br /> 0x00, /* configuration string index (none) */ <br /> 0x80, /* attributes (self-powered, no remote wakeup) */ <br /> 0x0A, /* max power (0x0A * 2mA = 20mA) */ <br /> <br /> // 通信接口<br /> /* Interface descriptor */<br /> 9, /* bLength */ <br /> USB_INTERFACE_DESCRIPTOR_TYPE, /* descriptor type */ <br /> 0x00, /* interface number */ <br /> 0x00, /* alternate setting */ <br /> 0x01, /* number of endpoints (excl. EP0) */ <br /> 0x02, /* CDC class */ /* interface class (USBTMC=0xFE) */ <br /> 0x02, /* Abstract (Modem) */ /* interface subclass (USB488=0x03) */ <br /> 0x01, /* AT-Commands */ /* interface protocol (0x01)*/ <br /> 0x00, /* interface string index (none) */ <br /><br /> /* CDC Class-Specific descriptor */<br />????????????????????????????????<br />这里是什么意思???????????????????????<br /> 5, /* sizeof(usbDescrCDC_HeaderFn): length of descriptor in bytes */<br /> 0x24, /* descriptor type */<br /> 0, /* header functional descriptor */<br /> 0x10, 0x01,<br /><br /> 4, /* sizeof(usbDescrCDC_AcmFn): length of descriptor in bytes */<br /> 0x24, /* descriptor type */<br /> 2, /* abstract control management functional descriptor */<br /> 0x02, /* SET_LINE_CODING, GET_LINE_CODING, SET_CONTROL_LINE_STATE */<br /><br /> 5, /* sizeof(usbDescrCDC_UnionFn): length of descriptor in bytes */<br /> 0x24, /* descriptor type */<br /> 6, /* union functional descriptor */<br /> 0, /* CDC_COMM_INTF_ID */<br /> 1, /* CDC_DATA_INTF_ID */<br /><br /> 5, /* sizeof(usbDescrCDC_CallMgtFn): length of descriptor in bytes */<br /> 0x24, /* descriptor type */<br /> 1, /* call management functional descriptor */<br /> 0, /* allow management on data interface, handles call management by itself */<br /> 1, /* CDC_DATA_INTF_ID */<br /><br /><br /> 7, /* bLength */ <br /> USB_ENDPOINT_DESCRIPTOR_TYPE, /* descriptor type */ <br /> 0x81, /* Endpoint dir'n (IN) & addr */ <br /> USB_ENDPOINT_TYPE_INTERRUPT, /* Endpoint type */ <br /> LO_BYTE( EP1_MAX_PACKET_SIZE ), /* Maximum pkt size (16) */ <br /> HI_BYTE( EP1_MAX_PACKET_SIZE ), <br /> 10, /* Polling interval (unit=frame=1mS) */ <br /><br /> // 数据接口<br /> /* Interface Descriptor */<br /> 9, /* sizeof(usbDescrInterface): length of descriptor in bytes */<br /> 4, /* descriptor type */<br /> 1, /* index of this interface */<br /> 0, /* alternate setting for this interface */<br /> 2, /* endpoints excl 0: number of endpoint descriptors to follow */<br /> 0x0A, /* Data Interface Class Codes */<br /> 0,<br /> 0, /* Data Interface Class Protocol Codes */<br /> 0, /* string index for interface */<br /><br /> 7, /* bLength */ <br /> USB_ENDPOINT_DESCRIPTOR_TYPE, /* descriptor type */ <br /> 0x82, /* Endpoint dir'n (IN) & addr */ <br /> USB_ENDPOINT_TYPE_BULK, /* Endpoint type */ <br /> LO_BYTE( EP2_MAX_PACKET_SIZE ), /* Maximum pkt size (64) */ <br /> HI_BYTE( EP2_MAX_PACKET_SIZE ), <br /> 10, /* Interval - usually ignored for bulk */ <br /> <br /> 7, /* bLength */ <br /> USB_ENDPOINT_DESCRIPTOR_TYPE, /* descriptor type */ <br /> 0x02, /* Endpoint dir'n (OUT) & addr */ <br /> USB_ENDPOINT_TYPE_BULK, /* Endpoint type */ <br /> LO_BYTE( EP2_MAX_PACKET_SIZE ), /* Maximum pkt size (64) */ <br /> HI_BYTE( EP2_MAX_PACKET_SIZE ), <br /> 10, /* Interval - usually ignored for bulk */ <br />}; |
|