Interface exposing basic LPC1768 watchdog timer functionality.

Committer:
nr
Date:
Sun Sep 02 14:58:31 2012 +0000
Revision:
1:bb42bb1359b9
Parent:
0:f39b85bbe46f
Added some documentation bits.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
nr 0:f39b85bbe46f 1 #ifndef MBED_WATCHDOG_TIMER_H
nr 0:f39b85bbe46f 2 #define MBED_WATCHDOG_TIMER_H
nr 0:f39b85bbe46f 3
nr 0:f39b85bbe46f 4 /**
nr 1:bb42bb1359b9 5 * A class to encapsulate basic LPC1768 watchdog timer functionality.
nr 0:f39b85bbe46f 6 *
nr 0:f39b85bbe46f 7 * References:
nr 0:f39b85bbe46f 8 * 1) Chapter 28 in the LPC17xx UM.
nr 0:f39b85bbe46f 9 * 2) http://mbed.org/cookbook/WatchDog-Timer
nr 0:f39b85bbe46f 10 */
nr 0:f39b85bbe46f 11 class WatchdogTimer
nr 0:f39b85bbe46f 12 {
nr 0:f39b85bbe46f 13
nr 0:f39b85bbe46f 14 public:
nr 0:f39b85bbe46f 15 /**
nr 0:f39b85bbe46f 16 * WatchDogTimer no-arg constructor.
nr 0:f39b85bbe46f 17 */
nr 0:f39b85bbe46f 18 WatchdogTimer();
nr 0:f39b85bbe46f 19
nr 0:f39b85bbe46f 20 /**
nr 0:f39b85bbe46f 21 * Enable and activate the watchdog with a given timeout value.
nr 0:f39b85bbe46f 22 *
nr 0:f39b85bbe46f 23 * Note! Once the watchdog has been enabled, there's no way to disable it.
nr 0:f39b85bbe46f 24 *
nr 0:f39b85bbe46f 25 * @param timeout watch time-out value (in seconds)
nr 0:f39b85bbe46f 26 */
nr 0:f39b85bbe46f 27 void enable(float timeout);
nr 0:f39b85bbe46f 28
nr 0:f39b85bbe46f 29 /**
nr 0:f39b85bbe46f 30 * Feed the watchdog to reset the countdown timer.
nr 0:f39b85bbe46f 31 */
nr 0:f39b85bbe46f 32 void feed();
nr 0:f39b85bbe46f 33
nr 1:bb42bb1359b9 34 /**
nr 1:bb42bb1359b9 35 * Return whether the previous reset was caused by the watchdog timer.
nr 1:bb42bb1359b9 36 */
nr 0:f39b85bbe46f 37 static bool causedReset();
nr 0:f39b85bbe46f 38 };
nr 0:f39b85bbe46f 39
nr 0:f39b85bbe46f 40 #endif