OpenEdv-开源电子网

 找回密码
 立即注册
正点原子全套STM32/Linux/FPGA开发资料,上千讲STM32视频教程免费下载...
查看: 3288|回复: 3

STM32F1 USB VCP 端点2的作用是什么?

[复制链接]

42

主题

358

帖子

0

精华

高级会员

Rank: 4

积分
890
金钱
890
注册时间
2014-8-16
在线时间
193 小时
发表于 2020-5-21 16:02:06 | 显示全部楼层 |阅读模式
1金钱
配置描述符里有个端点2 找不到端点2的作用是什么

而且我把端点2的初始化代码去了,依然可以正常使用,但是配置描述符还不能删掉端点2

这个端点2到底是干嘛的???

正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

0

主题

57

帖子

0

精华

初级会员

Rank: 2

积分
62
金钱
62
注册时间
2018-12-27
在线时间
0 小时
发表于 2020-5-21 16:02:06 | 显示全部楼层
回复

使用道具 举报

21

主题

2205

帖子

0

精华

资深版主

Rank: 8Rank: 8

积分
5141
金钱
5141
注册时间
2014-8-26
在线时间
1317 小时
发表于 2020-5-21 20:10:15 | 显示全部楼层
帮顶。。
回复

使用道具 举报

42

主题

358

帖子

0

精华

高级会员

Rank: 4

