sigtimer.h

来自「ATmega64+12864液晶」· C头文件 代码 · 共 76 行

H
76
字号

/*
file name:intsignal.h
function:handle the cpu relate signal
author :Einsn
date:2006-12-26



*/
#ifndef __INTSIGNAL_H_
#define __INTSIGNAL_H_

#include "typedefs.h"
#include "avr/signal.h"

#define SOFTTIMER   
#define TIMERHOOK  


/*
 * User Configuration, Hardware relation 
 * Can be modify by the specified CPU and application
 * 
 */

/*
 *
 *  the system timer0 interval in microsecond
 *
 */
#define TIMERINTERVAL  10  //ms


/*
 *
 *  interrupt handle
 *
 */
#define SIGTimerSignal()  SIGNAL(SIG_OUTPUT_COMPARE0)


/*
 * 
 * User interface
 *
 */

void SIGTimerInit(void);

#ifdef TIMERHOOK 
typedef void (*SIGNALHOOK)(void *);


int8 SIGTimerLoad(SIGNALHOOK SignalHook,void *pdata);
int8 SIGTimerRemove(SIGNALHOOK SignalHook,void *pdata);

#endif 


#ifdef SOFTTIMER
typedef  uint8  timerid;

timerid  SoftTimerAdd(uint16 isec);
void  SoftTimerRestart(timerid id,uint16 isec);
void  SoftTimerRestartMS(timerid id,uint16 isec);
void  SoftTimerRemove(timerid id);
uint8  SoftTimerTest(timerid id);
#endif 

#endif




⌨️ 快捷键说明

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