aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/templates/rtc_lld.h
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/templates/rtc_lld.h')
-rw-r--r--os/hal/templates/rtc_lld.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/os/hal/templates/rtc_lld.h b/os/hal/templates/rtc_lld.h
index 4b00cc72a..81bcc346f 100644
--- a/os/hal/templates/rtc_lld.h
+++ b/os/hal/templates/rtc_lld.h
@@ -36,6 +36,9 @@
/*===========================================================================*/
/**
+ * @name Implementation capabilities
+ */
+/**
* @brief Callback support int the driver.
*/
#define RTC_SUPPORTS_CALLBACKS PLATFORM_RTC_HAS_INTERRUPTS
@@ -44,6 +47,11 @@
* @brief Number of alarms available.
*/
#define RTC_ALARMS PLATFORM_RTC_NUM_ALARMS
+
+/**
+ * @brief Presence of a local persistent storage.
+ */
+#define RTC_HAS_STORAGE FALSE
/** @} */
/*===========================================================================*/
@@ -65,6 +73,12 @@
/*===========================================================================*/
/**
+ * @brief FileStream specific methods.
+ */
+#define _rtc_driver_methods \
+ _file_stream_methods
+
+/**
* @brief Type of an RTC alarm number.
*/
typedef uint32_t rtcalarm_t;
@@ -77,10 +91,27 @@ typedef struct {
uint32_t dummy;
} RTCAlarm;
+#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.*/
uint32_t dummy;
};
@@ -95,6 +126,9 @@ struct RTCDriver {
#if !defined(__DOXYGEN__)
extern RTCDriver RTCD1;
+#if RTC_HAS_STORAGE
+extern struct RTCDriverVMT _rtc_lld_vmt;
+#endif
#endif
#ifdef __cplusplus