timer 0 mit Sekunden

Dependents:   16_PT1000

Fork of timer0 by Reinhold Schaefer

Committer:
rs27
Date:
Sun Aug 03 19:12:56 2014 +0000
Revision:
1:cd53b287f41b
Parent:
0:bbd867fd30d1
Sekunden Timer integriert

Who changed what in which revision?

UserRevisionLine numberNew contents of line
rs27 0:bbd867fd30d1 1
rs27 0:bbd867fd30d1 2 #include "mbed.h"
rs27 0:bbd867fd30d1 3
rs27 0:bbd867fd30d1 4 #define TIMER0_NUM_COUNTDOWNTIMERS 25
rs27 0:bbd867fd30d1 5
rs27 0:bbd867fd30d1 6 // status definition:
rs27 0:bbd867fd30d1 7 // 0 the timer has expired
rs27 0:bbd867fd30d1 8 // 1 10 ms Timer
rs27 0:bbd867fd30d1 9 // 2 Sekunden Timer
rs27 0:bbd867fd30d1 10 // 3 Minuten Timer
rs27 0:bbd867fd30d1 11 // 4 Stunden Timer
rs27 0:bbd867fd30d1 12 // 0xFF Free timer
rs27 0:bbd867fd30d1 13
rs27 0:bbd867fd30d1 14
rs27 0:bbd867fd30d1 15 class timer0 {
rs27 0:bbd867fd30d1 16 private:
rs27 0:bbd867fd30d1 17
rs27 0:bbd867fd30d1 18 struct timerStruct
rs27 0:bbd867fd30d1 19 {
rs27 0:bbd867fd30d1 20 unsigned char status; // siehe Beschreibung
rs27 0:bbd867fd30d1 21 unsigned int count_timer; // count down Zähler
rs27 0:bbd867fd30d1 22 } CountDownTimers[TIMER0_NUM_COUNTDOWNTIMERS];
rs27 0:bbd867fd30d1 23
rs27 0:bbd867fd30d1 24 Ticker ticker;
rs27 0:bbd867fd30d1 25
rs27 0:bbd867fd30d1 26 public:
rs27 0:bbd867fd30d1 27 uint16_t counter;
rs27 1:cd53b287f41b 28 uint16_t countMillisecond;
rs27 0:bbd867fd30d1 29
rs27 0:bbd867fd30d1 30 timer0();
rs27 0:bbd867fd30d1 31 void func(void);
rs27 0:bbd867fd30d1 32 uint8_t AllocateCountdownTimer (void);
rs27 0:bbd867fd30d1 33 void RemoveCountdownTimer(uint8_t timer);
rs27 0:bbd867fd30d1 34 uint8_t GetTimerStatus(uint8_t timer);
rs27 0:bbd867fd30d1 35 uint16_t GetTimerZeit(uint8_t timer);
rs27 0:bbd867fd30d1 36 void SetCountdownTimer(uint8_t timer, uint8_t status, uint16_t value);
rs27 0:bbd867fd30d1 37 };