EVShield  v1.3
EVShield Library Reference by mindsensors.com
EVs_RTC.h
1 
2 // EVs_RTC.h
3 // This is a class for reading from Real-time Clock, made by Mindsensors.
4 // See http://www.mindsensors.com/index.php?module=pagemaster&PAGE_user_op=view_page&PAGE_id=101
5 
6 // Initial version: 2010-06-10 by Andrew Sylvester
7 // Modified for EVShield: 2015-02-16 by Michael Giles
8 // Large parts of the code is ported from the NXC library for the device,
9 // written by Deepak Patil.
10 
11 /*
12  This library is free software; you can redistribute it and/or
13  modify it under the terms of the GNU Lesser General Public
14  License as published by the Free Software Foundation; either
15  version 2.1 of the License, or (at your option) any later version.
16 
17  This library is distributed in the hope that it will be useful,
18  but WITHOUT ANY WARRANTY; without even the implied warranty of
19  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20  Lesser General Public License for more details.
21 
22  You should have received a copy of the GNU Lesser General Public
23  License along with this library; if not, write to the Free Software
24  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 */
26 
27 
28 #ifndef EVs_RTC_H
29 #define EVs_RTC_H
30 
31 #define RTC_Seconds 0x00
32 #define RTC_Minutes 0x01
33 #define RTC_Hours 0x02
34 #define RTC_Day_of_Week 0x03
35 #define RTC_Day_of_Month 0x04
36 #define RTC_Month 0x05
37 #define RTC_Year 0x06
38 
39 #include "EVShieldI2C.h"
40 
44 class EVs_RTC : public EVShieldI2C
45 {
46 public:
48  EVs_RTC(uint8_t i2c_address = 0xD0);
49 
51  uint8_t getSeconds();
52 
54  uint8_t getMinutes();
55 
57  uint8_t getHours();
58 
60  uint8_t getDayWeek();
61 
63  uint8_t getDayMonth();
64 
66  uint8_t getMonth();
67 
69  uint8_t getYear();
70 
71 private:
72  uint8_t BCDToInteger(uint8_t b);
73 
74 };
75 
76 #endif /* RTC_H_ */
EVs_RTC(uint8_t i2c_address=0xD0)
Definition: EVs_RTC.cpp:32
uint8_t getYear()
Definition: EVs_RTC.cpp:74
uint8_t getSeconds()
Definition: EVs_RTC.cpp:44
uint8_t getDayWeek()
Definition: EVs_RTC.cpp:59
uint8_t getHours()
Definition: EVs_RTC.cpp:54
This class implements I2C interfaces used by EVShield.
Definition: EVShieldI2C.h:32
This class interfaces with RTC attached to EVShield.
Definition: EVs_RTC.h:44
uint8_t getDayMonth()
Definition: EVs_RTC.cpp:64
uint8_t getMonth()
Definition: EVs_RTC.cpp:69
uint8_t getMinutes()
Definition: EVs_RTC.cpp:49