RTC au principal
This commit is contained in:
parent
a27c7040ce
commit
8a8a0b650c
2 changed files with 20 additions and 0 deletions
8
Pilotes/Include/RTC.h
Normal file
8
Pilotes/Include/RTC.h
Normal 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
12
Services/Source/RTC.c
Normal 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);
|
||||
}
|
||||
|
||||
Loading…
Reference in a new issue