00001 /*This file is prepared for Doxygen automatic documentation generation.*/ 00017 /* Copyright (c) 2009 Atmel Corporation. All rights reserved. 00018 * 00019 * Redistribution and use in source and binary forms, with or without 00020 * modification, are permitted provided that the following conditions are met: 00021 * 00022 * 1. Redistributions of source code must retain the above copyright notice, this 00023 * list of conditions and the following disclaimer. 00024 * 00025 * 2. Redistributions in binary form must reproduce the above copyright notice, 00026 * this list of conditions and the following disclaimer in the documentation 00027 * and/or other materials provided with the distribution. 00028 * 00029 * 3. The name of Atmel may not be used to endorse or promote products derived 00030 * from this software without specific prior written permission. 00031 * 00032 * 4. This software may only be redistributed and used in connection with an Atmel 00033 * AVR product. 00034 * 00035 * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 00036 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 00037 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 00038 * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 00039 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 00040 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00041 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 00042 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00043 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00044 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE 00045 * 00046 */ 00047 00048 #ifndef _WDT_H_ 00049 #define _WDT_H_ 00050 00051 // These defines are missing from or wrong in the toolchain header file ip_xxx.h or part.h 00052 #ifdef AVR32_WDT_401_H_INCLUDED 00053 #define AVR32_WDT_KEY_VALUE 0x00000055 00054 #endif 00055 00057 #define WDT_CLOCK_SOURCE_SELECT_RCSYS 0x0 00058 00060 #define WDT_CLOCK_SOURCE_SELECT_OSC32K 0x1 00061 00063 #define WDT_BASIC_MODE 0x0 00064 00066 #define WDT_WINDOW_MODE 0x1 00067 00069 typedef struct 00070 { 00072 unsigned long long us_timeout_period; 00074 unsigned long long us_timeban_period; 00076 unsigned char cssel; 00078 unsigned char fcd; 00080 unsigned char sfv; 00082 unsigned char mode; 00084 unsigned char dar; 00085 } wdt_opt_t; 00086 00094 extern long long wdt_get_us_timeout_period(wdt_opt_t *opt); 00095 00103 extern long long wdt_get_us_timeban_period(wdt_opt_t *opt); 00104 00107 extern void wdt_disable(void); 00108 00117 extern unsigned long long wdt_enable(wdt_opt_t *opt); 00118 00122 extern void wdt_reenable(void); 00123 00126 extern void wdt_clear(void); 00127 00130 extern void wdt_reset_mcu(void); 00131 00132 00133 #endif // _WDT_H_