Watchdog Timer (WDT) driver for SAM4L.
Copyright (c) 2012-2018 Microchip Technology Inc. and its subsidiaries.
#include "compiler.h"
Data Structures | |
struct | wdt_config |
Watchdog Timer configuration structure. More... | |
struct | wdt_dev_inst |
Watchdog Timer driver software instance structure. More... | |
Macros | |
#define | WDT_CLK_SRC_32K WDT_CTRL_CSSEL |
Select the 32KHz oscillator as clock source. More... | |
#define | WDT_CLK_SRC_RCSYS 0 |
Select the system RC oscillator (RCSYS) as clock source. More... | |
#define | WDT_INT_DIS 0 |
WDT Interrupt Mode is disabled. More... | |
#define | WDT_INT_EN WDT_CTRL_IM |
WDT Interrupt Mode is enabled. More... | |
#define | WDT_MODE_BASIC 0 |
Basic mode. More... | |
#define | WDT_MODE_WINDOW WDT_CTRL_MODE |
Window mode. More... | |
Enumerations | |
enum | wdt_period { WDT_PERIOD_NONE = 0, WDT_PERIOD_MIN_CLK = 7, WDT_PERIOD_256_CLK = 7, WDT_PERIOD_512_CLK = 8, WDT_PERIOD_1024_CLK = 9, WDT_PERIOD_2048_CLK = 10, WDT_PERIOD_4096_CLK = 11, WDT_PERIOD_8192_CLK = 12, WDT_PERIOD_16384_CLK = 13, WDT_PERIOD_32768_CLK = 14, WDT_PERIOD_65536_CLK = 15, WDT_PERIOD_131072_CLK = 16, WDT_PERIOD_262144_CLK = 17, WDT_PERIOD_524288_CLK = 18, WDT_PERIOD_1048576_CLK = 19, WDT_PERIOD_2097152_CLK = 20, WDT_PERIOD_4194304_CLK = 21, WDT_PERIOD_8388608_CLK = 22, WDT_PERIOD_16777216_CLK = 23, WDT_PERIOD_33554432_CLK = 24, WDT_PERIOD_67108864_CLK = 25, WDT_PERIOD_134217728_CLK = 26, WDT_PERIOD_268435456_CLK = 27, WDT_PERIOD_536870912_CLK = 28, WDT_PERIOD_1073741824_CLK = 29, WDT_PERIOD_2147483648_CLK = 30, WDT_PERIOD_4294967296_CLK = 31, WDT_PERIOD_MAX_CLK = 31 } |
Watchdog Timer period configuration enum. More... | |
Functions | |
void | wdt_clear (struct wdt_dev_inst *const dev_inst) |
Restart the watchdog timer. More... | |
static void | wdt_clear_interrupt (struct wdt_dev_inst *const dev_inst) |
Clear the WDT module interrupt status. More... | |
void | wdt_disable (struct wdt_dev_inst *const dev_inst) |
Disable the WDT module. More... | |
static void | wdt_disable_interrupt (struct wdt_dev_inst *const dev_inst) |
Disable the WDT module interrupt. More... | |
void | wdt_enable (struct wdt_dev_inst *const dev_inst) |
Enable the WDT module. More... | |
static void | wdt_enable_interrupt (struct wdt_dev_inst *const dev_inst) |
Enable the WDT module interrupt. More... | |
void | wdt_get_config_defaults (struct wdt_config *const cfg) |
Initializes a Watchdog Timer configuration structure to defaults. More... | |
static uint32_t | wdt_get_interrupt_mask (struct wdt_dev_inst *const dev_inst) |
Get the watchdog interrupt mask. More... | |
static uint32_t | wdt_get_interrupt_status (struct wdt_dev_inst *const dev_inst) |
Get the watchdog interrupt status. More... | |
static uint32_t | wdt_get_status (struct wdt_dev_inst *const dev_inst) |
Get the watchdog timer status. More... | |
bool | wdt_init (struct wdt_dev_inst *const dev_inst, Wdt *const wdt, struct wdt_config *const cfg) |
Initialize the WDT module. More... | |
bool | wdt_reset_mcu (void) |
Reset MCU by generating a WDT reset as soon as possible. More... | |
#define WDT_CLK_SRC_32K WDT_CTRL_CSSEL |
Select the 32KHz oscillator as clock source.
Referenced by run_wdt_test_all().
#define WDT_CLK_SRC_RCSYS 0 |
Select the system RC oscillator (RCSYS) as clock source.
Referenced by wdt_get_config_defaults(), and wdt_set_ctrl().
#define WDT_INT_DIS 0 |
WDT Interrupt Mode is disabled.
Referenced by wdt_get_config_defaults().
#define WDT_INT_EN WDT_CTRL_IM |
WDT Interrupt Mode is enabled.
#define WDT_MODE_BASIC 0 |
Basic mode.
Referenced by wdt_get_config_defaults().
#define WDT_MODE_WINDOW WDT_CTRL_MODE |
Window mode.
Referenced by run_wdt_test_all().