From b0a7b9e5cee167d2cb39901279d4340ab46db128 Mon Sep 17 00:00:00 2001 From: cfif Date: Tue, 23 Sep 2025 17:12:44 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=B0=D1=87=D0=B0=D0=BB=D0=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Inc/Rtc.h | 16 ++++++++++++++++ Src/Rtc.c | 22 ++++++++++++++++++++++ modular.json | 17 +++++++++++++++++ 3 files changed, 55 insertions(+) create mode 100644 Inc/Rtc.h create mode 100644 Src/Rtc.c create mode 100644 modular.json diff --git a/Inc/Rtc.h b/Inc/Rtc.h new file mode 100644 index 0000000..10b33cb --- /dev/null +++ b/Inc/Rtc.h @@ -0,0 +1,16 @@ +// +// Created by cfif on 11.09.22. +// + +#ifndef RTC_H +#define RTC_H + +#include "RtcIO.h" +#include + +uint16_t RtcGet(tRtcIO *io, time_t *timestamp); +uint16_t RtcSet(tRtcIO *io, time_t *timestamp); +uint16_t RtcGetTM(tRtcIO *io, struct tm *timestampTM); +uint16_t RtcSetTM(tRtcIO *io, struct tm *timestampTM); + +#endif //RTC_H diff --git a/Src/Rtc.c b/Src/Rtc.c new file mode 100644 index 0000000..1a9fa0c --- /dev/null +++ b/Src/Rtc.c @@ -0,0 +1,22 @@ +// +// Created by cfif on 17.11.22. +// + +#include "Rtc.h" +#include "SystemDelayInterface.h" + +uint16_t RtcSet(tRtcIO *io, time_t *timestamp) { + return io->set(io->env, timestamp); +} + +uint16_t RtcGet(tRtcIO *io, time_t *timestamp) { + return io->get(io->env, timestamp); +} + +uint16_t RtcSetTM(tRtcIO *io, struct tm *timestampTM) { + return io->setTM(io->env, timestampTM); +} + +uint16_t RtcGetTM(tRtcIO *io, struct tm *timestampTM) { + return io->getTM(io->env, timestampTM); +} \ No newline at end of file diff --git a/modular.json b/modular.json new file mode 100644 index 0000000..f232d63 --- /dev/null +++ b/modular.json @@ -0,0 +1,17 @@ +{ + "dep": [ + { + "type": "git", + "provider": "HVAC_DEV", + "repo": "RtcInterface" + } + ], + "cmake": { + "inc_dirs": [ + "Inc" + ], + "srcs": [ + "Src/**.c" + ] + } +} \ No newline at end of file