Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
AdRainty
rt-thread
提交
f50f3874
R
rt-thread
项目概览
AdRainty
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
0
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,发现更多精彩内容 >>
提交
f50f3874
编写于
10月 27, 2019
作者:
G
guozhanxin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Perfect usb driver compatible with HS.|完善usb驱动兼容 HS
上级
4e3a7ee2
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
206 addition
and
63 deletion
+206
-63
bsp/stm32/libraries/HAL_Drivers/Kconfig
bsp/stm32/libraries/HAL_Drivers/Kconfig
+25
-0
bsp/stm32/libraries/HAL_Drivers/SConscript
bsp/stm32/libraries/HAL_Drivers/SConscript
+2
-2
bsp/stm32/libraries/HAL_Drivers/config/f1/usbd_config.h
bsp/stm32/libraries/HAL_Drivers/config/f1/usbd_config.h
+5
-3
bsp/stm32/libraries/HAL_Drivers/config/f4/usbd_config.h
bsp/stm32/libraries/HAL_Drivers/config/f4/usbd_config.h
+40
-0
bsp/stm32/libraries/HAL_Drivers/config/f4/usbd_fs_config.h
bsp/stm32/libraries/HAL_Drivers/config/f4/usbd_fs_config.h
+0
-15
bsp/stm32/libraries/HAL_Drivers/config/g4/usbd_config.h
bsp/stm32/libraries/HAL_Drivers/config/g4/usbd_config.h
+40
-0
bsp/stm32/libraries/HAL_Drivers/config/g4/usbd_fs_config.h
bsp/stm32/libraries/HAL_Drivers/config/g4/usbd_fs_config.h
+0
-15
bsp/stm32/libraries/HAL_Drivers/config/h7/usbd_config.h
bsp/stm32/libraries/HAL_Drivers/config/h7/usbd_config.h
+40
-0
bsp/stm32/libraries/HAL_Drivers/config/l4/usbd_config.h
bsp/stm32/libraries/HAL_Drivers/config/l4/usbd_config.h
+40
-0
bsp/stm32/libraries/HAL_Drivers/config/l4/usbd_fs_config.h
bsp/stm32/libraries/HAL_Drivers/config/l4/usbd_fs_config.h
+0
-15
bsp/stm32/libraries/HAL_Drivers/drv_config.h
bsp/stm32/libraries/HAL_Drivers/drv_config.h
+5
-4
bsp/stm32/libraries/HAL_Drivers/drv_usbd.c
bsp/stm32/libraries/HAL_Drivers/drv_usbd.c
+5
-5
bsp/stm32/libraries/templates/stm32xx_board_Kconfig
bsp/stm32/libraries/templates/stm32xx_board_Kconfig
+1
-1
bsp/stm32/stm32f429-st-disco/board/Kconfig
bsp/stm32/stm32f429-st-disco/board/Kconfig
+1
-1
bsp/stm32/stm32f469-st-disco/board/Kconfig
bsp/stm32/stm32f469-st-disco/board/Kconfig
+1
-1
bsp/stm32/stm32l475-atk-pandora/board/Kconfig
bsp/stm32/stm32l475-atk-pandora/board/Kconfig
+1
-1
未找到文件。
bsp/stm32/libraries/HAL_Drivers/Kconfig
浏览文件 @
f50f3874
if BSP_USING_USBD
config BSP_USBD_TYPE_FS
bool
# "USB Full Speed (FS) Core"
config BSP_USBD_TYPE_HS
bool
# "USB High Speed (HS) Core"
config BSP_USBD_SPEED_HS
bool
# "USB High Speed (HS) Mode"
config BSP_USBD_SPEED_HSINFS
bool
# "USB High Speed (HS) Core in FS mode"
config BSP_USBD_PHY_EMBEDDED
bool
# "Using Embedded phy interface"
config BSP_USBD_PHY_UTMI
bool
# "UTMI: USB 2.0 Transceiver Macrocell Interace"
config BSP_USBD_PHY_ULPI
bool
# "ULPI: UTMI+ Low Pin Interface"
endif
config BSP_USING_CRC
bool "Enable CRC (CRC-32 0x04C11DB7 Polynomial)"
...
...
bsp/stm32/libraries/HAL_Drivers/SConscript
浏览文件 @
f50f3874
...
...
@@ -82,8 +82,8 @@ if GetDepend(['BSP_USING_WDT']):
if
GetDepend
([
'BSP_USING_SDIO'
]):
src
+=
[
'drv_sdio.c'
]
if
GetDepend
([
'BSP_USING_USBD
_FS
'
]):
src
+=
[
'drv_usbd
_fs
.c'
]
if
GetDepend
([
'BSP_USING_USBD'
]):
src
+=
[
'drv_usbd.c'
]
if
GetDepend
([
'BSP_USING_PULSE_ENCODER'
]):
src
+=
[
'drv_pulse_encoder.c'
]
...
...
bsp/stm32/libraries/HAL_Drivers/config/f1/usbd_
fs_
config.h
→
bsp/stm32/libraries/HAL_Drivers/config/f1/usbd_config.h
浏览文件 @
f50f3874
...
...
@@ -8,11 +8,13 @@
* 2019-04-10 ZYH first version
* 2019-07-29 Chinese66 change from f4 to f1
*/
#ifndef __USBD_
FS_
CONFIG_H__
#define __USBD_
FS_
CONFIG_H__
#ifndef __USBD_CONFIG_H__
#define __USBD_CONFIG_H__
#define USBD_
FS_IRQ_HANDLER
USB_LP_CAN1_RX0_IRQHandler
#define USBD_
IRQ_HANDLER
USB_LP_CAN1_RX0_IRQHandler
#define USBD_INSTANCE USB
#define USBD_PCD_SPEED PCD_SPEED_FULL
#define USBD_PCD_PHY_MODULE PCD_PHY_EMBEDDED
#define BSP_USB_CONNECT_PIN -1
#endif
bsp/stm32/libraries/HAL_Drivers/config/f4/usbd_config.h
0 → 100644
浏览文件 @
f50f3874
/*
* Copyright (c) 2006-2018, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2019-04-10 ZYH first version
* 2019-10-27 flybreak Compatible with the HS
*/
#ifndef __USBD_CONFIG_H__
#define __USBD_CONFIG_H__
#include <rtconfig.h>
#ifdef BSP_USBD_TYPE_HS
#define USBD_IRQ_HANDLER OTG_HS_IRQHandler
#define USBD_INSTANCE USB_OTG_HS
#else
#define USBD_IRQ_HANDLER OTG_FS_IRQHandler
#define USBD_INSTANCE USB_OTG_FS
#endif
#ifdef BSP_USBD_SPEED_HS
#define USBD_PCD_SPEED PCD_SPEED_HIGH
#elif BSP_USBD_SPEED_HSINFS
#define USBD_PCD_SPEED PCD_SPEED_HIGH_IN_FULL
#else
#define USBD_PCD_SPEED PCD_SPEED_FULL
#endif
#ifdef BSP_USBD_PHY_ULPI
#define USBD_PCD_PHY_MODULE PCD_PHY_ULPI
#elif BSP_USBD_PHY_UTMI
#define USBD_PCD_PHY_MODULE PCD_PHY_UTMI
#else
#define USBD_PCD_PHY_MODULE PCD_PHY_EMBEDDED
#endif
#endif
bsp/stm32/libraries/HAL_Drivers/config/f4/usbd_fs_config.h
已删除
100644 → 0
浏览文件 @
4e3a7ee2
/*
* Copyright (c) 2006-2018, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2019-04-10 ZYH first version
*/
#ifndef __USBD_FS_CONFIG_H__
#define __USBD_FS_CONFIG_H__
#define USBD_FS_IRQ_HANDLER OTG_FS_IRQHandler
#define USBD_INSTANCE USB_OTG_FS
#endif
bsp/stm32/libraries/HAL_Drivers/config/g4/usbd_config.h
0 → 100644
浏览文件 @
f50f3874
/*
* Copyright (c) 2006-2018, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2019-04-10 ZYH first version
* 2019-10-27 flybreak Compatible with the HS
*/
#ifndef __USBD_CONFIG_H__
#define __USBD_CONFIG_H__
#include <rtconfig.h>
#ifdef BSP_USBD_TYPE_HS
#define USBD_IRQ_HANDLER OTG_HS_IRQHandler
#define USBD_INSTANCE USB_OTG_HS
#else
#define USBD_IRQ_HANDLER OTG_FS_IRQHandler
#define USBD_INSTANCE USB_OTG_FS
#endif
#ifdef BSP_USBD_SPEED_HS
#define USBD_PCD_SPEED PCD_SPEED_HIGH
#elif BSP_USBD_SPEED_HSINFS
#define USBD_PCD_SPEED PCD_SPEED_HIGH_IN_FULL
#else
#define USBD_PCD_SPEED PCD_SPEED_FULL
#endif
#ifdef BSP_USBD_PHY_ULPI
#define USBD_PCD_PHY_MODULE PCD_PHY_ULPI
#elif BSP_USBD_PHY_UTMI
#define USBD_PCD_PHY_MODULE PCD_PHY_UTMI
#else
#define USBD_PCD_PHY_MODULE PCD_PHY_EMBEDDED
#endif
#endif
bsp/stm32/libraries/HAL_Drivers/config/g4/usbd_fs_config.h
已删除
100644 → 0
浏览文件 @
4e3a7ee2
/*
* Copyright (c) 2006-2018, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2019-04-10 ZYH first version
*/
#ifndef __USBD_FS_CONFIG_H__
#define __USBD_FS_CONFIG_H__
#define USBD_FS_IRQ_HANDLER OTG_FS_IRQHandler
#define USBD_INSTANCE USB_OTG_FS
#endif
bsp/stm32/libraries/HAL_Drivers/config/h7/usbd_config.h
0 → 100644
浏览文件 @
f50f3874
/*
* Copyright (c) 2006-2018, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2019-04-10 ZYH first version
* 2019-10-27 flybreak Compatible with the HS
*/
#ifndef __USBD_CONFIG_H__
#define __USBD_CONFIG_H__
#include <rtconfig.h>
#ifdef BSP_USBD_TYPE_HS
#define USBD_IRQ_HANDLER OTG_HS_IRQHandler
#define USBD_INSTANCE USB_OTG_HS
#else
#define USBD_IRQ_HANDLER OTG_FS_IRQHandler
#define USBD_INSTANCE USB_OTG_FS
#endif
#ifdef BSP_USBD_SPEED_HS
#define USBD_PCD_SPEED PCD_SPEED_HIGH
#elif BSP_USBD_SPEED_HSINFS
#define USBD_PCD_SPEED PCD_SPEED_HIGH_IN_FULL
#else
#define USBD_PCD_SPEED PCD_SPEED_FULL
#endif
#ifdef BSP_USBD_PHY_ULPI
#define USBD_PCD_PHY_MODULE PCD_PHY_ULPI
#elif BSP_USBD_PHY_UTMI
#define USBD_PCD_PHY_MODULE PCD_PHY_UTMI
#else
#define USBD_PCD_PHY_MODULE PCD_PHY_EMBEDDED
#endif
#endif
bsp/stm32/libraries/HAL_Drivers/config/l4/usbd_config.h
0 → 100644
浏览文件 @
f50f3874
/*
* Copyright (c) 2006-2018, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2019-04-10 ZYH first version
* 2019-10-27 flybreak Compatible with the HS
*/
#ifndef __USBD_CONFIG_H__
#define __USBD_CONFIG_H__
#include <rtconfig.h>
#ifdef BSP_USBD_TYPE_HS
#define USBD_IRQ_HANDLER OTG_HS_IRQHandler
#define USBD_INSTANCE USB_OTG_HS
#else
#define USBD_IRQ_HANDLER OTG_FS_IRQHandler
#define USBD_INSTANCE USB_OTG_FS
#endif
#ifdef BSP_USBD_SPEED_HS
#define USBD_PCD_SPEED PCD_SPEED_HIGH
#elif BSP_USBD_SPEED_HSINFS
#define USBD_PCD_SPEED PCD_SPEED_HIGH_IN_FULL
#else
#define USBD_PCD_SPEED PCD_SPEED_FULL
#endif
#ifdef BSP_USBD_PHY_ULPI
#define USBD_PCD_PHY_MODULE PCD_PHY_ULPI
#elif BSP_USBD_PHY_UTMI
#define USBD_PCD_PHY_MODULE PCD_PHY_UTMI
#else
#define USBD_PCD_PHY_MODULE PCD_PHY_EMBEDDED
#endif
#endif
bsp/stm32/libraries/HAL_Drivers/config/l4/usbd_fs_config.h
已删除
100644 → 0
浏览文件 @
4e3a7ee2
/*
* Copyright (c) 2006-2018, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2019-04-10 ZYH first version
*/
#ifndef __USBD_FS_CONFIG_H__
#define __USBD_FS_CONFIG_H__
#define USBD_FS_IRQ_HANDLER OTG_FS_IRQHandler
#define USBD_INSTANCE USB_OTG_FS
#endif
bsp/stm32/libraries/HAL_Drivers/drv_config.h
浏览文件 @
f50f3874
...
...
@@ -33,7 +33,7 @@ extern "C" {
#include "f1/tim_config.h"
#include "f1/sdio_config.h"
#include "f1/pwm_config.h"
#include "f1/usbd_
fs_
config.h"
#include "f1/usbd_config.h"
#include "f1/pulse_encoder_config.h"
#elif defined(SOC_SERIES_STM32F2)
#include "f2/dma_config.h"
...
...
@@ -48,7 +48,7 @@ extern "C" {
#include "f4/uart_config.h"
#include "f4/spi_config.h"
#include "f4/qspi_config.h"
#include "f4/usbd_
fs_
config.h"
#include "f4/usbd_config.h"
#include "f4/adc_config.h"
#include "f4/tim_config.h"
#include "f4/sdio_config.h"
...
...
@@ -75,7 +75,7 @@ extern "C" {
#include "l4/tim_config.h"
#include "l4/sdio_config.h"
#include "l4/pwm_config.h"
#include "l4/usbd_
fs_
config.h"
#include "l4/usbd_config.h"
#elif defined(SOC_SERIES_STM32G0)
#include "g0/dma_config.h"
#include "g0/uart_config.h"
...
...
@@ -88,7 +88,7 @@ extern "C" {
#include "g4/uart_config.h"
#include "g4/spi_config.h"
#include "g4/qspi_config.h"
#include "g4/usbd_
fs_
config.h"
#include "g4/usbd_config.h"
#include "g4/adc_config.h"
#include "g4/tim_config.h"
#include "g4/sdio_config.h"
...
...
@@ -103,6 +103,7 @@ extern "C" {
#include "h7/tim_config.h"
#include "h7/sdio_config.h"
#include "h7/pwm_config.h"
#include "h7/usbd_config.h"
#endif
#ifdef __cplusplus
...
...
bsp/stm32/libraries/HAL_Drivers/drv_usbd
_fs
.c
→
bsp/stm32/libraries/HAL_Drivers/drv_usbd.c
浏览文件 @
f50f3874
...
...
@@ -6,11 +6,12 @@
* Change Logs:
* Date Author Notes
* 2019-04-10 ZYH first version
* 2019-10-27 flybreak Compatible with the HS
*/
#include <rtthread.h>
#ifdef BSP_USING_USBD
_FS
#ifdef BSP_USING_USBD
#include <rtdevice.h>
#include "board.h"
#include <string.h>
...
...
@@ -32,13 +33,12 @@ static struct ep_id _ep_pool[] =
{
0xFF
,
USB_EP_ATTR_TYPE_MASK
,
USB_DIR_MASK
,
0
,
ID_ASSIGNED
},
};
void
USBD_
FS_
IRQ_HANDLER
(
void
)
void
USBD_IRQ_HANDLER
(
void
)
{
rt_interrupt_enter
();
HAL_PCD_IRQHandler
(
&
_stm_pcd
);
/* leave interrupt */
rt_interrupt_leave
();
}
void
HAL_PCD_ResetCallback
(
PCD_HandleTypeDef
*
pcd
)
...
...
@@ -194,10 +194,10 @@ static rt_err_t _init(rt_device_t device)
pcd
->
Instance
=
USBD_INSTANCE
;
memset
(
&
pcd
->
Init
,
0
,
sizeof
pcd
->
Init
);
pcd
->
Init
.
dev_endpoints
=
8
;
pcd
->
Init
.
speed
=
PCD_SPEED_FULL
;
pcd
->
Init
.
speed
=
USBD_PCD_SPEED
;
pcd
->
Init
.
ep0_mps
=
DEP0CTL_MPS_64
;
#if !defined(SOC_SERIES_STM32F1)
pcd
->
Init
.
phy_itface
=
PCD_PHY_EMBEDDED
;
pcd
->
Init
.
phy_itface
=
USBD_PCD_PHY_MODULE
;
#endif
/* Initialize LL Driver */
HAL_PCD_Init
(
pcd
);
...
...
bsp/stm32/libraries/templates/stm32xx_board_Kconfig
浏览文件 @
f50f3874
...
...
@@ -171,7 +171,7 @@ menu "On-chip Peripheral Drivers"
select RT_USING_WDT
default n
config BSP_USING_USBD
_FS
config BSP_USING_USBD
bool "Enable OTGFS as USB device"
select RT_USING_USB_DEVICE
default n
...
...
bsp/stm32/stm32f429-st-disco/board/Kconfig
浏览文件 @
f50f3874
...
...
@@ -76,7 +76,7 @@ menu "On-chip Peripheral Drivers"
bool "Enable FMC"
default n
config BSP_USING_USBD
_FS
config BSP_USING_USBD
bool "Enable OTGFS as USB device"
select RT_USING_USB_DEVICE
default n
...
...
bsp/stm32/stm32f469-st-disco/board/Kconfig
浏览文件 @
f50f3874
...
...
@@ -149,7 +149,7 @@ menu "On-chip Peripheral Drivers"
select RT_USING_DFS
default n
config BSP_USING_USBD
_FS
config BSP_USING_USBD
bool "Enable OTGFS as USB device"
select RT_USING_USB_DEVICE
default n
...
...
bsp/stm32/stm32l475-atk-pandora/board/Kconfig
浏览文件 @
f50f3874
...
...
@@ -300,7 +300,7 @@ menu "On-chip Peripheral Drivers"
select RT_USING_WDT
default n
config BSP_USING_USBD
_FS
config BSP_USING_USBD
bool "Enable OTGFS as USB device"
select RT_USING_USB_DEVICE
default n
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录