Sara Ojeda / Mbed 2 deprecated prueba_hsens

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Clock.h Source File

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