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