]> git.sur5r.net Git - freertos/blob - Demo/Common/ethernet/FreeRTOS-uIP/clock.h
Start to re-arrange files to include FreeRTOS+ in main download.
[freertos] / Demo / Common / ethernet / FreeRTOS-uIP / clock.h
1 /**\r
2  * \defgroup clock Clock interface\r
3  *\r
4  * The clock interface is the interface between the \ref timer "timer library"\r
5  * and the platform specific clock functionality. The clock\r
6  * interface must be implemented for each platform that uses the \ref\r
7  * timer "timer library".\r
8  *\r
9  * The clock interface does only one this: it measures time. The clock\r
10  * interface provides a macro, CLOCK_SECOND, which corresponds to one\r
11  * second of system time.\r
12  *\r
13  * \sa \ref timer "Timer library"\r
14  *\r
15  * @{\r
16  */\r
17 \r
18 /*\r
19  * Copyright (c) 2004, Swedish Institute of Computer Science.\r
20  * All rights reserved.\r
21  *\r
22  * Redistribution and use in source and binary forms, with or without\r
23  * modification, are permitted provided that the following conditions\r
24  * are met:\r
25  * 1. Redistributions of source code must retain the above copyright\r
26  *    notice, this list of conditions and the following disclaimer.\r
27  * 2. Redistributions in binary form must reproduce the above copyright\r
28  *    notice, this list of conditions and the following disclaimer in the\r
29  *    documentation and/or other materials provided with the distribution.\r
30  * 3. Neither the name of the Institute nor the names of its contributors\r
31  *    may be used to endorse or promote products derived from this software\r
32  *    without specific prior written permission.\r
33  *\r
34  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND\r
35  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
36  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
37  * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE\r
38  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r
39  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\r
40  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\r
41  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\r
42  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\r
43  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\r
44  * SUCH DAMAGE.\r
45  *\r
46  * This file is part of the uIP TCP/IP stack\r
47  *\r
48  * Author: Adam Dunkels <adam@sics.se>\r
49  *\r
50  * $Id: clock.h,v 1.3 2006/06/11 21:46:39 adam Exp $\r
51  */\r
52 #ifndef __CLOCK_H__\r
53 #define __CLOCK_H__\r
54 \r
55 #include "clock-arch.h"\r
56 \r
57 /**\r
58  * Initialize the clock library.\r
59  *\r
60  * This function initializes the clock library and should be called\r
61  * from the main() function of the system.\r
62  *\r
63  */\r
64 void clock_init(void);\r
65 \r
66 /**\r
67  * Get the current clock time.\r
68  *\r
69  * This function returns the current system clock time.\r
70  *\r
71  * \return The current clock time, measured in system ticks.\r
72  */\r
73 clock_time_t clock_time(void);\r
74 \r
75 /**\r
76  * A second, measured in system clock time.\r
77  *\r
78  * \hideinitializer\r
79  */\r
80 #ifdef CLOCK_CONF_SECOND\r
81 #define CLOCK_SECOND CLOCK_CONF_SECOND\r
82 #else\r
83 #define CLOCK_SECOND (clock_time_t)32\r
84 #endif\r
85 \r
86 #endif /* __CLOCK_H__ */\r
87 \r
88 /** @} */\r