Design-in of LPC11U24 (lqfp48) of mbed as Steppermotor controller with USB control.
Mbed repository of Stepper Motor Control board. Using mbed LPC11U24 chip with HID USB.
Hardware in copy repo on bitbucket https://bitbucket.org/jeroen3/stepper-motor-board
Diff: watchdog.h
- Revision:
- 0:d0306c0cbee6
diff -r 000000000000 -r d0306c0cbee6 watchdog.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/watchdog.h Mon Oct 28 18:26:28 2013 +0000 @@ -0,0 +1,58 @@ +/* +* 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 +