aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/templates
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-11-27 15:07:26 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-11-27 15:07:26 +0000
commite40082e1d66e963a16ef36ad2231dd40b56bdf7c (patch)
treedf6ff561cedc5c66ffaf6416f6ac9bd65b2b7d28 /os/hal/templates
parent5e580ea5724dda947be738bf22f1f47adfb6feee (diff)
downloadChibiOS-e40082e1d66e963a16ef36ad2231dd40b56bdf7c.tar.gz
ChibiOS-e40082e1d66e963a16ef36ad2231dd40b56bdf7c.tar.bz2
ChibiOS-e40082e1d66e963a16ef36ad2231dd40b56bdf7c.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7543 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/templates')
-rw-r--r--os/hal/templates/rtc_lld.c2
-rw-r--r--os/hal/templates/rtc_lld.h34
2 files changed, 36 insertions, 0 deletions
diff --git a/os/hal/templates/rtc_lld.c b/os/hal/templates/rtc_lld.c
index 11ca5d4e4..b63684699 100644
--- a/os/hal/templates/rtc_lld.c
+++ b/os/hal/templates/rtc_lld.c
@@ -66,6 +66,8 @@ RTCDriver RTCD1;
*/
void rtc_lld_init(void) {
+ /* RTC object initialization.*/
+ rtcObjectInit(&RTCD1);
}
/**
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