-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclock.h
More file actions
28 lines (22 loc) · 699 Bytes
/
clock.h
File metadata and controls
28 lines (22 loc) · 699 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
* clock.h - part of USBasp
*
* Autor..........: Thomas Fischl <tfischl@gmx.de>
* 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 20000000L /* 12MHz */
#define TIMERVALUE TCNT0
#define CLOCK_T_320us 100 //???????????????????
#ifdef __AVR_ATmega8__
#define TCCR0B TCCR0
#endif
/* set prescaler to 64 */
#define clockInit() TCCR0B = (1 << CS01) | (1 << CS00);
/* wait time * 320 us */
void clockWait(uint8_t time);
#endif /* __clock_h_included__ */