clock.h

来自「制作AVR下在线」· C头文件 代码 · 共 25 行

H
25
字号
/* 
  clock.h - part of USBasp 
 
  Autor..........: Thomas Fischl   
  Description....: Provides functions for timing/waiting 
  Licence........: GNU GPL v2 (see Readme.txt) 
  Creation Date..: 2005-02-23 
  Last change....: 2006-11-16 
*/ 
 
#ifndef __clock_h_included__ 
#define	__clock_h_included__ 
 
#define F_CPU           12000000L   /* 12MHz */ 
#define TIMERVALUE      TCNT0 
#define CLOCK_T_320us	60 
 
#ifdef __AVR_ATmega8__ 
#define TCCR0B  TCCR0 
#endif 
 
/* set prescaler to 64 */ 
#define clockInit()  TCCR0B = (1 << CS01) | (1 << CS00); 
 
/* wait time * 320 us */ 

⌨️ 快捷键说明

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