Update vom 10.05.15

Dependents:   19_Taster_BSW_oo 19_Taster_a

Fork of timer0 by Reinhold Schaefer

timer0.h

Committer:
rs27
Date:
2015-05-10
Revision:
2:fafaca146f6e
Parent:
1:45063f72267b

File content as of revision 2:fafaca146f6e:

#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