Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Clock.h
00001 #pragma once 00002 00003 #include <string> 00004 #include "WakeUp.h" 00005 00006 #define RCC_PLL_TIMEOUT_VALUE ((uint32_t)2U) /* 2 ms (minimum Tick + 1) */ 00007 00008 class Clock{ 00009 private: 00010 Clock(); 00011 ~Clock(); 00012 Clock(Clock const&); 00013 void operator=(Clock const&); 00014 uint32_t prediv_s; 00015 bool hibernate; 00016 public: 00017 static const uint32_t SECONDS_IN_A_DAY = 3600 * 24; 00018 00019 static Clock* getInstance(); 00020 00021 time_t getUnixTime(); 00022 uint32_t getMilliSeconds(); 00023 const struct tm* getTmStruct(); 00024 const string getTimeAsAString(); 00025 00026 void updateUnixTime(time_t unixTime); 00027 00028 void programAlarm(uint32_t seconds); 00029 void goToSleep(); 00030 uint8_t SetSysClock_PLL_HSE(uint8_t bypass); 00031 uint8_t SetSysClock_PLL_HSI(); 00032 uint8_t SetSysClock_MSI(); 00033 void resetClockRegisters(); 00034 void initClock(); 00035 void printClockInfo(); 00036 00037 void readRegisters(); 00038 void printRegisters(); 00039 00040 };
Generated on Fri Aug 19 2022 07:33:34 by
1.7.2