aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/STM32/LLD/RTCv2/rtc_lld.c
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/ports/STM32/LLD/RTCv2/rtc_lld.c')
-rw-r--r--os/hal/ports/STM32/LLD/RTCv2/rtc_lld.c81
1 files changed, 81 insertions, 0 deletions
diff --git a/os/hal/ports/STM32/LLD/RTCv2/rtc_lld.c b/os/hal/ports/STM32/LLD/RTCv2/rtc_lld.c
index 6e706e3c8..563e5ecc6 100644
--- a/os/hal/ports/STM32/LLD/RTCv2/rtc_lld.c
+++ b/os/hal/ports/STM32/LLD/RTCv2/rtc_lld.c
@@ -197,6 +197,84 @@ static uint32_t rtc_encode_date(const RTCDateTime *timespec) {
return dr;
}
+static size_t _write(void *instance, const uint8_t *bp, size_t n) {
+
+ (void)instance;
+ (void)bp;
+ (void)n;
+
+ return 0;
+}
+
+static size_t _read(void *instance, uint8_t *bp, size_t n) {
+
+ (void)instance;
+ (void)bp;
+ (void)n;
+
+ return 0;
+}
+
+static msg_t _put(void *instance, uint8_t b) {
+
+ (void)instance;
+ (void)b;
+
+ return FILE_OK;
+}
+
+static msg_t _get(void *instance) {
+
+ (void)instance;
+
+ return FILE_OK;
+}
+
+static msg_t _close(void *instance) {
+
+ /* Close is not supported.*/
+ (void)instance;
+
+ return FILE_OK;
+}
+
+static msg_t _geterror(void *instance) {
+
+ (void)instance;
+
+ return (msg_t)0;
+}
+
+static msg_t _getsize(void *instance) {
+
+ (void)instance;
+
+ return 0;
+}
+
+static msg_t _getposition(void *instance) {
+
+ (void)instance;
+
+ return 0;
+}
+
+static msg_t _lseek(void *instance, fileoffset_t offset) {
+
+ (void)instance;
+ (void)offset;
+
+ return FILE_OK;
+}
+
+/**
+ * @brief VMT for the RTC storage file interface.
+ */
+struct RTCDriverVMT _rtc_lld_vmt = {
+ _write, _read, _put, _get,
+ _close, _geterror, _getsize, _getposition, _lseek
+};
+
/*===========================================================================*/
/* Driver interrupt handlers. */
/*===========================================================================*/
@@ -212,6 +290,9 @@ static uint32_t rtc_encode_date(const RTCDateTime *timespec) {
*/
void rtc_lld_init(void) {
+ /* RTC object initialization.*/
+ rtcObjectInit(&RTCD1);
+
/* RTC pointer initialization.*/
RTCD1.rtc = RTC;