2 * clock.h - part of USBasp
4 * Autor..........: Thomas Fischl <tfischl@gmx.de>
5 * Description....: Provides functions for timing/waiting
6 * Licence........: GNU GPL v2 (see Readme.txt)
7 * Creation Date..: 2005-02-23
8 * Last change....: 2006-11-16
11 #ifndef __clock_h_included__
12 #define __clock_h_included__
15 #define F_CPU 12000000L /* 12MHz */
17 #define TIMERVALUE TCNT0
18 #define CLOCK_T_320us (320 * (F_CPU/1000000L) / 64)
20 #ifdef __AVR_ATmega8__
24 /* set prescaler to 64 */
25 #define clockInit() TCCR0B = (1 << CS01) | (1 << CS00);
27 /* wait time * 320 us */
28 void clockWait(uint8_t time
);
30 #endif /* __clock_h_included__ */