diff options
author | barthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-12-11 20:05:55 +0000 |
---|---|---|
committer | barthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-12-11 20:05:55 +0000 |
commit | 9a52743e90152091c6cf1eabeee839c93948864c (patch) | |
tree | e362fa0f8950e9d7f7221936be2f33086dfd975d /os/hal/platforms/STM32F4xx/rtc_lld.h | |
parent | 4a5c4e2ae0098949ed614e22ae749620c730622f (diff) | |
download | ChibiOS-9a52743e90152091c6cf1eabeee839c93948864c.tar.gz ChibiOS-9a52743e90152091c6cf1eabeee839c93948864c.tar.bz2 ChibiOS-9a52743e90152091c6cf1eabeee839c93948864c.zip |
RTC. Setting and getting time works on STM32F4x
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/rtc_dev@3596 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/platforms/STM32F4xx/rtc_lld.h')
-rw-r--r-- | os/hal/platforms/STM32F4xx/rtc_lld.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/os/hal/platforms/STM32F4xx/rtc_lld.h b/os/hal/platforms/STM32F4xx/rtc_lld.h index 529215483..dd5a4160e 100644 --- a/os/hal/platforms/STM32F4xx/rtc_lld.h +++ b/os/hal/platforms/STM32F4xx/rtc_lld.h @@ -41,7 +41,7 @@ #define RTC_SUPPORTS_CALLBACKS TRUE
/**
- * @brief One alarm comparator available.
+ * @brief Two alarm comparators available on STM32F4x.
*/
#define RTC_ALARMS 2
@@ -62,6 +62,10 @@ #error "invalid source selected for RTC clock"
#endif
+#if RTC_SUPPORTS_CALLBACKS && !(HAL_USE_EXT)
+#error "interrupts from STM32 RTC works only through EXTI"
+#endif
+
/*===========================================================================*/
/* Driver data structures and types. */
/*===========================================================================*/
@@ -97,13 +101,18 @@ typedef void (*rtccb_t)(RTCDriver *rtcp, rtcevent_t event); */
struct RTCTime {
/**
- * @brief RTC date register in BCD format.
+ * @brief RTC date register in STM32 BCD format.
*/
uint32_t tv_date;
/**
- * @brief RTC time register in BCD format.
+ * @brief RTC time register in STM32 BCD format.
*/
uint32_t tv_time;
+ /**
+ * @brief Fractional part of time.
+ * @note If platform does not support subseconds than always zero.
+ */
+ uint16_t tv_msec;
};
@@ -112,7 +121,7 @@ struct RTCTime { */
struct RTCAlarm {
/**
- * @brief Date and time of alarm in BCD.
+ * @brief Date and time of alarm in STM32 BCD.
*/
uint32_t tv_datetime;
};
|