Skip to content

Latest commit

 

History

History
26 lines (22 loc) · 725 Bytes

0015_Send_Setup_Packet.md

File metadata and controls

26 lines (22 loc) · 725 Bytes

Send Setup Packet

参考文档

测似方法

  • 使用USB Control Center直接发送Setup Packet
  • 获取AlternateSetting的值;
  • bRequest
    • GET_INTERFACE (0x0A)
    • SET_INTERFACE (0x0B)
  • 单片机实现方法:
    BOOL DR_GetInterface(void)       // Called when a Set Interface command is received
    {
        EP0BUF[0] = AlternateSetting;
        EP0BCH = 0;
        EP0BCL = 1;
        return(TRUE);            // Handled by user code
    }
  • 测试验证:
    ./images/Get_AlternateSetting.png
    images/Set_AlternateSetting.png