Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
逆着光、寻觅
rt-thread
提交
8107542d
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,发现更多精彩内容 >>
提交
8107542d
编写于
10月 17, 2018
作者:
X
XXXXzzzz000
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[driver][iwdg]add iwdg driver. | 添加iwdg驱动,参考:stm32f4xx-HAL/driver_wdg
上级
cedb9b92
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
101 addition
and
1 deletion
+101
-1
bsp/stm32f10x-HAL/Kconfig
bsp/stm32f10x-HAL/Kconfig
+11
-0
bsp/stm32f10x-HAL/drivers/drv_iwg.c
bsp/stm32f10x-HAL/drivers/drv_iwg.c
+71
-0
bsp/stm32f10x-HAL/drivers/drv_iwg.h
bsp/stm32f10x-HAL/drivers/drv_iwg.h
+18
-0
bsp/stm32f10x-HAL/drivers/stm32f1xx_hal_conf.h
bsp/stm32f10x-HAL/drivers/stm32f1xx_hal_conf.h
+1
-1
未找到文件。
bsp/stm32f10x-HAL/Kconfig
浏览文件 @
8107542d
...
...
@@ -182,6 +182,17 @@ if RT_USING_SPI
default n
endif
menuconfig BSP_USING_WDT
bool "Using wdt"
select RT_USING_WDT
default n
if BSP_USING_WDT
config BSP_USING_WDT_IWDG
bool "Enable iwdg"
default n
endif
if RT_USING_DEVICE_IPC && (STM32F103RC || STM32F103RD || STM32F103RE || STM32F103RF || STM32F103RG ||STM32F103VC || STM32F103VD || STM32F103VE || STM32F103VF || STM32F103VG ||STM32F103ZC || STM32F103ZD || STM32F103ZE || STM32F103ZF || STM32F103ZG)
config RT_USING_SDCARD
bool "Using sdcard with sdio"
...
...
bsp/stm32f10x-HAL/drivers/drv_iwg.c
0 → 100644
浏览文件 @
8107542d
/*
* File : drv_iwg.c
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2015, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2017-11-08 ZYH the first version
*/
#include <rthw.h>
#include <rtthread.h>
#include <rtdevice.h>
#include <board.h>
#ifdef RT_USING_WDT
IWDG_HandleTypeDef
hiwdg
;
static
rt_err_t
drv_init
(
rt_watchdog_t
*
wdt
)
{
hiwdg
.
Instance
=
IWDG
;
hiwdg
.
Init
.
Prescaler
=
IWDG_PRESCALER_16
;
//1s
hiwdg
.
Init
.
Reload
=
4095
;
if
(
HAL_IWDG_Init
(
&
hiwdg
)
!=
HAL_OK
)
{
RT_ASSERT
(
0
);
}
return
RT_EOK
;
}
static
rt_err_t
drv_control
(
rt_watchdog_t
*
wdt
,
int
cmd
,
void
*
arg
)
{
switch
(
cmd
)
{
case
RT_DEVICE_CTRL_WDT_SET_TIMEOUT
:
hiwdg
.
Init
.
Reload
=
(
rt_uint32_t
)
arg
;
if
(
HAL_IWDG_Init
(
&
hiwdg
)
!=
HAL_OK
)
{
return
RT_ERROR
;
}
break
;
case
RT_DEVICE_CTRL_WDT_KEEPALIVE
:
HAL_IWDG_Refresh
(
&
hiwdg
);
break
;
default:
return
RT_ERROR
;
}
return
RT_EOK
;
}
static
struct
rt_watchdog_ops
_ops
=
{
drv_init
,
drv_control
};
static
rt_watchdog_t
_iwg
=
{
.
ops
=
&
_ops
};
int
rt_iwg_init
(
void
)
{
return
rt_hw_watchdog_register
(
&
_iwg
,
"iwg"
,
RT_DEVICE_FLAG_DEACTIVATE
,
RT_NULL
);
}
INIT_BOARD_EXPORT
(
rt_iwg_init
);
#endif
bsp/stm32f10x-HAL/drivers/drv_iwg.h
0 → 100644
浏览文件 @
8107542d
/*
* File : drv_iwg.h
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2015, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2017-11-08 ZYH the first version
*/
#ifndef __DRV_IWG_H__
#define __DRV_IWG_H__
extern
int
rt_iwg_init
(
void
);
#endif
bsp/stm32f10x-HAL/drivers/stm32f1xx_hal_conf.h
浏览文件 @
8107542d
...
...
@@ -70,7 +70,7 @@ extern "C" {
// #define HAL_I2C_MODULE_ENABLED
// #define HAL_I2S_MODULE_ENABLED
// #define HAL_IRDA_MODULE_ENABLED
//
#define HAL_IWDG_MODULE_ENABLED
#define HAL_IWDG_MODULE_ENABLED
// #define HAL_NAND_MODULE_ENABLED
// #define HAL_NOR_MODULE_ENABLED
// #define HAL_PCCARD_MODULE_ENABLED
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录