f6b725a3d79edf0003bb3552224bf62f1eae967d
[bertos.git] / drv / timer_posix.h
1 /**
2  * \file
3  * <!--
4  * Copyright 2005 Develer S.r.l. (http://www.develer.com/)
5  * This file is part of DevLib - See README.devlib for information.
6  * -->
7  *
8  * \version $Id$
9  *
10  * \author Bernardo Innocenti <bernie@develer.com>
11  *
12  * \brief Low-level timer module for POSIX systems (interface).
13  */
14
15 /*#*
16  *#* $Log$
17  *#* Revision 1.4  2006/07/19 12:56:26  bernie
18  *#* Convert to new Doxygen style.
19  *#*
20  *#* Revision 1.3  2006/02/23 11:03:33  bernie
21  *#* Documentation fix.
22  *#*
23  *#* Revision 1.2  2006/02/21 21:28:02  bernie
24  *#* New time handling based on TIMER_TICKS_PER_SEC to support slow timers with ticks longer than 1ms.
25  *#*
26  *#* Revision 1.1  2005/11/27 03:58:18  bernie
27  *#* Add POSIX timer emulator.
28  *#*
29  *#* Revision 1.1  2005/11/27 03:06:36  bernie
30  *#* Qt timer emulation.
31  *#*
32  *#*/
33 #ifndef DRV_TIMER_POSIX_H
34 #define DRV_TIMER_POSIX_H
35
36 // HW dependent timer initialization
37
38 #define DEFINE_TIMER_ISR     void timer_isr(UNUSED_ARG(int, arg))
39
40 /** Most Linux kernels can't do better than this (CONFIG_HZ=250). */
41 #define TIMER_TICKS_PER_SEC  250
42
43 #define TIMER_HW_CNT         (1<<31) /* We assume 32bit integers here */
44
45 #include <os/hptime.h>
46
47 /// Frequency of the hardware high-precision timer.
48 #define TIMER_HW_HPTICKS_PER_SEC  HPTIME_TICKS_PER_SECOND
49
50 /// Not needed.
51 #define timer_hw_irq() do {} while (0)
52
53
54 #endif /* DRV_TIMER_QT_H */