~ubuntu-branches/ubuntu/breezy/avr-libc/breezy

« back to all changes in this revision

Viewing changes to include/timer.h

  • Committer: Bazaar Package Importer
  • Author(s): Hakan Ardo
  • Date: 2002-04-15 14:53:38 UTC
  • Revision ID: james.westby@ubuntu.com-20020415145338-c8hi0tn5bx74w7o3
Tags: upstream-20020203
ImportĀ upstreamĀ versionĀ 20020203

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef _TIMER_H_
 
2
#define _TIMER_H_
 
3
 
 
4
#include <io.h>
 
5
 
 
6
#ifdef __cplusplus
 
7
extern "C" {
 
8
#endif
 
9
 
 
10
enum {
 
11
  STOP             = 0,
 
12
  CK               = 1,
 
13
  CK8              = 2,
 
14
  CK64             = 3,
 
15
  CK256            = 4,
 
16
  CK1024           = 5,
 
17
  T0_FALLING_EDGE  = 6,
 
18
  T0_RISING_EDGE   = 7
 
19
};
 
20
 
 
21
static inline void timer0_source (unsigned int src)
 
22
{
 
23
  outb (src, TCCR0);
 
24
}
 
25
 
 
26
static inline void timer0_stop (void)
 
27
{
 
28
  outb (0, TCNT0);
 
29
}
 
30
 
 
31
static inline void timer0_start (void)
 
32
{
 
33
  outb (0x1, TCNT0);
 
34
}
 
35
 
 
36
#ifdef __cplusplus
 
37
}
 
38
#endif
 
39
 
 
40
#endif /* _TIMER_H_ */