Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: Detektor_Pokreta Dino_Martic_Programski
Diff: Rtc_Ds1307.h
- Revision:
- 6:bba89618ee63
- Parent:
- 5:30531f2121a2
- Child:
- 7:dca20be3ef38
diff -r 30531f2121a2 -r bba89618ee63 Rtc_Ds1307.h
--- a/Rtc_Ds1307.h Sun Jun 23 17:02:21 2013 +0000
+++ b/Rtc_Ds1307.h Sun Jun 23 18:26:47 2013 +0000
@@ -24,6 +24,15 @@
#define __RTC_DS1307_H__
+/** Class Rtc_Ds1307 implements the real time clock module DS1307
+ *
+ * You can read the clock and set a new time and date.
+ * It is also possible to start and stop the clock.
+ * Rtc_Ds1307 allows you to display the time in a 12h or 24h format
+ */
+class Rtc_Ds1307
+{
+
/** Structure which is used to exchange the time and date
*/
typedef struct {
@@ -44,15 +53,6 @@
RS8kHz = 2,
RS32kHz = 3
} SqwRateSelect_t;
-
-/** Class Rtc_Ds1307 implements the real time clock module DS1307
- *
- * You can read the clock and set a new time and date.
- * It is also possible to start and stop the clock.
- * Rtc_Ds1307 allows you to display the time in a 12h or 24h format
- */
-class Rtc_Ds1307
-{
I2C* m_rtc;
static const char *m_weekDays[];
@@ -75,7 +75,7 @@
*
* @returns true if successful, otherwise an acknowledge error occured
*/
- bool getTime(Time_rtc& time);
+ virtual bool getTime(Time_rtc& time);
/** Write the given time onto the RTC chip
*
@@ -87,7 +87,7 @@
*
* @returns true if successful, otherwise an acknowledge error occured
*/
- bool setTime(Time_rtc& time, bool start, bool thm);
+ virtual bool setTime(Time_rtc& time, bool start, bool thm);
/** Start the clock. Please note that the seconds register need to be read and
* written in order to start or stop the clock. This can lead to an error
@@ -139,6 +139,4 @@
};
-
-
#endif // __RTC_DS1307_H__
\ No newline at end of file