Driver for the Watchdog Timer.
Provides functions for selecting the mode, setting the time-out period, and enabling/disabling the Watchdog Timer.
Modules | |
Related Project(s) | |
In this section you can find all the projects related to the WDT - Watchdog Timer. | |
Data Structures | |
struct | wdt_opt_t |
WDT startup options. More... | |
Macros | |
#define | AVR32_SCIF_OSC32_FREQUENCY 32768 |
#define | WDT_BASIC_MODE 0x0 |
WDT Basic Mode. More... | |
#define | WDT_CLOCK_SOURCE_SELECT_OSC32K 0x1 |
WDT Clock Source Select 32K Oscillator. More... | |
#define | WDT_CLOCK_SOURCE_SELECT_RCSYS 0x0 |
WDT Clock Source Select RCOSC. More... | |
#define | WDT_WINDOW_MODE 0x1 |
WDT Window Mode. More... | |
Functions | |
void | wdt_clear (void) |
Clears the WatchDog Timer. More... | |
void | wdt_disable (void) |
Disables the WatchDog Timer. More... | |
uint64_t | wdt_enable (wdt_opt_t *opt) |
Enables the WatchDog Timer with the us_timeout_period time-out period saturated to the supported range and rounded up to the nearest supported greater time-out period. More... | |
int64_t | wdt_get_us_timeout_period (wdt_opt_t *opt) |
Gets the time-out period of the WatchDog Timer in microseconds. More... | |
void | wdt_reenable (void) |
Re-enables the WatchDog Timer with the last time-out period configured. More... | |
void | wdt_reset_mcu (void) |
Resets the MCU with the WatchDog Timer as fast as possible. More... | |
#define AVR32_SCIF_OSC32_FREQUENCY 32768 |
#define WDT_BASIC_MODE 0x0 |
WDT Basic Mode.
#define WDT_CLOCK_SOURCE_SELECT_OSC32K 0x1 |
WDT Clock Source Select 32K Oscillator.
#define WDT_CLOCK_SOURCE_SELECT_RCSYS 0x0 |
WDT Clock Source Select RCOSC.
#define WDT_WINDOW_MODE 0x1 |
WDT Window Mode.
void wdt_clear | ( | void | ) |
Clears the WatchDog Timer.
void wdt_disable | ( | void | ) |
Disables the WatchDog Timer.
References wdt_set_ctrl().
uint64_t wdt_enable | ( | wdt_opt_t * | opt | ) |
Enables the WatchDog Timer with the us_timeout_period time-out period saturated to the supported range and rounded up to the nearest supported greater time-out period.
opt | Structure for settings of WDT. |
References clz, Max, MAX_US_TIMEOUT_PERIOD, Min, MIN_US_TIMEOUT_PERIOD, wdt_opt_t::us_timeout_period, wdt_get_us_timeout_period(), and wdt_set_ctrl().
Referenced by wdt_reset_mcu(), and wdt_scheduler().
int64_t wdt_get_us_timeout_period | ( | wdt_opt_t * | opt | ) |
Gets the time-out period of the WatchDog Timer in microseconds.
opt | Structure for settings of WDT. |
<0 | The WatchDog Timer is disabled. |
>=0 | Active time-out period of the WatchDog Timer in microseconds. |
Referenced by wdt_enable().
void wdt_reenable | ( | void | ) |
Re-enables the WatchDog Timer with the last time-out period configured.
References wdt_set_ctrl().
Referenced by wdt_scheduler().
void wdt_reset_mcu | ( | void | ) |
Resets the MCU with the WatchDog Timer as fast as possible.
References cpu_irq_disable, opt, wdt_opt_t::us_timeout_period, and wdt_enable().