RTC au principal

This commit is contained in:
Oskar Orvik 2025-12-16 17:52:19 +01:00
parent a27c7040ce
commit 8a8a0b650c
2 changed files with 20 additions and 0 deletions

8
Pilotes/Include/RTC.h Normal file
View file

@ -0,0 +1,8 @@
#ifndef RTC_H_
#define RTC_H_
#include <stm32f10x.h>
initRTC();
int getTime();
#endif // RTC_H_

12
Services/Source/RTC.c Normal file
View file

@ -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);
}