00001
00002
00003
00004
00005
00006
00007
00008 #ifndef __timepiece_h
00009 #define __timepiece_h
00010
00011 #include <system/config.h>
00012 #include <rtc.h>
00013
00014 __BEGIN_SYS
00015
00016 class Clock
00017 {
00018 private:
00019 typedef Traits<Clock> Traits;
00020 static const Type_Id TYPE = Type<Clock>::TYPE;
00021
00022 typedef RTC::Microseconds Microseconds;
00023 typedef RTC::Seconds Seconds;
00024
00025 public:
00026
00027
00028 Clock() {}
00029 ~Clock() {}
00030
00031
00032
00033
00034 Microseconds resolution() { return 1000000; }
00035
00036 Seconds now() { RTC rtc; return rtc.read(); }
00037
00038 static int init(System_Info * si);
00039 };
00040
00041 __END_SYS
00042
00043 #endif