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

📄 kertimer.h

📁 无线传感器星型网络的节点的基站程序,采用802.15.4协议
💻 H
字号:
//----------------------------------------------------//
//-------Institute Of  Computing Technology-----------//
//------------Chinese Academic  Science---------------//
//-----中国科学院计算技术研究所先进测试技术实验室-----//
//----------------------------------------------------//

// **************************************************
// * @copyright:nbicc_lpp
// * @this is kertime support 
// * @author zhouqiang  (zhouhongren@163.com)
// *              liulingyi      (lingyiliu@ict.ac.cn)
// * @data:2005.12.02
// * @version:0.0.1
// * @updata:$
// **************************************************

#ifndef _TIMER0_H
#define _TIMER0_H
#include <avr/signal.h>


#include "top.h"
//kertimer use timer0
/** 
   *  set Timer/Counter0 to be asynchronous 
   *  from the CPU clock with a second external 
   *  clock(32,768kHz)driving it
 **/

#define  KER_TIMERS  3
//-------------------------------kertime setup------------------added by zhouqiang in 2005.12.02
uint32_t mState;		// each bit represent a timer state 
uint8_t   setIntervalFlag; 
uint8_t   mScale, mInterval;
int8_t     queue_head;
int8_t     queue_tail;
uint8_t   queue_size;
uint8_t   queue[KER_TIMERS];

struct timer_s {
        uint8_t type;		// one-short or repeat timer
        int32_t ticks;		// clock ticks for a repeat timer 
        int32_t ticksLeft;	// ticks left before the timer expires
        void (*tp)(void);//fire to what
    } mTimerList[KER_TIMERS];

enum {
		maxTimerInterval = 230
          };

enum kertimer_type_value {
  KERTIMER_REPEAT = 0, 
  KERTIMER_ONE_SHOT = 1, 
  
};
//------------------------------------------------------------added by zhouqiang in 2005.12.02
void kertimer_init(void);
uint8_t  kertimer_start (uint8_t  id,uint8_t type, uint32_t  interval,void (* fun)(void)) ;
void kertimer_stop(uint8_t id);
void KERTimer_Fire(void) ;
#endif 

⌨️ 快捷键说明

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