PASII/CandeII_1.4/Driver/wdt.c

34 lines
967 B
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include "wdt.h"
#ifdef _WDT_
static WDT_CTRL_TYPE * WDT_CTRL = ((WDT_CTRL_TYPE *) WDT_BASE);
/************************************************************************************
看门狗初始化函数
参数: uint16_t count 看门狗计数器初始值 计数器是递减计数器 单位256/32.768 = 7.8ms
*************************************************************************************/
void wdt_enable(uint16_t count)
{
WDT_CTRL->WDT_TIME = count;
WDT_CTRL->WDT_EN = 1;
}
/*************************************************************************************
清除看门狗函数
这里将会把计数器的值设置回初始值
**************************************************************************************/
void wdt_clear()
{
WDT_CTRL->WDT_CLR=1;
}
/*************************************************************************************
禁用看门狗
**************************************************************************************/
void wdt_disable()
{
WDT_CTRL->WDT_EN = 0;
}
#endif