Si-Labs EFM32 back up domain and BUrtc library

Dependents:   EFM32_BUrtc-Demo

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers BUrtc.h Source File

BUrtc.h

00001 #ifndef __BUrtc_H
00002 #define __BUrtc_H
00003 
00004 #include "mbed.h"
00005 #include "em_emu.h"
00006 #include "em_rmu.h"
00007 #include "em_burtc.h"
00008 
00009 #define UINT32_MAX       4294967295UL
00010 
00011 /* This variables must reflect BURTC frequency */
00012 #define COUNTS_PER_SEC (32768/128)
00013 /* Clock defines */
00014 #define LFXO_FREQUENCY 32768
00015 #define BURTC_PRESCALING 128
00016 #define UPDATE_INTERVAL 1
00017 //#define COUNTS_PER_SEC (LFXO_FREQUENCY/BURTC_PRESCALING)
00018 #define COUNTS_BETWEEN_UPDATE (UPDATE_INTERVAL*COUNTS_PER_SEC)
00019 
00020 
00021 void BUrtcInit(void);
00022 void budSetup(void);
00023 void burtcSetup(void);
00024 void RTCset(int seconds);
00025 void RTCrestore(void);
00026 void BURTC_IRQHandler(void);
00027 void BUrtcBackup(void);
00028 
00029 static int burtcCount;
00030 static int burtcOverflowCounter;
00031 static int burtcOverflowIntervalRem;
00032 static int burtcTimestamp;
00033 static int rtcStartTime;
00034 static int rtcOverflowCounter;
00035 static int overflow_interval;
00036 static int overflow_interval_r;
00037 
00038 static int trtc;
00039 static int lcdUpdate;
00040 static int resetcause;
00041 
00042 #endif