linux usb bulk传输,STM32 USB HID 自定义设备 bulk 传输

__ALIGN_BEGIN static uint8_t USBD_HID_CfgDesc[USB_HID_CONFIG_DESC_SIZ] __ALIGN_END =

{

0x09, /* bLength: Configuration Descriptor size */

USB_CONFIGURATION_DESCRIPTOR_TYPE, /* bDescriptorType: Configuration */

USB_HID_CONFIG_DESC_SIZ,

/* wTotalLength: Bytes returned */

0x00,

0x01, /*bNumInterfaces: 1 interface*/

0x01, /*bConfigurationValue: Configuration value*/

0x00, /*iConfiguration: Index of string descriptor describing

the configuration*/

0xE0, /*bmAttributes: bus powered and Support Remote Wake-up */

0x32, /*MaxPower 100 mA: this current is used for detecting Vbus*/

/************** Descriptor of Joystick Mouse interface ****************/

/* 09 */

0x09, /*bLength: Interface Descriptor size*/

USB_INTERFACE_DESCRIPTOR_TYPE,/*bDescriptorType: Interface descriptor type*/

0x00, /*bInterfaceNumber: Number of Interface*/

0x00, /*bAlternateSetting: Alternate setting*/

0x04, /*bNumEndpoints*/

0x00, /*bInterfaceClass: HID*/

0x00, /*bInterfaceSubClass : 1=BOOT, 0=no boot*/

0x00, /*nInterfaceProtocol : 0=none, 1=keyboard, 2=mouse*/

0, /*iInterface: Index of string descriptor*/

/******************** Descriptor of Mouse endpoint ********************/

/* 18 */

0x07, /*bLength: Endpoint Descriptor size*/

USB_ENDPOINT_DESCRIPTOR_TYPE, /*bDescriptorType:*/

HID_IN_EP, /*bEndpointAddress: Endpoint Address (IN)*/

0x03, /*bmAttributes: Interrupt endpoint*/

HID_IN_PACKET, /*wMaxPacketSize: 4 Byte max */

0x00,

0x0A, /*bInterval: Polling Interval (10 ms)*/

/******************** Descriptor of Mouse endpoint ********************/

/* 25 */

0x07, /*bLength: Endpoint Descriptor size*/

USB_ENDPOINT_DESCRIPTOR_TYPE, /*bDescriptorType:*/

HID_OUT_EP, /*bEndpointAddress: Endpoint Address (IN)*/

0x03, /*bmAttributes: Interrupt endpoint*/

HID_IN_PACKET, /*wMaxPacketSize: 4 Byte max */

0x00,

0x0A, /*bInterval: Polling Interval (10 ms)*/

/******************** Descriptor of bulk xfer endpoint ********************/

/* 32 */

0x07, /*bLength: Endpoint Descriptor size*/

USB_ENDPOINT_DESCRIPTOR_TYPE, /*bDescriptorType:*/

HID_IN_BULK_EP, /*bEndpointAddress: Endpoint Address (IN)*/

0x02, /*bmAttributes: bulk endpoint*/

HID_IN_BULK_PACKET, /*wMaxPacketSize: 64 Byte max */

0x00,

0x0A, /*bInterval: Polling Interval (10 ms)*/

/******************** Descriptor of bulk xfer endpoint ********************/

/* 39 */

0x07, /*bLength: Endpoint Descriptor size*/

USB_ENDPOINT_DESCRIPTOR_TYPE, /*bDescriptorType:*/

HID_OUT_BULK_EP, /*bEndpointAddress: Endpoint Address (OUT)*/

0x02, /*bmAttributes: bulk endpoint*/

HID_OUT_BULK_PACKET, /*wMaxPacketSize: 64 Byte max */

0x00,

0x0A, /*bInterval: Polling Interval (10 ms)*/

/* 46 */

} ;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值