GateWay程序分析03_timer.h

同样的,先看看头文件的具体内容,然后再来做简短的分析:

#ifndef TIMER_H

#define TIMER_H

#ifdef __cplusplus

extern "C"

{

#endif

   

#include "lpc12xx_libcfg.h"

#define  START_TMR32B0()  TIM32_Cmd(LPC_TMR32B0, ENABLE);       /* 开启定时器                   */

#define  CLOSE_TMR32B0()  TIM32_Cmd(LPC_TMR32B0, DISABLE);        /* 关闭定时器                   */

extern bool    Timer32IntMark;

extern void Timer32Init (uint32 miroSecond);

#ifdef __cplusplus

}

#endif

#endif

这个函数就进行了

两个宏定义,  START_TMR32B0() , CLOSE_TMR32B0()

一个全局变量,定时器中断掩码

一个定时器初始化函数.

原文地址:https://www.cnblogs.com/xilifeng/p/3010863.html