COSA
An Object-Oriented Platform for Arduino Programming
|
#include <Watchdog.hh>
Classes | |
class | Clock |
class | Scheduler |
Static Public Member Functions | |
static bool | is_initiated () |
static uint32_t | millis () |
static void | millis (uint32_t ms) |
static uint16_t | ms_per_tick () |
static void | begin (uint16_t ms=16) |
static void | delay (uint32_t ms) |
static void | await () |
static uint32_t | since (uint32_t start) |
static void | end () |
static void | job (Watchdog::Scheduler *scheduler) |
static Watchdog::Scheduler * | scheduler () |
static void | wall (Clock *clock) |
static Clock * | clock () |
Friends | |
void | WDT_vect (void) |
The Watchdog is used as a low power timer for periodical events and delay. Please note that the accuracy is only 1-10% if not calibrated (typical drift is 16-32 ms per second).
Definition at line 35 of file Watchdog.hh.
|
inlinestatic |
Wait for the next watchdog timeout.
Definition at line 96 of file Watchdog.hh.
|
static |
Start watchdog with given period (milli-seconds). The given timeout period is mapped to 16 milli-seconds and double periods (32, 64, 128, etc to approx 8 seconds).
[in] | ms | timeout period in milli-seconds (default 16 ms). |
Definition at line 49 of file Watchdog.cpp.
|
inlinestatic |
|
static |
Delay using watchdog timeouts and sleep mode. Timeouts will be the nearest watchdog tick.
[in] | ms | sleep period in milli-seconds. |
Definition at line 73 of file Watchdog.cpp.
|
inlinestatic |
Stop watchdog. Turn off timout callback. May be restarted with begin().
Definition at line 119 of file Watchdog.hh.
|
inlinestatic |
|
inlinestatic |
Set the watchdog job scheduler. May be used to enable/disable job scheduler.
[in] | scheduler. |
Definition at line 158 of file Watchdog.hh.
|
inlinestatic |
Get watchdog clock in milli-seconds.
Definition at line 51 of file Watchdog.hh.
|
inlinestatic |
Set watchdog clock in millis-seconds.
[in] | ms | milli-seconds. |
Definition at line 64 of file Watchdog.hh.
|
inlinestatic |
Get number of milli-seconds per tick.
Definition at line 73 of file Watchdog.hh.
|
inlinestatic |
|
inlinestatic |
Returns number of milli-seconds from given start time.
[in] | start | time in milli-seconds. |
Definition at line 108 of file Watchdog.hh.
|
inlinestatic |
Set the watchdog wall-clock.
[in] | clock. |
Definition at line 192 of file Watchdog.hh.
|
friend |
Interrupt Service Routine.