/*****************************************************************************
* wdt.c: Watchdog C file for NXP LPC11xx Family Microprocessors
*
* Copyright(C) 2008, NXP Semiconductor
* All rights reserved.
*
* History
* 2008.07.20 ver 1.00 Prelimnary version, first Release
*
*****************************************************************************/
#include "LPC11xx.h" /* LPC11xx Peripheral Registers */
#include "wdt.h"
volatile uint32_t wdt_counter;
/*****************************************************************************
** Function name: WDTHandler
**
** Descriptions: Watchdog timer interrupt handler
**
** parameters: None
** Returned value: None
**
*****************************************************************************/
void WDT_IRQHandler(void)
{
LPC_WDT->MOD &= ~WDTOF; /* clear the time-out flag */
/* Please note, the sequence here is crucial. */
LPC_WDT->MOD &= ~WDINT; /* Then, clear the interrupt flag */
wdt_counter++;
}
/*****************************************************************************
** Function name: WDTInit
**
** Descriptions: Initialize watchdog timer, install the
** watchdog timer interrupt handler
**
** parameters: None
** Returned value: None
**
*****************************************************************************/
void WDTInit( void )
{
/* Enable clock to WDT */
LPC_SYSCON->SYSAHBCLKCTRL |= (1<<15);
wdt_counter = 0;
/* Enable the WDT Interrupt */
NVIC_EnableIRQ(WDT_IRQn);
LPC_WDT->TC = WDT_FEED_VALUE; /* once WDEN is set, the WDT will start after feeding */
// LPC_WDT->MOD = WDEN | WDRESET;
LPC_WDT->MOD = WDEN;
LPC_WDT->FEED = 0xAA; /* Feeding sequence */
LPC_WDT->FEED = 0x55;
return;
}
/*****************************************************************************
** Function name: WDTFeed
**
** Descriptions: Feed watchdog timer to prevent it from timeout
**
** parameters: None
** Returned value: None
**
*****************************************************************************/
void WDTFeed( void )
{
LPC_WDT->FEED = 0xAA; /* Feeding sequence */
LPC_WDT->FEED = 0x55;
return;
}
/******************************************************************************
** End Of File
******************************************************************************/
WDT.rar_LPC1114_LPC1114 WDT
版权申诉
166 浏览量
2022-09-21
08:28:26
上传
评论
收藏 12KB RAR 举报
Kinonoyomeo
- 粉丝: 76
- 资源: 1万+
最新资源
- 基于Matlab人脸肤色定理的教师人数统计+源代码+全部数据+文档说明+详细注释+使用说明+截图(高分课程设计)
- 基于Matlab霍夫曼变换的表盘读数识别+源代码+全部数据+文档说明+详细注释+使用说明+截图(高分课程设计)
- 基于Matlab火灾烟雾检测源码带GUI界面+源代码+全部数据+文档说明+详细注释+使用说明+截图(高分课程设计)
- 基于Matlab的恶劣天气交通标志识别系统+源代码+全部数据+文档说明+详细注释+使用说明+截图(高分课程设计)
- 基于MATLAB的霍夫曼变换的表盘示数识别+源代码+全部数据+文档说明+详细注释+使用说明+截图(高分课程设计)
- 基于Matlab的车道线识别系统 +源代码+全部数据+文档说明+详细注释+使用说明+截图(高分课程设计)
- 基于MATLAB的教室人数统计系统带Gui界面+源代码+全部数据+文档说明+详细注释+使用说明+截图(高分课程设计)
- 基于MATLAB的教室人数统计系统带Gui界面+源代码+全部数据+文档说明+详细注释+使用说明+截图(高分课程设计)
- 基于MATLAB 的霍夫曼变换答题卡识别源码+全部数据+文档说明+详细注释+使用说明+截图(高分课程设计)
- 基于Matlab+bp神经网络的神经网络汉字识别系统+源代码+全部数据+文档说明+详细注释+使用说明+截图(高分课程设计)
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