USBD_IDX_SERIAL_STR, /*Index of serial number string*/ USBD_MAX_NUM_CONFIGURATION /*bNumConfigurations*/ }; 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 接下来是修改HID报告描述符,STM32HAL为用户提供了一个USB设备HID接口类的文件,即us...
* @{ */ /*--- ---*/ #define USBD_MAX_NUM_INTERFACES 1U /*--- ---*/ #define USBD_MAX_NUM_CONFIGURATION 1U /*--- ---*/ #define USBD_MAX_STR_DESC_SIZ 512U /*--- ---*/ #define USBD_DEBUG_LEVEL 0U /*--- ---*/ #define USBD_LPM_ENABLED 0U /*--...
#if MICROPY_HW_USB_CDC_NUM >= 3 } else if (strcmp(mode_str, "3xVCP") == 0) { if (pid == -1) { pid = USBD_PID_CDC3; pid = MICROPY_HW_USB_PID_CDC3; } mode = USBD_MODE_CDC3; } else if (strcmp(mode_str, "3xVCP+MSC") == 0) { if (pid == -1) { pid =...
usb usb1: configuration #1 chosen from 1choicehub 1-0:1.0: USB hub foundhub 1-0:1.0: 1 port detectedSCSI subsystem initializedInitializing USB Mass Storage driver...usbcore: registered new interface driverusb-storageUSB Mass Storage support registered....
bDeviceProtocol 1 bMaxPacketSize0 64 idVendor 0x05a3 idProduct 0x9310 bcdDevice 0.00 iManufacturer 2 iProduct 1 iSerial 0 bNumConfigurations 1 ---配置描述符--- [22200.195963] Configuration Descriptor 0: bLength 9 bDescriptorType 2 wTotalLength 963 bNumInterfaces 4 bConfigurationValue 1 i...
if (ep_mps > USBD0_TX_FIFO_SIZE[ep_num]) { return ARM_DRIVER_ERROR_PARAMETER; } So, in this case, in the driver, the configured transmit FIFO size is too small for the requested "ep_max_packet_size". This FIFO configuration is a specific thing for some STM32 devices and can b...
uint8_tUSBD_HID_DataOut_impl (USBD_HandleTypeDef *pdev,uint8_tepnum,uint8_t* buffer) {// only the data hid endpoint will receive dataif(epnum ==2) {// prepare receiving the next chunk (masked time)USBD_LL_PrepareReceive(pdev, HID_EPOUT_ADDR , HID_EPOUT_SIZE);// avoid trouble...
// Configuration descriptor information.. */ #define USB_MAXCONFIG 8 struct usb_config_descriptor { u_int8_t bLength; u_int8_t bDescriptorType; u_int16_t wTotalLength; u_int8_t bNumInterfaces; u_int8_t bConfigurationValue;
0x01 /*bNumConfigurations*/ }; /* Joystick_DeviceDescriptor */ 我们只需要修改这里的idVendor(即VID)和idProduct(即PID)即可。它们是用来供电脑端识别设备以加载驱动用的,所以必须不能跟现有的设备相冲突。VID和PID都是两字节,低字节在前,高字节在后。例如这里的VID为0x0483,写在里面就是0x83,0x04。我们...
iConfiguration: 0 bmAttributes: 80h MaxPower: 100 bInterfaceNumber: 0 bAlternateSetting: 0 bNumEndpoints: 3 bInterfaceClass: 8 bInterfaceSubClass: 6 bInterfaceProtocol: 80 iInterface: 0 bEndpointAddress: 81h bmAttributes: 02h wMaxPacketSize: 64 bInterval: 0 ...