📄 wdt270.c
字号:
/*
DM270 ARM Evaluation Software
(c)Texas Instruments 2003
*/
/**
\file wdt270.c
\brief Watch Dog Timer Related APIs
*/
#include <wdt270.h>
/**
\brief Set WDT configuration
\param wdtConfig WDT configuration paramters
\return if success, \c E_PASS, else error code
\see WDT_ConfigData
*/
STATUS WDT_setConfig( WDT_ConfigData *wdtConfig ){
WDT_FSET(WDTMD, OPSEL, wdtConfig->wdtMode);
WDT_FSET(WDTPRSCL, PRSCL, wdtConfig->wdtPrescale);
WDT_RSET(WDTDIV, wdtConfig->wdtDivisor);
WDT_FSET(WDTEXRST,WERST,wdtConfig->wdtExtRst);
return((WDT_RGET( WDTDIV ) == wdtConfig->wdtDivisor) ? E_PASS : E_DEVICE);
}
/**
\brief Enable WDT
\return if success, \c E_PASS, else error code
*/
STATUS WDT_enable(){
WDT_FSET(WDTMD, ENABLE, 1);
return ((WDT_FGET( WDTMD, ENABLE ) == 1) ? E_PASS : E_DEVICE);
}
/**
\brief Disable WDT
\return if success, \c E_PASS, else error code
*/
STATUS WDT_disable(){
WDT_FSET(WDTMD, ENABLE,0);
return E_PASS;
}
/**
\brief Reset WDT
\return if success, \c E_PASS, else error code
*/
STATUS WDT_reset(){
WDT_FSET(WDTRST, WDTRST, 1);
return E_PASS;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -