aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/platforms/STM32/RTCv2/rtc_lld.h
diff options
context:
space:
mode:
authorbarthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-12-13 09:03:41 +0000
committerbarthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-12-13 09:03:41 +0000
commit35ea7347004a31e1b850c41b60a3bf7457ed4418 (patch)
tree88e53a7f5fe1215c96a28da5d055f767ab9a5dab /os/hal/platforms/STM32/RTCv2/rtc_lld.h
parent27ab6ff1f19abb1cb4ee4c13a29e099a2c18209c (diff)
downloadChibiOS-35ea7347004a31e1b850c41b60a3bf7457ed4418.tar.gz
ChibiOS-35ea7347004a31e1b850c41b60a3bf7457ed4418.tar.bz2
ChibiOS-35ea7347004a31e1b850c41b60a3bf7457ed4418.zip
RTC. Added callback switch helper. Not tested.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3608 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/platforms/STM32/RTCv2/rtc_lld.h')
-rw-r--r--os/hal/platforms/STM32/RTCv2/rtc_lld.h36
1 files changed, 10 insertions, 26 deletions
diff --git a/os/hal/platforms/STM32/RTCv2/rtc_lld.h b/os/hal/platforms/STM32/RTCv2/rtc_lld.h
index 3780945c4..8e1b58f6b 100644
--- a/os/hal/platforms/STM32/RTCv2/rtc_lld.h
+++ b/os/hal/platforms/STM32/RTCv2/rtc_lld.h
@@ -48,11 +48,12 @@
#define RTC_ALARMS 2
/**
- * @brief EXTI channel numbers for different RTC events.
+ * @brief Interrupt enable masks.
*/
-#define STM32_RTC_ALARM_EXTI_CH 17
-#define STM32_RTC_TAMPER_TIMESTAMP_EXTI_CH 21
-#define STM32_RTC_WAKEUP_EXTI_CH 22
+#define ALARMA_INT 0x1
+#define ALARMB_INT 0x2
+#define WAKEUP_INT 0x4
+#define TIMESTAMP_INT 0x8
/*===========================================================================*/
/* Driver pre-compile time settings. */
@@ -112,11 +113,6 @@ typedef enum {
} rtcevent_t;
/**
- * @brief Type of a generic RTC callback.
- */
-typedef void (*rtccb_t)(RTCDriver *rtcp, rtcevent_t event);
-
-/**
* @brief Structure representing an RTC time stamp.
*/
struct RTCTime {
@@ -130,9 +126,10 @@ struct RTCTime {
uint32_t tv_time;
/**
* @brief Fractional part of time.
- * @note If platform does not support subseconds than always zero.
*/
+#if STM32_RTC_HAS_SUBSECONDS
uint32_t tv_msec;
+#endif
};
/**
@@ -163,20 +160,7 @@ struct RTCWakeup {
* @brief Structure representing an RTC callbacks config.
*/
struct RTCCallbackConfig{
-#if RTC_SUPPORTS_CALLBACKS
- /**
- * @brief Alarm callback pointer.
- */
- rtccb_t alarm_cb;
- /**
- * @brief Tamper or TimeStamp callback pointer.
- */
- rtccb_t tamper_timestapm_cb;
- /**
- * @brief Periodic wakeup callback pointer.
- */
- rtccb_t wakeup_cb;
-#endif /* RTC_SUPPORTS_CALLBACKS */
+ uint32_t cb_cfg;
};
/**
@@ -188,9 +172,9 @@ struct RTCDriver{
*/
RTC_TypeDef *id_rtc;
/**
- * @brief Current configuration data.
+ * @brief Current callback confuguration.
*/
- const RTCCallbackConfig *cb_config;
+ const RTCCallbackConfig *cb_cfg;
};
/*===========================================================================*/