extendedWatchDogSAMD class

The extendedWatchDogSAMD class uses the early warning interrupt to of the built in SAMD watchdog to extend the allowable time between resets of the watchdog's clock up to multiple minute timescales.

Code for this is taken from the Adafruit SleepyDog library: https://github.com/adafruit/Adafruit_SleepyDog/ and this library: https://github.com/javos65/WDTZero

Public static variables

static volatile uint32_t _barksUntilReset
The number of times the pre-reset interrupt is allowed to fire before the watchdog reset is allowed.
static uint32_t _resetTime_s
Internal reference to the number of seconds of silence before the module is reset.

Public static functions

static void setupWatchDog(uint32_t resetTime_s)
One-time initialization of watchdog timer.
static void enableWatchDog()
Enable the watchdog.
static void disableWatchDog()
Disable the watchdog.
static void resetWatchDog()
Reset the number of barks left before the watchdog bites and the board resets.
static void setupEIC()
One-time initialization of external interrupt controller.
static void config32kOSC()
Configure the 32768 Hz Oscillator.
static void configureClockGenerator()
Configure the generic clock generator - sourced from the 32k oscillator.
static void configureWDTClock()
Configure the peripheral clock for the WDT sourced from the generic clock generator.
static void configureEICClock()
Configure the peripheral clock for the external interrupt congtroller (EIC) - sourced from the generic clock generator.
static void clearWDTInterrupt()
Reset the processor watchdog flag.
static void waitForWDTBitSync()
Wait for the WDT config bit sync to finish.+.
static void waitForGCLKBitSync()
Wait for the GCLK config bit sync to finish.+.

Function documentation

static void extendedWatchDogSAMD::setupWatchDog(uint32_t resetTime_s)

One-time initialization of watchdog timer.

Parameters
resetTime_s The length of time in seconds between resets of the watchdog before the entire board is reset.

static void extendedWatchDogSAMD::resetWatchDog()

Reset the number of barks left before the watchdog bites and the board resets.