timers.h

来自「WWVB receiver using AVR.」· C头文件 代码 · 共 34 行

H
34
字号
/* $Id: timers.h,v 1.2 2005/04/16 11:52:45 simimeie Exp $ * Functions that work with the avrs timer(s). * Mainly a function that allows you to get sort of a timestamp. */ #ifndef _TIMERS_H_#define _TIMERS_H_/* This value can be used for turning "ticks" into "seconds" */#define TICKSPERSECOND ((uint16_t)(CPUFREQ / 16384UL))struct tickdata {	uint16_t seconds;	uint16_t ticks;};void timers_init(void);void gettickdata(struct tickdata * td);/* For lower resolution (only the seconds), you can use this instead */uint16_t getseconds(void);/* This should only be called by the DCF module */void timers_zero(void);#ifdef HIGHRESTIMER#define HIGHRESTICKSPERSECOND (CPUFREQ / 1024UL)/* The highres timer counts 64 times as fast as the normal timer. * It has to be started with starthighrestimer and will implicitly be stopped * again if it overflows or is read with readhighrestimer. */void starthighrestimer(void);uint16_t readhighrestimer(void);#endif#endif

⌨️ 快捷键说明

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