Macros | |
#define | WDT_CLEAR *((uint8_t *)0x40001008U) |
#define | WDT_CLEAR_MAGIC 0xA5 |
#define | WDT_PERIOD_125 WDT_PERIOD_4096CLK |
#define | WDT_PERIOD_17 WDT_PERIOD_512CLK |
Copyright (c) 2015 Microchip Technology Inc and 2012 – 2013, Thingsquare, http://www.thingsquare.com/. More... | |
#define | WDT_PERIOD_250 WDT_PERIOD_8192CLK |
#define | WDT_PERIOD_34 WDT_PERIOD_1024CLK |
#define | WDT_PERIOD_500 WDT_PERIOD_16384CLK |
#define | WDT_PERIOD_68 WDT_PERIOD_2048CLK |
Enumerations | |
enum | wdt_state { NOT_INITED = 0, ACTIVE = 1, INACTIVE = 2 } |
Functions | |
void | watchdog_init (void) |
Initiate the Watchdog timer, but does not start it. More... | |
void | watchdog_periodic (void) |
Reset the Watchdog timer count. More... | |
void | watchdog_reboot (void) |
Reboot the device. More... | |
Variables | |
static volatile int | status = NOT_INITED |
#define WDT_CLEAR *((uint8_t *)0x40001008U) |
Referenced by watchdog_periodic(), and watchdog_reboot().
#define WDT_CLEAR_MAGIC 0xA5 |
Referenced by watchdog_periodic().
#define WDT_PERIOD_125 WDT_PERIOD_4096CLK |
#define WDT_PERIOD_17 WDT_PERIOD_512CLK |
Copyright (c) 2015 Microchip Technology Inc and 2012 – 2013, Thingsquare, http://www.thingsquare.com/.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define WDT_PERIOD_250 WDT_PERIOD_8192CLK |
#define WDT_PERIOD_34 WDT_PERIOD_1024CLK |
#define WDT_PERIOD_500 WDT_PERIOD_16384CLK |
#define WDT_PERIOD_68 WDT_PERIOD_2048CLK |
enum wdt_state |
void watchdog_init | ( | void | ) |
Initiate the Watchdog timer, but does not start it.
References wdt_conf::always_on, wdt_conf::clock_source, GCLK_GENERATOR_4, INACTIVE, NOT_INITED, status, wdt_conf::timeout_period, wdt_get_config_defaults(), WDT_PERIOD_16384CLK, and wdt_set_config().
Referenced by watchdog_reboot().
void watchdog_periodic | ( | void | ) |
Reset the Watchdog timer count.
References ACTIVE, status, WDT_CLEAR, and WDT_CLEAR_MAGIC.
void watchdog_reboot | ( | void | ) |
Reboot the device.
References INACTIVE, NOT_INITED, status, watchdog_init(), watchdog_start(), and WDT_CLEAR.
|
static |
Referenced by watchdog_init(), watchdog_periodic(), and watchdog_reboot().