打印
[应用相关]

get_descriptor请求的wValue是16位在stm32中是8位吗,如果是REPORT_DE...

[复制链接]
338|0
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
powerantone|  楼主 | 2022-3-16 14:59 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
圈圈教你玩usb中get_descriptor请求的wValue是16位在STM32中是8位吗,如果是REPORT_DESCRIPTOR是0x22 HID_DESCRIPTOR_TYPE是0x21 如果前一个2指的是配置描述符那后一个数指的什么 我哪里理解错了
RESULT Joystick_Data_Setup(uint8_t RequestNo)
{
  uint8_t *(*CopyRoutine)(uint16_t);

  CopyRoutine = NULL;
  if ((RequestNo == GET_DESCRIPTOR)
      && (Type_Recipient == (STANDARD_REQUEST | INTERFACE_RECIPIENT))
      && (pInformation->USBwIndex1 == 0))
  {

    if (pInformation->USBwValue1 == REPORT_DESCRIPTOR)  //这个位置
    {
      CopyRoutine = Joystick_GetReportDescriptor;
    }
    else if (pInformation->USBwValue1 == HID_DESCRIPTOR_TYPE)  //这个位置
    {
      CopyRoutine = Joystick_GetHIDDescriptor;
    }

  } /* End of GET_DESCRIPTOR */

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

421

主题

1595

帖子

4

粉丝