Beam-lib  2.16.3
This is the Beam C++ class library.
BRtc.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * BRtc.h Real Time Clock interface
3  * T.Barnaby, BEAM Ltd, 19/5/04
4  * Copyright (c) 2012 All Right Reserved, Beam Ltd, http://www.beam.ltd.uk
5  *******************************************************************************
6  */
7 #ifndef BRTC_H
8 #define BRTC_H
9 
10 #include <BError.h>
11 #include <BThread.h>
12 #include <BCond.h>
13 
15 class BRtc {
16 public:
17  BRtc();
18  ~BRtc();
19 
20  BError init(int rate);
21  void wait(int delayUs);
22 private:
23  int ofd;
24  int orate;
25 };
26 
28 class BRtcThreaded : private BThread {
29 public:
30  BRtcThreaded();
31  ~BRtcThreaded();
32 
33  BError init(int rate);
34  void wait(int delayUs);
35 private:
36  void* function();
37  BRtc ortc;
38  int orate;
39  BCond ocond;
40 };
41 #endif
BError init(int rate)
Setup interrupt rate.
Definition: BRtc.cpp:61
BRtc()
Definition: BRtc.cpp:16
~BRtc()
Definition: BRtc.cpp:21
Threaded real time clock.
Definition: BRtc.h:28
Definition: BCond.h:12
BRtcThreaded()
Definition: BRtc.cpp:54
void wait(int delayUs)
Wait specified uS.
Definition: BRtc.cpp:42
BError init(int rate)
Setup interrupt rate.
Definition: BRtc.cpp:26
void delayUs(BUInt us)
Will delay for given time in us, if tasks running task will sleep.
Definition: BSys.cpp:13
Definition: BError.h:25
void wait(int delayUs)
Wait specified uS.
Definition: BRtc.cpp:81
Definition: BThread.h:12
~BRtcThreaded()
Definition: BRtc.cpp:58
Realtime clock.
Definition: BRtc.h:15