Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
逆着光、寻觅
rt-thread
提交
60b756a8
R
rt-thread
项目概览
逆着光、寻觅
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
60b756a8
编写于
3月 16, 2018
作者:
lymzzyh
提交者:
GitHub
3月 16, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1291 from uestczyh222/master
[Components][USB Device]增加设备栈对HS设备的支持
上级
c4c729f0
7262ab73
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
110 addition
and
71 deletion
+110
-71
components/drivers/include/drivers/usb_device.h
components/drivers/include/drivers/usb_device.h
+1
-0
components/drivers/usb/usbdevice/class/cdc_vcom.c
components/drivers/usb/usbdevice/class/cdc_vcom.c
+11
-8
components/drivers/usb/usbdevice/class/ecm.c
components/drivers/usb/usbdevice/class/ecm.c
+17
-13
components/drivers/usb/usbdevice/class/hid.c
components/drivers/usb/usbdevice/class/hid.c
+13
-9
components/drivers/usb/usbdevice/class/mstorage.c
components/drivers/usb/usbdevice/class/mstorage.c
+17
-13
components/drivers/usb/usbdevice/class/rndis.c
components/drivers/usb/usbdevice/class/rndis.c
+18
-16
components/drivers/usb/usbdevice/class/winusb.c
components/drivers/usb/usbdevice/class/winusb.c
+14
-11
components/drivers/usb/usbdevice/core/core.c
components/drivers/usb/usbdevice/core/core.c
+4
-1
components/drivers/usb/usbdevice/core/usbdevice.c
components/drivers/usb/usbdevice/core/usbdevice.c
+15
-0
未找到文件。
components/drivers/include/drivers/usb_device.h
浏览文件 @
60b756a8
...
...
@@ -140,6 +140,7 @@ struct udcd
struct
uendpoint
ep0
;
uep0_stage_t
stage
;
struct
ep_id
*
ep_pool
;
rt_uint8_t
device_is_hs
;
};
typedef
struct
udcd
*
udcd_t
;
...
...
components/drivers/usb/usbdevice/class/cdc_vcom.c
浏览文件 @
60b756a8
...
...
@@ -114,15 +114,17 @@ static struct udevice_descriptor dev_desc =
USB_DYNAMIC
,
//bNumConfigurations;
};
//FS and HS needed
static
struct
usb_qualifier_descriptor
dev_qualifier
=
{
sizeof
(
dev_qualifier
),
USB_DESC_TYPE_DEVICEQUALIFIER
,
0x0200
,
USB_CLASS_CDC
,
0x00
,
64
,
0x01
,
sizeof
(
dev_qualifier
),
//bLength
USB_DESC_TYPE_DEVICEQUALIFIER
,
//bDescriptorType
0x0200
,
//bcdUSB
USB_CLASS_CDC
,
//bDeviceClass
0x00
,
//bDeviceSubClass
0x00
,
//bDeviceProtocol
64
,
//bMaxPacketSize0
0x01
,
//bNumConfigurations
0
,
};
...
...
@@ -566,7 +568,8 @@ ufunction_t rt_usbd_function_cdc_create(udevice_t device)
/* create a cdc function */
func
=
rt_usbd_function_new
(
device
,
&
dev_desc
,
&
ops
);
rt_usbd_device_set_qualifier
(
device
,
&
dev_qualifier
);
//not support HS
//rt_usbd_device_set_qualifier(device, &dev_qualifier);
/* allocate memory for cdc vcom data */
data
=
(
struct
vcom
*
)
rt_malloc
(
sizeof
(
struct
vcom
));
...
...
components/drivers/usb/usbdevice/class/ecm.c
浏览文件 @
60b756a8
...
...
@@ -41,7 +41,7 @@ struct rt_ecm_eth
rt_uint8_t
dev_addr
[
MAX_ADDR_LEN
];
ALIGN
(
4
)
rt_uint8_t
rx_pool
[
64
];
rt_uint8_t
rx_pool
[
512
];
ALIGN
(
4
)
rt_size_t
rx_size
;
ALIGN
(
4
)
...
...
@@ -147,14 +147,14 @@ const static struct ucdc_data_descriptor _data_desc =
USB_DESC_TYPE_ENDPOINT
,
USB_DIR_OUT
|
USB_DYNAMIC
,
USB_EP_ATTR_BULK
,
USB_
CDC_BUFSIZE
,
USB_
DYNAMIC
,
0x00
,
/* endpoint, bulk in */
USB_DESC_LENGTH_ENDPOINT
,
USB_DESC_TYPE_ENDPOINT
,
USB_DYNAMIC
|
USB_DIR_IN
,
USB_EP_ATTR_BULK
,
USB_
CDC_BUFSIZE
,
USB_
DYNAMIC
,
0x00
,
};
...
...
@@ -170,17 +170,20 @@ const static char* _ustring[] =
};
ALIGN
(
4
)
//FS and HS needed
static
struct
usb_qualifier_descriptor
dev_qualifier
=
{
sizeof
(
dev_qualifier
),
USB_DESC_TYPE_DEVICEQUALIFIER
,
0x0200
,
USB_CLASS_CDC
,
0x00
,
64
,
0x01
,
sizeof
(
dev_qualifier
),
//bLength
USB_DESC_TYPE_DEVICEQUALIFIER
,
//bDescriptorType
0x0200
,
//bcdUSB
USB_CLASS_CDC
,
//bDeviceClass
USB_CDC_SUBCLASS_ETH
,
//bDeviceSubClass
USB_CDC_PROTOCOL_NONE
,
//bDeviceProtocol
64
,
//bMaxPacketSize0
0x01
,
//bNumConfigurations
0
,
};
static
rt_err_t
_cdc_send_notifi
(
ufunction_t
func
,
ucdc_notification_code_t
notifi
,
rt_uint16_t
wValue
,
rt_uint16_t
wLength
)
{
static
struct
ucdc_management_element_notifications
_notifi
;
...
...
@@ -472,7 +475,7 @@ static struct ufunction_ops ops =
*
* @return RT_EOK on successful.
*/
static
rt_err_t
_cdc_descriptor_config
(
ucdc_comm_desc_t
comm
,
rt_uint8_t
cintf_nr
,
ucdc_data_desc_t
data
,
rt_uint8_t
dintf_nr
)
static
rt_err_t
_cdc_descriptor_config
(
ucdc_comm_desc_t
comm
,
rt_uint8_t
cintf_nr
,
ucdc_data_desc_t
data
,
rt_uint8_t
dintf_nr
,
rt_uint8_t
device_is_hs
)
{
comm
->
call_mgmt_desc
.
data_interface
=
dintf_nr
;
comm
->
union_desc
.
master_interface
=
cintf_nr
;
...
...
@@ -480,7 +483,8 @@ static rt_err_t _cdc_descriptor_config(ucdc_comm_desc_t comm, rt_uint8_t cintf_n
#ifdef RT_USB_DEVICE_COMPOSITE
comm
->
iad_desc
.
bFirstInterface
=
cintf_nr
;
#endif
data
->
ep_out_desc
.
wMaxPacketSize
=
device_is_hs
?
512
:
64
;
data
->
ep_in_desc
.
wMaxPacketSize
=
device_is_hs
?
512
:
64
;
return
RT_EOK
;
}
...
...
@@ -532,7 +536,7 @@ ufunction_t rt_usbd_function_ecm_create(udevice_t device)
(
rt_off_t
)
&
((
ucdc_eth_desc_t
)
0
)
->
intf_desc
);
rt_usbd_altsetting_config_descriptor
(
data_setting
,
&
_data_desc
,
0
);
/* configure the cdc interface descriptor */
_cdc_descriptor_config
(
comm_setting
->
desc
,
intf_comm
->
intf_num
,
data_setting
->
desc
,
intf_data
->
intf_num
);
_cdc_descriptor_config
(
comm_setting
->
desc
,
intf_comm
->
intf_num
,
data_setting
->
desc
,
intf_data
->
intf_num
,
device
->
dcd
->
device_is_hs
);
/* create a command endpoint */
comm_desc
=
(
ucdc_eth_desc_t
)
comm_setting
->
desc
;
...
...
components/drivers/usb/usbdevice/class/hid.c
浏览文件 @
60b756a8
...
...
@@ -227,18 +227,21 @@ static struct udevice_descriptor _dev_desc =
USB_DYNAMIC
,
//bNumConfigurations;
};
static
struct
usb_qualifier_descriptor
_dev_qualifier
=
//FS and HS needed
static
struct
usb_qualifier_descriptor
dev_qualifier
=
{
sizeof
(
_dev_qualifier
),
USB_DESC_TYPE_DEVICEQUALIFIER
,
0x0200
,
USB_CLASS_HID
,
0x00
,
64
,
0x01
,
sizeof
(
dev_qualifier
),
//bLength
USB_DESC_TYPE_DEVICEQUALIFIER
,
//bDescriptorType
0x0200
,
//bcdUSB
USB_CLASS_MASS_STORAGE
,
//bDeviceClass
0x06
,
//bDeviceSubClass
0x50
,
//bDeviceProtocol
64
,
//bMaxPacketSize0
0x01
,
//bNumConfigurations
0
,
};
/* hid interface descriptor */
const
static
struct
uhid_comm_descriptor
_hid_comm_desc
=
{
...
...
@@ -631,7 +634,8 @@ ufunction_t rt_usbd_function_hid_create(udevice_t device)
/* create a cdc function */
func
=
rt_usbd_function_new
(
device
,
&
_dev_desc
,
&
ops
);
rt_usbd_device_set_qualifier
(
device
,
&
_dev_qualifier
);
//not support hs
//rt_usbd_device_set_qualifier(device, &_dev_qualifier);
/* allocate memory for cdc vcom data */
data
=
(
struct
hid_s
*
)
rt_malloc
(
sizeof
(
struct
hid_s
));
...
...
components/drivers/usb/usbdevice/class/mstorage.c
浏览文件 @
60b756a8
...
...
@@ -88,8 +88,8 @@ static struct udevice_descriptor dev_desc =
USB_DESC_TYPE_DEVICE
,
//type;
USB_BCD_VERSION
,
//bcdUSB;
USB_CLASS_MASS_STORAGE
,
//bDeviceClass;
0x0
0
,
//bDeviceSubClass;
0x
0
0
,
//bDeviceProtocol;
0x0
6
,
//bDeviceSubClass;
0x
5
0
,
//bDeviceProtocol;
0x40
,
//bMaxPacketSize0;
_VENDOR_ID
,
//idVendor;
_PRODUCT_ID
,
//idProduct;
...
...
@@ -100,15 +100,17 @@ static struct udevice_descriptor dev_desc =
USB_DYNAMIC
,
//bNumConfigurations;
};
//FS and HS needed
static
struct
usb_qualifier_descriptor
dev_qualifier
=
{
sizeof
(
dev_qualifier
),
USB_DESC_TYPE_DEVICEQUALIFIER
,
0x0200
,
USB_CLASS_MASS_STORAGE
,
0x00
,
64
,
0x01
,
sizeof
(
dev_qualifier
),
//bLength
USB_DESC_TYPE_DEVICEQUALIFIER
,
//bDescriptorType
0x0200
,
//bcdUSB
USB_CLASS_MASS_STORAGE
,
//bDeviceClass
0x06
,
//bDeviceSubClass
0x50
,
//bDeviceProtocol
64
,
//bMaxPacketSize0
0x01
,
//bNumConfigurations
0
,
};
...
...
@@ -141,14 +143,14 @@ const static struct umass_descriptor _mass_desc =
USB_DESC_TYPE_ENDPOINT
,
//type;
USB_DYNAMIC
|
USB_DIR_OUT
,
//bEndpointAddress;
USB_EP_ATTR_BULK
,
//bmAttributes;
0x40
,
//wMaxPacketSize;
USB_DYNAMIC
,
//wMaxPacketSize;
0x00
,
//bInterval;
USB_DESC_LENGTH_ENDPOINT
,
//bLength;
USB_DESC_TYPE_ENDPOINT
,
//type;
USB_DYNAMIC
|
USB_DIR_IN
,
//bEndpointAddress;
USB_EP_ATTR_BULK
,
//bmAttributes;
0x40
,
//wMaxPacketSize;
USB_DYNAMIC
,
//wMaxPacketSize;
0x00
,
//bInterval;
};
...
...
@@ -1043,11 +1045,13 @@ static struct ufunction_ops ops =
_function_disable
,
RT_NULL
,
};
static
rt_err_t
_mstorage_descriptor_config
(
umass_desc_t
desc
,
rt_uint8_t
cintf_nr
)
static
rt_err_t
_mstorage_descriptor_config
(
umass_desc_t
desc
,
rt_uint8_t
cintf_nr
,
rt_uint8_t
device_is_hs
)
{
#ifdef RT_USB_DEVICE_COMPOSITE
desc
->
iad_desc
.
bFirstInterface
=
cintf_nr
;
#endif
desc
->
ep_out_desc
.
wMaxPacketSize
=
device_is_hs
?
512
:
64
;
desc
->
ep_in_desc
.
wMaxPacketSize
=
device_is_hs
?
512
:
64
;
return
RT_EOK
;
}
/**
...
...
@@ -1090,7 +1094,7 @@ ufunction_t rt_usbd_function_mstorage_create(udevice_t device)
rt_usbd_altsetting_config_descriptor
(
setting
,
&
_mass_desc
,
(
rt_off_t
)
&
((
umass_desc_t
)
0
)
->
intf_desc
);
/* configure the msc interface descriptor */
_mstorage_descriptor_config
(
setting
->
desc
,
intf
->
intf_num
);
_mstorage_descriptor_config
(
setting
->
desc
,
intf
->
intf_num
,
device
->
dcd
->
device_is_hs
);
/* create a bulk out and a bulk in endpoint */
mass_desc
=
(
umass_desc_t
)
setting
->
desc
;
...
...
components/drivers/usb/usbdevice/class/rndis.c
浏览文件 @
60b756a8
...
...
@@ -58,9 +58,9 @@ struct rt_rndis_eth
#endif
/* RNDIS_DELAY_LINK_UP */
ALIGN
(
4
)
rt_uint8_t
rx_pool
[
64
];
rt_uint8_t
rx_pool
[
512
];
ALIGN
(
4
)
rt_uint8_t
tx_pool
[
64
];
rt_uint8_t
tx_pool
[
512
];
rt_uint32_t
cmd_pool
[
2
];
ALIGN
(
4
)
...
...
@@ -175,14 +175,14 @@ const static struct ucdc_data_descriptor _data_desc =
USB_DESC_TYPE_ENDPOINT
,
USB_DIR_OUT
|
USB_DYNAMIC
,
USB_EP_ATTR_BULK
,
USB_
CDC_BUFSIZE
,
USB_
DYNAMIC
,
0x00
,
/* endpoint, bulk in */
USB_DESC_LENGTH_ENDPOINT
,
USB_DESC_TYPE_ENDPOINT
,
USB_DYNAMIC
|
USB_DIR_IN
,
USB_EP_ATTR_BULK
,
USB_
CDC_BUFSIZE
,
USB_
DYNAMIC
,
0x00
,
};
...
...
@@ -206,16 +206,17 @@ struct usb_os_function_comp_id_descriptor rndis_func_comp_id_desc =
.
subCompatibleID
=
{
'5'
,
'1'
,
'6'
,
'2'
,
'0'
,
'0'
,
'1'
,
0x00
},
.
reserved2
=
{
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
}
};
ALIGN
(
4
)
//FS and HS needed
static
struct
usb_qualifier_descriptor
dev_qualifier
=
{
sizeof
(
dev_qualifier
),
USB_DESC_TYPE_DEVICEQUALIFIER
,
0x0200
,
USB_CLASS_CDC
,
0x00
,
64
,
0x01
,
sizeof
(
dev_qualifier
),
//bLength
USB_DESC_TYPE_DEVICEQUALIFIER
,
//bDescriptorType
0x0200
,
//bcdUSB
USB_CLASS_CDC
,
//bDeviceClass
USB_CDC_SUBCLASS_ACM
,
//bDeviceSubClass
USB_CDC_PROTOCOL_VENDOR
,
//bDeviceProtocol
64
,
//bMaxPacketSize0
0x01
,
//bNumConfigurations
0
,
};
...
...
@@ -401,7 +402,7 @@ static rt_err_t _rndis_query_response(ufunction_t func,rndis_query_msg_t msg)
case
OID_GEN_LINK_SPEED
:
resp
=
_create_resp
(
4
);
if
(
resp
==
RT_NULL
)
break
;
_set_resp
(
resp
,
(
10
UL
*
1000
*
1000
)
/
100
);
_set_resp
(
resp
,
func
->
device
->
dcd
->
device_is_hs
?
(
480UL
*
1000
*
1000
)
:
(
12
UL
*
1000
*
1000
)
/
100
);
break
;
case
OID_GEN_MEDIA_CONNECT_STATUS
:
...
...
@@ -1008,7 +1009,7 @@ static struct ufunction_ops ops =
*
* @return RT_EOK on successful.
*/
static
rt_err_t
_cdc_descriptor_config
(
ucdc_comm_desc_t
comm
,
rt_uint8_t
cintf_nr
,
ucdc_data_desc_t
data
,
rt_uint8_t
dintf_nr
)
static
rt_err_t
_cdc_descriptor_config
(
ucdc_comm_desc_t
comm
,
rt_uint8_t
cintf_nr
,
ucdc_data_desc_t
data
,
rt_uint8_t
dintf_nr
,
rt_uint8_t
device_is_hs
)
{
comm
->
call_mgmt_desc
.
data_interface
=
dintf_nr
;
comm
->
union_desc
.
master_interface
=
cintf_nr
;
...
...
@@ -1016,7 +1017,8 @@ static rt_err_t _cdc_descriptor_config(ucdc_comm_desc_t comm, rt_uint8_t cintf_n
#ifdef RT_USB_DEVICE_COMPOSITE
comm
->
iad_desc
.
bFirstInterface
=
cintf_nr
;
#endif
data
->
ep_out_desc
.
wMaxPacketSize
=
device_is_hs
?
512
:
64
;
data
->
ep_in_desc
.
wMaxPacketSize
=
device_is_hs
?
512
:
64
;
return
RT_EOK
;
}
...
...
@@ -1237,7 +1239,7 @@ ufunction_t rt_usbd_function_rndis_create(udevice_t device)
(
rt_off_t
)
&
((
ucdc_comm_desc_t
)
0
)
->
intf_desc
);
rt_usbd_altsetting_config_descriptor
(
data_setting
,
&
_data_desc
,
0
);
/* configure the cdc interface descriptor */
_cdc_descriptor_config
(
comm_setting
->
desc
,
intf_comm
->
intf_num
,
data_setting
->
desc
,
intf_data
->
intf_num
);
_cdc_descriptor_config
(
comm_setting
->
desc
,
intf_comm
->
intf_num
,
data_setting
->
desc
,
intf_data
->
intf_num
,
device
->
dcd
->
device_is_hs
);
/* create a command endpoint */
comm_desc
=
(
ucdc_comm_desc_t
)
comm_setting
->
desc
;
...
...
components/drivers/usb/usbdevice/class/winusb.c
浏览文件 @
60b756a8
...
...
@@ -43,13 +43,14 @@ static struct udevice_descriptor dev_desc =
//FS and HS needed
static
struct
usb_qualifier_descriptor
dev_qualifier
=
{
sizeof
(
dev_qualifier
),
USB_DESC_TYPE_DEVICEQUALIFIER
,
0x0200
,
0x00
,
0x00
,
64
,
0x01
,
sizeof
(
dev_qualifier
),
//bLength
USB_DESC_TYPE_DEVICEQUALIFIER
,
//bDescriptorType
0x0200
,
//bcdUSB
0xFF
,
//bDeviceClass
0x00
,
//bDeviceSubClass
0x00
,
//bDeviceProtocol
64
,
//bMaxPacketSize0
0x01
,
//bNumConfigurations
0
,
};
...
...
@@ -81,14 +82,14 @@ struct winusb_descriptor _winusb_desc =
USB_DESC_TYPE_ENDPOINT
,
USB_DYNAMIC
|
USB_DIR_OUT
,
USB_EP_ATTR_BULK
,
0x40
,
USB_DYNAMIC
,
0x00
,
/*endpoint descriptor*/
USB_DESC_LENGTH_ENDPOINT
,
USB_DESC_TYPE_ENDPOINT
,
USB_DYNAMIC
|
USB_DIR_IN
,
USB_EP_ATTR_BULK
,
0x40
,
USB_DYNAMIC
,
0x00
,
};
...
...
@@ -197,11 +198,13 @@ static struct ufunction_ops ops =
RT_NULL
,
};
static
rt_err_t
_winusb_descriptor_config
(
winusb_desc_t
winusb
,
rt_uint8_t
cintf_nr
)
static
rt_err_t
_winusb_descriptor_config
(
winusb_desc_t
winusb
,
rt_uint8_t
cintf_nr
,
rt_uint8_t
device_is_hs
)
{
#ifdef RT_USB_DEVICE_COMPOSITE
winusb
->
iad_desc
.
bFirstInterface
=
cintf_nr
;
#endif
winusb
->
ep_out_desc
.
wMaxPacketSize
=
device_is_hs
?
512
:
64
;
winusb
->
ep_in_desc
.
wMaxPacketSize
=
device_is_hs
?
512
:
64
;
winusb_func_comp_id_desc
.
bFirstInterfaceNumber
=
cintf_nr
;
return
RT_EOK
;
}
...
...
@@ -293,7 +296,7 @@ ufunction_t rt_usbd_function_winusb_create(udevice_t device)
rt_usbd_altsetting_config_descriptor
(
winusb_setting
,
&
_winusb_desc
,
(
rt_off_t
)
&
((
winusb_desc_t
)
0
)
->
intf_desc
);
/* configure the hid interface descriptor */
_winusb_descriptor_config
(
winusb_setting
->
desc
,
winusb_intf
->
intf_num
);
_winusb_descriptor_config
(
winusb_setting
->
desc
,
winusb_intf
->
intf_num
,
device
->
dcd
->
device_is_hs
);
/* create endpoint */
winusb_desc
=
(
winusb_desc_t
)
winusb_setting
->
desc
;
...
...
components/drivers/usb/usbdevice/core/core.c
浏览文件 @
60b756a8
...
...
@@ -166,7 +166,7 @@ static rt_err_t _get_qualifier_descriptor(struct udevice* device, ureq_t setup)
RT_ASSERT
(
device
!=
RT_NULL
);
RT_ASSERT
(
setup
!=
RT_NULL
);
if
(
device
->
dev_qualifier
)
if
(
device
->
dev_qualifier
&&
device
->
dcd
->
device_is_hs
)
{
/* send device qualifier descriptor to endpoint 0 */
rt_usbd_ep0_write
(
device
,
(
rt_uint8_t
*
)
device
->
dev_qualifier
,
...
...
@@ -210,6 +210,9 @@ static rt_err_t _get_descriptor(struct udevice* device, ureq_t setup)
case
USB_DESC_TYPE_DEVICEQUALIFIER
:
_get_qualifier_descriptor
(
device
,
setup
);
break
;
case
USB_DESC_TYPE_OTHERSPEED
:
_get_config_descriptor
(
device
,
setup
);
break
;
default:
rt_kprintf
(
"unsupported descriptor request
\n
"
);
rt_usbd_ep0_set_stall
(
device
);
...
...
components/drivers/usb/usbdevice/core/usbdevice.c
浏览文件 @
60b756a8
...
...
@@ -59,6 +59,20 @@ static struct udevice_descriptor compsit_desc =
USB_STRING_SERIAL_INDEX
,
//iSerialNumber;
USB_DYNAMIC
,
//bNumConfigurations;
};
//FS and HS needed
static
struct
usb_qualifier_descriptor
dev_qualifier
=
{
sizeof
(
dev_qualifier
),
//bLength
USB_DESC_TYPE_DEVICEQUALIFIER
,
//bDescriptorType
0x0200
,
//bcdUSB
USB_CLASS_MISC
,
//bDeviceClass
0x02
,
//bDeviceSubClass
0x01
,
//bDeviceProtocol
64
,
//bMaxPacketSize0
0x01
,
//bNumConfigurations
0
,
};
#endif
struct
usb_os_comp_id_descriptor
usb_comp_id_desc
=
...
...
@@ -169,6 +183,7 @@ rt_err_t rt_usb_device_init(void)
#ifdef RT_USB_DEVICE_COMPOSITE
rt_usbd_device_set_descriptor
(
udevice
,
&
compsit_desc
);
rt_usbd_device_set_string
(
udevice
,
ustring
);
rt_usbd_device_set_qualifier
(
device
,
&
dev_qualifier
);
#else
rt_usbd_device_set_descriptor
(
udevice
,
func
->
dev_desc
);
#endif
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录