aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/include
diff options
context:
space:
mode:
authorbarthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-11-01 15:44:30 +0000
committerbarthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-11-01 15:44:30 +0000
commitd37f6cb1f3cac35b1f7f7373062fddb638707570 (patch)
treee81bc626c722cd995fae688f8605a23e5db1aecc /os/hal/include
parent96f976382d7b94911dac7bea9477b3e2bc560408 (diff)
downloadChibiOS-d37f6cb1f3cac35b1f7f7373062fddb638707570.tar.gz
ChibiOS-d37f6cb1f3cac35b1f7f7373062fddb638707570.tar.bz2
ChibiOS-d37f6cb1f3cac35b1f7f7373062fddb638707570.zip
RTCv1. Time converstion functions moved to rtc.c(h). Chrtclib deleted.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7443 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/include')
-rw-r--r--os/hal/include/rtc.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/os/hal/include/rtc.h b/os/hal/include/rtc.h
index a775ec570..a0f02b502 100644
--- a/os/hal/include/rtc.h
+++ b/os/hal/include/rtc.h
@@ -87,8 +87,20 @@
*/
typedef struct RTCDriver RTCDriver;
-#include "chrtclib.h"
+/**
+ * @brief Type of a structure representing an RTC date/time stamp.
+ */
+typedef struct {
+ uint32_t year: 8; /**< @brief Years since 1980. */
+ uint32_t month: 4; /**< @brief Months 1..12. */
+ uint32_t dstflag: 1; /**< @brief DST correction flag. */
+ uint32_t dayofweek: 3; /**< @brief Day of week 1..7. */
+ uint32_t day: 5; /**< @brief Day of the month 1..31. */
+ uint32_t millisecond: 27; /**< @brief Milliseconds since midnight.*/
+} RTCDateTime;
+
#include "rtc_lld.h"
+#include <time.h>
/*===========================================================================*/
/* Driver macros. */
@@ -113,6 +125,11 @@ extern "C" {
#if RTC_SUPPORTS_CALLBACKS
void rtcSetCallback(RTCDriver *rtcp, rtccb_t callback);
#endif
+ void rtcConvertDateTimeToStructTm(const RTCDateTime *timespec,
+ struct tm *timp);
+ void rtcConvertStructTmToDateTime(const struct tm *timp,
+ uint32_t tv_msec, RTCDateTime *timespec);
+ uint32_t rtcConvertDateTimeToFAT(const RTCDateTime *timespec);
#ifdef __cplusplus
}
#endif