Your UAT Feedback is needed within today.
STM32_USB_Device_Library
用STM32F4 Cube MX生成的USB Device C代码的BUG
STM32F446 USB和串口1 冲突
STM32f407ZG使用STM32CubeMX创建USB应用失败
请教stm32F105 USB开发资料去哪里下载
STM32F103VE-USB-VCOM发不出数据
STM32cubemx 配置出的 USB HID 电脑无法识别
[STM32L496] 求助USBCDC通信,PC端总是需要插拔USB线问题
STM32F USB DFU下载无法识别USB设备
这是一个复合设备的描述符,对比看一下
这个用了81 82两个端点 分别是键盘与鼠标
你的程序得多打开个端点,还要对其进行配置,并进行数据传输
------------------ Device Descriptor ------------------
bLength : 0x12 (18 bytes)
bDescriptorType : 0x01 (Device Descriptor)
bcdUSB : 0x200 (USB Version 2.00)
bDeviceClass : 0x00 (defined by the interface descriptors)
bDeviceSubClass : 0x00
bDeviceProtocol : 0x00
bMaxPacketSize0 : 0x08 (8 bytes)
idVendor : 0x046D (Logitech Inc.)
idProduct : 0xC52E
bcdDevice : 0x2300
iManufacturer : 0x01 (String Descriptor 1)
Language 0x0409 : "Logitech"
iProduct : 0x02 (String Descriptor 2)
Language 0x0409 : "USB Receiver"
iSerialNumber : 0x00 (No String Descriptor)
bNumConfigurations : 0x01
------------------ String Descriptors -----------------
------ String Descriptor 0 ------
bLength : 0x04 (4 bytes)
bDescriptorType : 0x03 (String Descriptor)
Language ID[0] : 0x0409 (English - United States)
------ String Descriptor 1 ------
bLength : 0x12 (18 bytes)
bDescriptorType : 0x03 (String Descriptor)
Language 0x0409 : "Logitech"
------ String Descriptor 2 ------
bLength : 0x1A (26 bytes)
bDescriptorType : 0x03 (String Descriptor)
Language 0x0409 : "USB Receiver"
------ String Descriptor 4 ------
bLength : 0x1E (30 bytes)
bDescriptorType : 0x03 (String Descriptor)
Language 0x0409 : "RQR23.00_B0005"
---------------- Configuration Descriptor -----------------
bLength : 0x09 (9 bytes)
bDescriptorType : 0x02 (Configuration Descriptor)
wTotalLength : 0x003B (59 bytes)
bNumInterfaces : 0x02
bConfigurationValue : 0x01
iConfiguration : 0x04 (String Descriptor 4)
Language 0x0409 : "RQR23.00_B0005"
bmAttributes : 0xA0
D7: Reserved, set 1 : 0x01
D6: Self Powered : 0x00 (no)
D5: Remote Wakeup : 0x01 (yes)
D4..0: Reserved, set 0 : 0x00
MaxPower : 0x31 (98 mA)
---------------- Interface Descriptor -----------------
bLength : 0x09 (9 bytes)
bDescriptorType : 0x04 (Interface Descriptor)
bInterfaceNumber : 0x00
bAlternateSetting : 0x00
bNumEndpoints : 0x01 (1 Endpoint)
bInterfaceClass : 0x03 (HID - Human Interface Device)
bInterfaceSubClass : 0x01 (Boot Interface)
bInterfaceProtocol : 0x01 (Keyboard)
iInterface : 0x00 (No String Descriptor)
------------------- HID Descriptor --------------------
bLength : 0x09 (9 bytes)
bDescriptorType : 0x21 (HID Descriptor)
bcdHID : 0x0111 (HID Version 1.11)
bCountryCode : 0x00 (00 = not localized)
bNumDescriptors : 0x01
Descriptor 1:
bDescriptorType : 0x22 (Class=Report)
wDescriptorLength : 0x003B (59 bytes)
Error reading descriptor : ERROR_GEN_FAILURE
----------------- Endpoint Descriptor -----------------
bLength : 0x07 (7 bytes)
bDescriptorType : 0x05 (Endpoint Descriptor)
bEndpointAddress : 0x81 (Direction=IN EndpointID=1)
bmAttributes : 0x03 (TransferType=Interrupt)
wMaxPacketSize : 0x0008 (8 bytes) (8 bytes)
bInterval : 0x08 (8 ms)
---------------- Interface Descriptor -----------------
bLength : 0x09 (9 bytes)
bDescriptorType : 0x04 (Interface Descriptor)
bInterfaceNumber : 0x01
bAlternateSetting : 0x00
bNumEndpoints : 0x01 (1 Endpoint)
bInterfaceClass : 0x03 (HID - Human Interface Device)
bInterfaceSubClass : 0x01 (Boot Interface)
bInterfaceProtocol : 0x02 (Mouse)
iInterface : 0x00 (No String Descriptor)
------------------- HID Descriptor --------------------
bLength : 0x09 (9 bytes)
bDescriptorType : 0x21 (HID Descriptor)
bcdHID : 0x0111 (HID Version 1.11)
bCountryCode : 0x00 (00 = not localized)
bNumDescriptors : 0x01
Descriptor 1:
bDescriptorType : 0x22 (Class=Report)
wDescriptorLength : 0x00B1 (177 bytes)
Error reading descriptor : ERROR_GEN_FAILURE
----------------- Endpoint Descriptor -----------------
bLength : 0x07 (7 bytes)
bDescriptorType : 0x05 (Endpoint Descriptor)
bEndpointAddress : 0x82 (Direction=IN EndpointID=2)
bmAttributes : 0x03 (TransferType=Interrupt)
wMaxPacketSize : 0x0014 (20 bytes) (20 bytes)
bInterval : 0x02 (2 ms)
两个设备的是不一样的。
是不一样,但是差距很大,也不知道实际上判断哪一位
我现在是不知道怎么增加返回,我知道要开端点,8个双向端点除了EP0还有7个,完全够用啊
但是你得把端点打开啊,还要配置缓冲
具体键盘的读写我没做过,但是中断型in端点的读到是要把数据放到缓冲,并置成valid,主机会自动读取,被读走了会有端点通知,你该装备下一次的数据
{
if(windex == 0){}
else if(windex == 1){}
}
大体这个意思。