⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lpc_wdg.c

📁 给大家提供一个在inram/exram中调试的示例,在周公的lpc2200上调试过.
💻 C
字号:
/***********************************************************************
 *         BU MMS China, Philips Semiconductor Software Support
 *         Embest info&Tech Co. Software Support
 *---------------------------------------------------------------------------
 * The software is delivered "AS IS" without warranty or condition of any
 * kind, either express, implied or statutory.  Everybody can use it as 
 * it is opened and without copyright. We will not take any law responsibility
 * for any problem produced by using this software.
 *---------------------------------------------------------------------------                                                
 *    File name: 	LPC_Wdg.c
 *    Description: 	Define API for Watchdog
 *                                                                                      
 *    History:                                                                     
 *    1. Date: 		Oct 19, 2004                                              
 *       Author: 	Shawn Zhang                                                 
 *       Description: Create
 *
 *	$Revision: 1.0 $
 **********************************************************************/

#include "LPC_Wdg.h"

/*************************************************************************
 * Function Name: WDT_Start
 * Parameters: unsigned long timeout -- 
 *				The unit is us. the minimum time-out is Tpclk*256*4
 *			
 * Return: void 
 *
 * Description: Start up the Watchdog
 *
 *************************************************************************/
void WDT_Start(unsigned long timeout)
{
	long N;

	N = timeout / 4000000 ;
	N *= SYS_GetFpclk();

	if (N < WDT_TIMEOUTMIN)
		N = WDT_TIMEOUTMIN;

	WDTC = N;
	WDMOD = 0x3;
}

/*************************************************************************
 * Function Name: WDT_Feed
 * Parameters: 
 * Return: void
 *
 * Description: Feed the watchdog
 *  
 *************************************************************************/
void WDT_Feed(void)
{
	WDFEED = 0xAA;
	WDFEED = 0x55;
}


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -