You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
# include "iwdg.h"
/*******************************************************************************
* 函 数 名 : IWDG_Init
* 函数功能 : IWDG初始化
* 输 入 : pre:预分频系数(0-6)
rlr:重装载值(12位范围0xfff)
独立看门狗复位时间计算公式: t=(4*2^pre*rlr)/40
* 输 出 : 无
*******************************************************************************/
void iwdg_my_Init ( u8 pre , u16 rlr )
{
IWDG_WriteAccessCmd ( IWDG_WriteAccess_Enable ) ; //取消寄存器写保护
IWDG_SetPrescaler ( pre ) ; //设置预分频系数 0-6
IWDG_SetReload ( rlr ) ; //设置重装载值
IWDG_ReloadCounter ( ) ; //重装载初值
IWDG_Enable ( ) ; //打开独立看门狗
}
/*******************************************************************************
* 函 数 名 : IWDG_FeedDog
* 函数功能 : 喂狗
* 输 入 : 无
* 输 出 : 无
*******************************************************************************/
void IWDG_FeedDog ( void ) //喂狗
{
IWDG_ReloadCounter ( ) ; //重装载初值
}