mbed libraries for KL25Z

Dependents:   FRDM_RGBLED

Committer:
emilmont
Date:
Fri Nov 09 11:33:53 2012 +0000
Revision:
8:c14af7958ef5
Parent:
2:e9a661555b58
Child:
9:663789d7729f
SPI driver; ADC driver; DAC driver; microlib support; general bugfixing

Who changed what in which revision?

UserRevisionLine numberNew contents of line
emilmont 2:e9a661555b58 1 /* mbed Microcontroller Library - TimerEvent
emilmont 2:e9a661555b58 2 * Copyright (c) 2007-2009 ARM Limited. All rights reserved.
emilmont 8:c14af7958ef5 3 */
emilmont 2:e9a661555b58 4 #ifndef MBED_TIMEREVENT_H
emilmont 2:e9a661555b58 5 #define MBED_TIMEREVENT_H
emilmont 2:e9a661555b58 6
emilmont 2:e9a661555b58 7 #include "us_ticker_api.h"
emilmont 2:e9a661555b58 8
emilmont 2:e9a661555b58 9 namespace mbed {
emilmont 2:e9a661555b58 10
emilmont 8:c14af7958ef5 11 /** Base abstraction for timer interrupts
emilmont 8:c14af7958ef5 12 */
emilmont 2:e9a661555b58 13 class TimerEvent {
emilmont 2:e9a661555b58 14 public:
emilmont 2:e9a661555b58 15 TimerEvent();
emilmont 2:e9a661555b58 16
emilmont 8:c14af7958ef5 17 /** The handler registered with the underlying timer interrupt
emilmont 8:c14af7958ef5 18 */
emilmont 8:c14af7958ef5 19 static void irq(uint32_t id);
emilmont 8:c14af7958ef5 20
emilmont 8:c14af7958ef5 21 /** Destruction removes it...
emilmont 8:c14af7958ef5 22 */
emilmont 2:e9a661555b58 23 virtual ~TimerEvent();
emilmont 2:e9a661555b58 24
emilmont 2:e9a661555b58 25 protected:
emilmont 2:e9a661555b58 26 // The handler called to service the timer event of the derived class
emilmont 2:e9a661555b58 27 virtual void handler() = 0;
emilmont 2:e9a661555b58 28
emilmont 2:e9a661555b58 29 // insert in to linked list
emilmont 2:e9a661555b58 30 void insert(unsigned int timestamp);
emilmont 2:e9a661555b58 31
emilmont 2:e9a661555b58 32 // remove from linked list, if in it
emilmont 2:e9a661555b58 33 void remove();
emilmont 2:e9a661555b58 34
emilmont 8:c14af7958ef5 35 ticker_event event;
emilmont 2:e9a661555b58 36 };
emilmont 2:e9a661555b58 37
emilmont 2:e9a661555b58 38 } // namespace mbed
emilmont 2:e9a661555b58 39
emilmont 2:e9a661555b58 40 #endif