|
0
|
1 #ifndef CYGONCE_DEVS_WALLCLOCK_HXX |
|
|
2 #define CYGONCE_DEVS_WALLCLOCK_HXX |
|
|
3 |
|
|
4 //========================================================================== |
|
|
5 // |
|
2
|
6 // wallclock.hxx |
|
0
|
7 // |
|
2
|
8 // Wallclock interface declaration |
|
0
|
9 // |
|
|
10 //========================================================================== |
|
|
11 //####COPYRIGHTBEGIN#### |
|
|
12 // |
|
|
13 // ------------------------------------------- |
|
|
14 // The contents of this file are subject to the Cygnus eCos Public License |
|
|
15 // Version 1.0 (the "License"); you may not use this file except in |
|
|
16 // compliance with the License. You may obtain a copy of the License at |
|
|
17 // http://sourceware.cygnus.com/ecos |
|
|
18 // |
|
|
19 // Software distributed under the License is distributed on an "AS IS" |
|
|
20 // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the |
|
|
21 // License for the specific language governing rights and limitations under |
|
|
22 // the License. |
|
|
23 // |
|
|
24 // The Original Code is eCos - Embedded Cygnus Operating System, released |
|
|
25 // September 30, 1998. |
|
|
26 // |
|
|
27 // The Initial Developer of the Original Code is Cygnus. Portions created |
|
2
|
28 // by Cygnus are Copyright (C) 1998,1999 Cygnus Solutions. All Rights Reserved. |
|
0
|
29 // ------------------------------------------- |
|
|
30 // |
|
|
31 //####COPYRIGHTEND#### |
|
|
32 //========================================================================== |
|
|
33 //#####DESCRIPTIONBEGIN#### |
|
|
34 // |
|
2
|
35 // Author(s): nickg |
|
|
36 // Contributors: nickg |
|
|
37 // Date: 1999-03-05 |
|
|
38 // Purpose: Wall Clock declarations |
|
|
39 // Description: This file defines the interface to the wall clock device |
|
|
40 // that provides real time stamps. This is either an interface |
|
|
41 // to a hardware RTC like the Dallas DS12887, or it is emulated |
|
|
42 // using the kernel clock. |
|
|
43 // Usage: #include <cyg/devs/wallclock.hxx> |
|
0
|
44 // |
|
|
45 //####DESCRIPTIONEND#### |
|
|
46 // |
|
|
47 //========================================================================== |
|
|
48 |
|
2
|
49 #include <cyg/infra/cyg_type.h> |
|
0
|
50 |
|
|
51 // ------------------------------------------------------------------------- |
|
|
52 // Wallclock class |
|
|
53 |
|
|
54 class Cyg_WallClock |
|
|
55 { |
|
|
56 |
|
|
57 public: |
|
|
58 |
|
|
59 Cyg_WallClock(); |
|
|
60 |
|
|
61 // Returns the current timestamp. This may involve reading the |
|
|
62 // hardware, so it may take anything up to a second to complete. |
|
|
63 cyg_uint32 get_current_time(); |
|
|
64 |
|
|
65 // Sets the value of the timestamp relative to now. This may involve |
|
|
66 // writing to the hardware, so it may take anything up to a second to |
|
|
67 // complete. |
|
|
68 void set_current_time( cyg_uint32 time_stamp ); |
|
|
69 |
|
|
70 // A static pointer to the single system defined wall clock device. |
|
|
71 static Cyg_WallClock *wallclock; |
|
|
72 |
|
|
73 }; |
|
|
74 |
|
|
75 // ------------------------------------------------------------------------- |
|
|
76 |
|
|
77 #endif // ifndef CYGONCE_DEVS_WALLCLOCK_HXX |
|
|
78 // EOF wallclock.hxx |