Microchip® Advanced Software Framework

wdt.c File Reference

WDT driver for AVR32 UC3.

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

#include <avr32/io.h>
#include "compiler.h"
#include "wdt.h"

Macros

#define MAX_US_TIMEOUT_PERIOD   (((1ULL << (1 << AVR32_WDT_CTRL_PSEL_SIZE)) * 1000000 + AVR32_PM_RCOSC_FREQUENCY / 2) / AVR32_PM_RCOSC_FREQUENCY)
 
#define MIN_US_TIMEOUT_PERIOD   (((1ULL << 1 ) * 1000000 + AVR32_PM_RCOSC_FREQUENCY / 2) / AVR32_PM_RCOSC_FREQUENCY)
 

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...
 
static void wdt_set_ctrl (uint32_t ctrl)
 Sets the WatchDog Timer Control register to the ctrl value thanks to the WatchDog Timer key. More...
 

#define MAX_US_TIMEOUT_PERIOD   (((1ULL << (1 << AVR32_WDT_CTRL_PSEL_SIZE)) * 1000000 + AVR32_PM_RCOSC_FREQUENCY / 2) / AVR32_PM_RCOSC_FREQUENCY)

Referenced by wdt_enable().

#define MIN_US_TIMEOUT_PERIOD   (((1ULL << 1 ) * 1000000 + AVR32_PM_RCOSC_FREQUENCY / 2) / AVR32_PM_RCOSC_FREQUENCY)

Referenced by wdt_enable().

static void wdt_set_ctrl ( uint32_t  ctrl)
static

Sets the WatchDog Timer Control register to the ctrl value thanks to the WatchDog Timer key.

Parameters
ctrlValue to set the WatchDog Timer Control register to.
Note
The KEY bit-field of ctrl is assumed to be zero.

Referenced by wdt_disable(), wdt_enable(), and wdt_reenable().