Microchip® Advanced Software Framework

wdt.h File Reference

AVR XMEGA WatchDog Timer driver.

Copyright (c) 2011-2018 Microchip Technology Inc. and its subsidiaries.

#include "compiler.h"

Macros

#define wdt_reset()   __asm__ __volatile__("wdr");
 This macro resets (clears/refreshes) the Watchdog Timer. More...
 

Enumerations

enum  wdt_timeout_period_t {
  WDT_TIMEOUT_PERIOD_8CLK = (0x00),
  WDT_TIMEOUT_PERIOD_16CLK = (0x01),
  WDT_TIMEOUT_PERIOD_32CLK = (0x02),
  WDT_TIMEOUT_PERIOD_64CLK = (0x03),
  WDT_TIMEOUT_PERIOD_125CLK = (0x04),
  WDT_TIMEOUT_PERIOD_250CLK = (0x05),
  WDT_TIMEOUT_PERIOD_500CLK = (0x06),
  WDT_TIMEOUT_PERIOD_1KCLK = (0x07),
  WDT_TIMEOUT_PERIOD_2KCLK = (0x08),
  WDT_TIMEOUT_PERIOD_4KCLK = (0x09),
  WDT_TIMEOUT_PERIOD_8KCLK = (0x0A)
}
 Watchdog timeout period setting. More...
 
enum  wdt_window_period_t {
  WDT_WINDOW_PERIOD_8CLK = (0x00),
  WDT_WINDOW_PERIOD_16CLK = (0x01),
  WDT_WINDOW_PERIOD_32CLK = (0x02),
  WDT_WINDOW_PERIOD_64CLK = (0x03),
  WDT_WINDOW_PERIOD_125CLK = (0x04),
  WDT_WINDOW_PERIOD_250CLK = (0x05),
  WDT_WINDOW_PERIOD_500CLK = (0x06),
  WDT_WINDOW_PERIOD_1KCLK = (0x07),
  WDT_WINDOW_PERIOD_2KCLK = (0x08),
  WDT_WINDOW_PERIOD_4KCLK = (0x09),
  WDT_WINDOW_PERIOD_8KCLK = (0x0A)
}
 Watchdog window period setting. More...
 

Functions

void wdt_disable (void)
 Disable Watchdog. More...
 
bool wdt_disable_window_mode (void)
 Disable Watchdog window mode without changing period settings. More...
 
void wdt_enable (void)
 Enable Watchdog. More...
 
bool wdt_enable_window_mode (void)
 Enable Watchdog window mode. More...
 
static enum wdt_timeout_period_t wdt_get_timeout_period (void)
 Gets the Watchdog timeout period. More...
 
static enum wdt_window_period_t wdt_get_window_period (void)
 Gets the Watchdog window period. More...
 
static bool wdt_is_enabled (void)
 Check if the Watchdog Enable flag is set. More...
 
void wdt_reset_mcu (void)
 Reset MCU via Watchdog. More...
 
void wdt_set_timeout_period (enum wdt_timeout_period_t to_period)
 Set Watchdog timeout period. More...
 
bool wdt_set_window_period (enum wdt_window_period_t win_period)
 Set Watchdog window period. More...
 
static void wdt_wait_while_busy (void)
 Wait until WD settings are synchronized to the WD clock domain. More...
 
static bool wdt_window_mode_is_enabled (void)
 Check if the Watchdog Window mode flag is set. More...