Zeitsteuerung

Dependents:   mini_02

Fork of timer0 by V09

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers timer0.h Source File

timer0.h

00001 
00002 #include "mbed.h"
00003 
00004 #define TIMER0_NUM_COUNTDOWNTIMERS  25
00005 
00006 // status definition:
00007 // 0            the timer has expired
00008 // 1            10 ms Timer
00009 // 2            Sekunden Timer
00010 // 3            Minuten Timer
00011 // 4            Stunden Timer
00012 // 0xFF         Free timer
00013 
00014 
00015 class timer0 {
00016   private:
00017       
00018     struct timerStruct
00019     {
00020       unsigned char status;           // siehe Beschreibung
00021       unsigned int count_timer;       // count down Zähler
00022     } CountDownTimers[TIMER0_NUM_COUNTDOWNTIMERS];    
00023     
00024     struct tm t;        // Struktur Datum & Zeit
00025     
00026     Ticker ticker;
00027 
00028   public:
00029 
00030     uint16_t ms;        // Zähler für milli Sekunden
00031     uint8_t sec;        // Zähler für die Sekunden
00032     uint8_t min;
00033     uint8_t hours;
00034 
00035     time_t seconds;     // Sekunden
00036                 
00037     timer0();
00038     void func(void);
00039     void get_time_stamp(uint8_t *tarray,uint16_t *millis);
00040     uint8_t AllocateCountdownTimer (void);
00041     void RemoveCountdownTimer(uint8_t timer);
00042     uint8_t GetTimerStatus(uint8_t timer);
00043     uint16_t GetTimerZeit(uint8_t timer);
00044     void SetCountdownTimer(unsigned char timer, unsigned char status, unsigned short value);
00045     void Set_t(uint8_t * data);
00046 };