Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
rt-thread
提交
40d60558
R
rt-thread
项目概览
BaiXuePrincess
/
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,发现更多精彩内容 >>
提交
40d60558
编写于
10月 30, 2019
作者:
G
guozhanxin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[bsp][stm32]Enable interrupt in drive.|在驱动里使能中断,不需要在cubemx里配置中断了。
上级
186d7cff
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
25 addition
and
4 deletion
+25
-4
bsp/stm32/libraries/HAL_Drivers/config/f1/usbd_config.h
bsp/stm32/libraries/HAL_Drivers/config/f1/usbd_config.h
+7
-0
bsp/stm32/libraries/HAL_Drivers/config/f4/usbd_config.h
bsp/stm32/libraries/HAL_Drivers/config/f4/usbd_config.h
+3
-1
bsp/stm32/libraries/HAL_Drivers/config/g4/usbd_config.h
bsp/stm32/libraries/HAL_Drivers/config/g4/usbd_config.h
+2
-0
bsp/stm32/libraries/HAL_Drivers/config/h7/usbd_config.h
bsp/stm32/libraries/HAL_Drivers/config/h7/usbd_config.h
+3
-1
bsp/stm32/libraries/HAL_Drivers/config/l4/usbd_config.h
bsp/stm32/libraries/HAL_Drivers/config/l4/usbd_config.h
+2
-0
bsp/stm32/libraries/HAL_Drivers/drv_usbd.c
bsp/stm32/libraries/HAL_Drivers/drv_usbd.c
+8
-2
未找到文件。
bsp/stm32/libraries/HAL_Drivers/config/f1/usbd_config.h
浏览文件 @
40d60558
...
...
@@ -11,10 +11,17 @@
#ifndef __USBD_CONFIG_H__
#define __USBD_CONFIG_H__
#define USBD_IRQ_TYPE USB_LP_CAN1_RX0_IRQn
#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
#ifndef BSP_USB_CONNECT_PIN
#define BSP_USB_CONNECT_PIN -1
#endif
#ifndef BSP_USB_PULL_UP_STATUS
#define BSP_USB_PULL_UP_STATUS 1
#endif
#endif
bsp/stm32/libraries/HAL_Drivers/config/f4/usbd_config.h
浏览文件 @
40d60558
...
...
@@ -14,9 +14,11 @@
#include <rtconfig.h>
#ifdef BSP_USBD_TYPE_HS
#define USBD_IRQ_TYPE OTG_HS_IRQn
#define USBD_IRQ_HANDLER OTG_HS_IRQHandler
#define USBD_INSTANCE USB_OTG_HS
#else
#define USBD_IRQ_TYPE OTG_FS_IRQn
#define USBD_IRQ_HANDLER OTG_FS_IRQHandler
#define USBD_INSTANCE USB_OTG_FS
#endif
...
...
bsp/stm32/libraries/HAL_Drivers/config/g4/usbd_config.h
浏览文件 @
40d60558
...
...
@@ -14,9 +14,11 @@
#include <rtconfig.h>
#ifdef BSP_USBD_TYPE_HS
#define USBD_IRQ_TYPE OTG_HS_IRQn
#define USBD_IRQ_HANDLER OTG_HS_IRQHandler
#define USBD_INSTANCE USB_OTG_HS
#else
#define USBD_IRQ_TYPE OTG_FS_IRQn
#define USBD_IRQ_HANDLER OTG_FS_IRQHandler
#define USBD_INSTANCE USB_OTG_FS
#endif
...
...
bsp/stm32/libraries/HAL_Drivers/config/h7/usbd_config.h
浏览文件 @
40d60558
...
...
@@ -14,9 +14,11 @@
#include <rtconfig.h>
#ifdef BSP_USBD_TYPE_HS
#define USBD_IRQ_TYPE OTG_HS_IRQn
#define USBD_IRQ_HANDLER OTG_HS_IRQHandler
#define USBD_INSTANCE USB_OTG_HS
#else
#define USBD_IRQ_TYPE OTG_FS_IRQn
#define USBD_IRQ_HANDLER OTG_FS_IRQHandler
#define USBD_INSTANCE USB_OTG_FS
#endif
...
...
bsp/stm32/libraries/HAL_Drivers/config/l4/usbd_config.h
浏览文件 @
40d60558
...
...
@@ -14,9 +14,11 @@
#include <rtconfig.h>
#ifdef BSP_USBD_TYPE_HS
#define USBD_IRQ_TYPE OTG_HS_IRQn
#define USBD_IRQ_HANDLER OTG_HS_IRQHandler
#define USBD_INSTANCE USB_OTG_HS
#else
#define USBD_IRQ_TYPE OTG_FS_IRQn
#define USBD_IRQ_HANDLER OTG_FS_IRQHandler
#define USBD_INSTANCE USB_OTG_FS
#endif
...
...
bsp/stm32/libraries/HAL_Drivers/drv_usbd.c
浏览文件 @
40d60558
...
...
@@ -99,14 +99,14 @@ void HAL_PCDEx_SetConnectionState(PCD_HandleTypeDef *hpcd, uint8_t state)
{
#if defined(SOC_SERIES_STM32F1)
rt_pin_mode
(
BSP_USB_CONNECT_PIN
,
PIN_MODE_OUTPUT
);
rt_pin_write
(
BSP_USB_CONNECT_PIN
,
PIN_HIGH
);
rt_pin_write
(
BSP_USB_CONNECT_PIN
,
BSP_USB_PULL_UP_STATUS
);
#endif
}
else
{
#if defined(SOC_SERIES_STM32F1)
rt_pin_mode
(
BSP_USB_CONNECT_PIN
,
PIN_MODE_OUTPUT
);
rt_pin_write
(
BSP_USB_CONNECT_PIN
,
PIN_LOW
);
rt_pin_write
(
BSP_USB_CONNECT_PIN
,
!
BSP_USB_PULL_UP_STATUS
);
#endif
}
}
...
...
@@ -201,6 +201,9 @@ static rt_err_t _init(rt_device_t device)
#endif
/* Initialize LL Driver */
HAL_PCD_Init
(
pcd
);
/* USB interrupt Init */
HAL_NVIC_SetPriority
(
USBD_IRQ_TYPE
,
2
,
0
);
HAL_NVIC_EnableIRQ
(
USBD_IRQ_TYPE
);
#if !defined(SOC_SERIES_STM32F1)
HAL_PCDEx_SetRxFiFo
(
pcd
,
0x80
);
HAL_PCDEx_SetTxFiFo
(
pcd
,
0
,
0x40
);
...
...
@@ -246,6 +249,9 @@ int stm_usbd_register(void)
/* Register endpoint infomation */
_stm_udc
.
ep_pool
=
_ep_pool
;
_stm_udc
.
ep0
.
id
=
&
_ep_pool
[
0
];
#ifdef BSP_USBD_SPEED_HS
_stm_udc
.
device_is_hs
=
RT_TRUE
;
#endif
rt_device_register
((
rt_device_t
)
&
_stm_udc
,
"usbd"
,
0
);
rt_usb_device_init
();
return
RT_EOK
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录