aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/STM32/LLD/RTCv2/rtc_lld.h
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/ports/STM32/LLD/RTCv2/rtc_lld.h')
-rw-r--r--os/hal/ports/STM32/LLD/RTCv2/rtc_lld.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/os/hal/ports/STM32/LLD/RTCv2/rtc_lld.h b/os/hal/ports/STM32/LLD/RTCv2/rtc_lld.h
index 2c6c5509b..6d86f68a5 100644
--- a/os/hal/ports/STM32/LLD/RTCv2/rtc_lld.h
+++ b/os/hal/ports/STM32/LLD/RTCv2/rtc_lld.h
@@ -36,6 +36,9 @@
/*===========================================================================*/
/**
+ * @name Implementation capabilities
+ */
+/**
* @brief Callback support int the driver.
*/
#define RTC_SUPPORTS_CALLBACKS STM32_RTC_HAS_INTERRUPTS
@@ -46,6 +49,12 @@
#define RTC_ALARMS STM32_RTC_NUM_ALARMS
/**
+ * @brief Presence of a local persistent storage.
+ */
+#define RTC_HAS_STORAGE TRUE
+/** @} */
+
+/**
* @brief RTC PRER register initializer.
*/
#define RTC_PRER(a, s) ((((a) - 1) << 16) | ((s) - 1))
@@ -123,6 +132,12 @@
/*===========================================================================*/
/**
+ * @brief FileStream specific methods.
+ */
+#define _rtc_driver_methods \
+ _file_stream_methods
+
+/**
* @brief Type of an RTC alarm number.
*/
typedef uint32_t rtcalarm_t;
@@ -150,10 +165,28 @@ typedef struct {
} RTCWakeup;
#endif
+#if RTC_HAS_STORAGE || defined(__DOXYGEN__)
+/**
+ * @extends FileStream
+ *
+ * @brief @p RTCDriver virtual methods table.
+ */
+struct RTCDriverVMT {
+ _rtc_driver_methods
+};
+#endif
+
/**
* @brief Structure representing an RTC driver.
*/
struct RTCDriver {
+#if RTC_HAS_STORAGE || defined(__DOXYGEN__)
+ /**
+ * @brief Virtual Methods Table.
+ */
+ const struct RTCDriverVMT *vmt;
+#endif
+ /* End of the mandatory fields.*/
/**
* @brief Pointer to the RTC registers block.
*/
@@ -170,6 +203,9 @@ struct RTCDriver {
#if !defined(__DOXYGEN__)
extern RTCDriver RTCD1;
+#if RTC_HAS_STORAGE
+extern struct RTCDriverVMT _rtc_lld_vmt;
+#endif
#endif
#ifdef __cplusplus