积分
890
金钱
890
注册时间
2014-8-16
在线时间
193 小时
 楼主| 发表于 2020-5-22 17:37:12 | 显示全部楼层
  1. const uint8_t Composite_ConfigDescriptor[COMPOSITE_SIZ_CONFIG_DESC] =
  2. {
  3.         /*Configuration Descriptor*/
  4.         0x09,   /* bLength: Configuration Descriptor size */
  5.         USB_CONFIGURATION_DESCRIPTOR_TYPE,      /* bDescriptorType: Configuration */
  6.         COMPOSITE_SIZ_CONFIG_DESC,       /* wTotalLength:no of returned bytes */
  7.         0x00,
  8.         0x02,   /* bNumInterfaces: 3 interface */
  9.         0x01,   /* bConfigurationValue: Configuration value */
  10.         0x00,   /* iConfiguration: Index of string descriptor describing the configuration */
  11.         0xC0,   /* bmAttributes: self powered */
  12.         0x32,   /* MaxPower 0 mA */

  13.         ////////////////////////////////////////////////////////////////// CDC
  14.         /*Interface Descriptor*/
  15.         0x09,   /* bLength: Interface Descriptor size */
  16.         USB_INTERFACE_DESCRIPTOR_TYPE,  /* bDescriptorType: Interface */
  17.         /* Interface descriptor type */
  18.         0x01,   /* bInterfaceNumber: Number of Interface */
  19.         0x00,   /* bAlternateSetting: Alternate setting */
  20.         0x02,   /* bNumEndpoints: One endpoints used */
  21.         0x02,   /* bInterfaceClass: Communication Interface Class */
  22.         0x02,   /* bInterfaceSubClass: Abstract Control Model */
  23.         0x01,   /* bInterfaceProtocol: Common AT commands */
  24.         0x00,   /* iInterface: */

  25.         /*Header Functional Descriptor*/
  26.         0x05,   /* bLength: Endpoint Descriptor size */
  27.         0x24,   /* bDescriptorType: CS_INTERFACE */
  28.         0x00,   /* bDescriptorSubtype: Header Func Desc */
  29.         0x10,   /* bcdCDC: spec release number */
  30.         0x01,
  31.         /*Call Management Functional Descriptor*/
  32.         0x05,   /* bFunctionLength */
  33.         0x24,   /* bDescriptorType: CS_INTERFACE */
  34.         0x01,   /* bDescriptorSubtype: Call Management Func Desc */
  35.         0x00,   /* bmCapabilities: D0+D1 */
  36.         0x01,   /* bDataInterface: 1 */
  37.         /*ACM Functional Descriptor*/
  38.         0x04,   /* bFunctionLength */
  39.         0x24,   /* bDescriptorType: CS_INTERFACE */
  40.         0x02,   /* bDescriptorSubtype: Abstract Control Management desc */
  41.         0x02,   /* bmCapabilities */
  42.         /*Union Functional Descriptor*/
  43.         0x05,   /* bFunctionLength */
  44.         0x24,   /* bDescriptorType: CS_INTERFACE */
  45.         0x06,   /* bDescriptorSubtype: Union func desc */
  46.         0x00,   /* bMasterInterface: Communication class interface */
  47.         0x01,   /* bSlaveInterface0: Data Class Interface */

  48.         /*Endpoint 1 Descriptor*/
  49.         0x07,   /* bLength: Endpoint Descriptor size */
  50.         USB_ENDPOINT_DESCRIPTOR_TYPE,   /* bDescriptorType: Endpoint */
  51.         0x81,   /* bEndpointAddress: (IN1) */
  52.         0x02,   /* bmAttributes: Bulk */
  53.         COMPOSITE_DATA_SIZE,             /* wMaxPacketSize: */
  54.         0x00,
  55.         0x00,   /* bInterval */

  56.         /*Endpoint 1 Descriptor*/
  57.         0x07,   /* bLength: Endpoint Descriptor size */
  58.         USB_ENDPOINT_DESCRIPTOR_TYPE,   /* bDescriptorType: Endpoint */
  59.         0x01,   /* bEndpointAddress: (OUT1) */
  60.         0x02,   /* bmAttributes: Bulk */
  61.         COMPOSITE_DATA_SIZE,             /* wMaxPacketSize: */
  62.         0x00,
  63.         0x00,   /* bInterval: ignore for Bulk transfer */

  64.         ////////////////////////////////////////////////////////////////// MASS

  65.         /*Data class interface descriptor*/
  66.         0x09,   /* bLength: Endpoint Descriptor size */
  67.         USB_INTERFACE_DESCRIPTOR_TYPE,  /* bDescriptorType: */
  68.         0x00,   /* bInterfaceNumber: Number of Interface */
  69.         0x00,   /* bAlternateSetting: Alternate setting */
  70.         0x02,   /* bNumEndpoints: Two endpoints used */
  71.         0x08,   /* bInterfaceClass: MASS STORAGE Class */
  72.         0x06,   /* bInterfaceSubClass: SCSI transparent */
  73.         0x50,   /* bInterfaceProtocol: */
  74.         0x00,   /* iInterface: */

  75.         /*Endpoint 2 Descriptor*/
  76.         0x07,   /* bLength: Endpoint Descriptor size */
  77.         USB_ENDPOINT_DESCRIPTOR_TYPE,   /* bDescriptorType: Endpoint */
  78.         0x82,   /* bEndpointAddress: (IN2) */
  79.         0x02,   /* bmAttributes: Bulk */
  80.         COMPOSITE_DATA_SIZE,             /* wMaxPacketSize: */
  81.         0x00,
  82.         0x00,   /* bInterval */

  83.         /*Endpoint 2 Descriptor*/
  84.         0x07,   /* bLength: Endpoint Descriptor size */
  85.         USB_ENDPOINT_DESCRIPTOR_TYPE,   /* bDescriptorType: Endpoint */
  86.         0x02,   /* bEndpointAddress: (OUT2) */
  87.         0x02,   /* bmAttributes: Bulk */
  88.         COMPOSITE_DATA_SIZE,             /* wMaxPacketSize: */
  89.         0x00,
  90.         0x00,   /* bInterval: ignore for Bulk transfer */
  91. };
复制代码
这是一个vcp+mass的组合设备的配置描述符,vcp部分对接口描述符做了修改,去掉了没有用的中断端点和接口。只保留一个接口描述符就可以正常作为vcp使用了

不过到现在也还是没发现官方示例当中端点2以及删掉的接口有什么用。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则



关闭

原子哥极力推荐上一条 /2 下一条

正点原子公众号

QQ|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )

GMT+8, 2025-6-28 23:51

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

快速回复 返回顶部 返回列表