timer 0 mit Sekunden
Fork of timer0 by
Diff: timer0.h
- Revision:
- 0:bbd867fd30d1
- Child:
- 1:cd53b287f41b
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/timer0.h Sat Jul 26 07:27:37 2014 +0000 @@ -0,0 +1,36 @@ + +#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; + + 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); +}; \ No newline at end of file