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.
Diff: rtc.h
- Revision:
- 0:397b5462e6d7
diff -r 000000000000 -r 397b5462e6d7 rtc.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/rtc.h Thu Nov 15 06:55:25 2018 +0000
@@ -0,0 +1,56 @@
+/***********************************
+name: rtc.h Version: 0.1
+author: PE HTL BULME
+email: pe@bulme.at
+description:
+ Definition portion of the class rtc
+
+
+***********************************/
+
+#include "mbed.h"
+#include "const.h"
+
+#if !defined (RTC_H)
+#define RTC_H
+
+/** RTC Class
+ */
+
+ /**
+name: rtc.h Version: 0.1
+author: PE HTL BULME
+email: pe@bulme.at
+description:
+ Definition portion of the class rtc
+
+
+***********************************/
+class RTC
+{
+protected:
+ //PinName _sda, _scl;
+#ifdef TARGET_LPC11XX
+ I2C i2c; /**< I2C definition */
+#endif
+ char week_val;
+
+ /**
+ protected methodes for internal purposes only
+ */
+ void error(); /**< Error: stops and all LEDs are blinking*/
+
+public:
+ /** Create a RTC object connected to the specified pin
+ * @param pin sda/scl pin to connect to
+ */
+ RTC(); /**< default constructor; sda(p28), sdc(p27) */
+ RTC(PinName sda, PinName scl); /**< parameterized constructor with sda-pin, sdc-pin)*/
+ ~RTC();
+ char rtc_read(char address); /**< read value from I2C bus; ToDo --> Error()*/
+ void rtc_write(char address, char value); /**< write value to I2C bus; ToDo --> Error()*/
+ void rtc_init(); /**< initialize the RTC to a given date and time; ToDo --> Error()*/
+ void rtc_alarm();
+};
+
+#endif
\ No newline at end of file