-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRV8564C2.h
executable file
·68 lines (58 loc) · 2.83 KB
/
RV8564C2.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA *
* *
***************************************************************************
* *
* (c) Copyright, 1997-2012, ANSR *
* *
***************************************************************************
* *
* Filename: RV8564C2.h *
* *
***************************************************************************/
#ifndef RV8564C2_H
#define RV8564C2_H
/**
* @defgroup external External Peripherals
*
* @{
*/
/**
* Control the Micro Crystal Real Time Clock. The RV-8564-C2 is a CMOS
* real-time clock/calendar optimized for low power consumption.
*/
class RV8564C2 : public RTCBase
{
public:
const RTCTime *GetTime();
bool_t IsAlarm();
bool_t IsLowPower();
void EnableAlarm(const RTCTime *alarm);
void SetTime(const RTCTime *time);
void SetTime(const GPSData *gps);
static RV8564C2 *GetInstance();
private:
/// Control register - Stop bit.
static const uint32_t CONTROL1_STOP = (1 << 5);
/// Control register -
static const uint32_t CONTROL2_AIE = (1 << 1);
/// Control register -
static const uint32_t CONTROL2_AF = (1 << 3);
/// Alarm register -
static const uint32_t ALARM_AD = (1 << 7);
};
/** @} */
#endif // #ifndef RV8564C2_H