WatchDog Timer library, support for LPC1768 and LPC11U24
Dependents: ECGAFE_copy WatchDog
Fork of WatchDog by
Diff: WatchDog.h
- Revision:
- 0:bbc789f8d849
diff -r 000000000000 -r bbc789f8d849 WatchDog.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/WatchDog.h Sun Jul 01 22:43:25 2012 +0000 @@ -0,0 +1,57 @@ +/* +* Using code Simon Ford written in his example +* to implement WDT. +* It can run in seconds, milliseconds, and microseconds. +* All there is to do, is keep feeding the watchdog. +*/ + +#ifndef WATCHDOG_H +#define WATCHDOG_H + +#include "mbed.h" + +/** Watchdog timer implementation (in seconds) */ +class WatchDog { +public: + /** Creates Watchdog timer + * + * @param Sets the WDT in seconds + */ + WatchDog(float s); + + /** Keep feeding the watchdog in routine + * + * xxx.feed(); does the trick + */ + void feed(); +}; +/** Watchdog timer implementation (in milliseconds) */ +class WatchDog_ms { +public: + /** Creates Watchdog timer + * + * @param Sets the WDT in milliseconds + */ + WatchDog_ms(int ms); + /** Keep feeding the watchdog in routine + * + * xxx.feed(); does the trick + */ + void feed(); +}; +/** Watchdog timer implementation (in microseconds) */ +class WatchDog_us { +public: + /** Creates Watchdog timer + * + * @param Sets the WDT in microseconds + */ + WatchDog_us(int us); + /** Keep feeding the watchdog in routine + * + * xxx.feed(); does the trick + */ + void feed(); +}; + +#endif \ No newline at end of file