timer0
Dependents: 09_PT1000 10_PT1000 11_PT1000 18_PT1000
timer0.h
- Committer:
- rs27
- Date:
- 2015-05-08
- Revision:
- 2:d8e4c9bfd51d
- Parent:
- 1:45063f72267b
File content as of revision 2:d8e4c9bfd51d:
#ifndef TIMER0_H #define TIMER0_H #include "mbed.h" #define TIMER0_NUM_COUNTDOWNTIMERS 25 // status definition: // 0 the timer has expired // 1 10 ms Timer // 2 Sekunden Timer // 3 Minuten Timer // 4 Stunden Timer // 0xFF Free timer class timer0 { private: struct timerStruct { unsigned char status; // siehe Beschreibung unsigned int count_timer; // count down Zähler } CountDownTimers[TIMER0_NUM_COUNTDOWNTIMERS]; Ticker ticker; public: uint16_t counter; uint16_t countMillisecond; timer0(); void func(void); uint8_t AllocateCountdownTimer (void); void RemoveCountdownTimer(uint8_t timer); uint8_t GetTimerStatus(uint8_t timer); uint16_t GetTimerZeit(uint8_t timer); void SetCountdownTimer(uint8_t timer, uint8_t status, uint16_t value); }; #endif