From 8a8a0b650c5457181b811ef57905f780b9435a27 Mon Sep 17 00:00:00 2001 From: Oskar Date: Tue, 16 Dec 2025 17:52:19 +0100 Subject: [PATCH] RTC au principal --- Pilotes/Include/RTC.h | 8 ++++++++ Services/Source/RTC.c | 12 ++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 Pilotes/Include/RTC.h create mode 100644 Services/Source/RTC.c diff --git a/Pilotes/Include/RTC.h b/Pilotes/Include/RTC.h new file mode 100644 index 0000000..c6677c2 --- /dev/null +++ b/Pilotes/Include/RTC.h @@ -0,0 +1,8 @@ +#ifndef RTC_H_ +#define RTC_H_ +#include +initRTC(); +int getTime(); + + +#endif // RTC_H_ diff --git a/Services/Source/RTC.c b/Services/Source/RTC.c new file mode 100644 index 0000000..ee9b83f --- /dev/null +++ b/Services/Source/RTC.c @@ -0,0 +1,12 @@ +#include "RTC.h" + +initRTC(){ + RTC -> PRLL = 0x7FFF; // Obtenir un période de 1 seconde + RTC -> PRLH = 0xFFFF; // Le plus grand possible + +} + +int getTime(){ + return(RTC -> PRLH); +} +