Fork of the official mbed C/C SDK provides the software platform and libraries to build your applications for RenBED.

Dependents:   1-RenBuggyTimed RenBED_RGB RenBED_RGB_PWM RenBED_RGB

Fork of mbed by mbed official

Committer:
elijahorr
Date:
Thu Apr 14 07:28:54 2016 +0000
Revision:
121:672067c3ada4
Parent:
111:4336505e4b1c
.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 111:4336505e4b1c 1 /**
Kojto 111:4336505e4b1c 2 * \file
Kojto 111:4336505e4b1c 3 *
Kojto 111:4336505e4b1c 4 * \brief Component description for WDT
Kojto 111:4336505e4b1c 5 *
Kojto 111:4336505e4b1c 6 * Copyright (c) 2015 Atmel Corporation. All rights reserved.
Kojto 111:4336505e4b1c 7 *
Kojto 111:4336505e4b1c 8 * \asf_license_start
Kojto 111:4336505e4b1c 9 *
Kojto 111:4336505e4b1c 10 * \page License
Kojto 111:4336505e4b1c 11 *
Kojto 111:4336505e4b1c 12 * Redistribution and use in source and binary forms, with or without
Kojto 111:4336505e4b1c 13 * modification, are permitted provided that the following conditions are met:
Kojto 111:4336505e4b1c 14 *
Kojto 111:4336505e4b1c 15 * 1. Redistributions of source code must retain the above copyright notice,
Kojto 111:4336505e4b1c 16 * this list of conditions and the following disclaimer.
Kojto 111:4336505e4b1c 17 *
Kojto 111:4336505e4b1c 18 * 2. Redistributions in binary form must reproduce the above copyright notice,
Kojto 111:4336505e4b1c 19 * this list of conditions and the following disclaimer in the documentation
Kojto 111:4336505e4b1c 20 * and/or other materials provided with the distribution.
Kojto 111:4336505e4b1c 21 *
Kojto 111:4336505e4b1c 22 * 3. The name of Atmel may not be used to endorse or promote products derived
Kojto 111:4336505e4b1c 23 * from this software without specific prior written permission.
Kojto 111:4336505e4b1c 24 *
Kojto 111:4336505e4b1c 25 * 4. This software may only be redistributed and used in connection with an
Kojto 111:4336505e4b1c 26 * Atmel microcontroller product.
Kojto 111:4336505e4b1c 27 *
Kojto 111:4336505e4b1c 28 * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
Kojto 111:4336505e4b1c 29 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
Kojto 111:4336505e4b1c 30 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
Kojto 111:4336505e4b1c 31 * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
Kojto 111:4336505e4b1c 32 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Kojto 111:4336505e4b1c 33 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
Kojto 111:4336505e4b1c 34 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
Kojto 111:4336505e4b1c 35 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
Kojto 111:4336505e4b1c 36 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
Kojto 111:4336505e4b1c 37 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
Kojto 111:4336505e4b1c 38 * POSSIBILITY OF SUCH DAMAGE.
Kojto 111:4336505e4b1c 39 *
Kojto 111:4336505e4b1c 40 * \asf_license_stop
Kojto 111:4336505e4b1c 41 *
Kojto 111:4336505e4b1c 42 */
Kojto 111:4336505e4b1c 43
Kojto 111:4336505e4b1c 44 #ifndef _SAMR21_WDT_COMPONENT_
Kojto 111:4336505e4b1c 45 #define _SAMR21_WDT_COMPONENT_
Kojto 111:4336505e4b1c 46
Kojto 111:4336505e4b1c 47 /* ========================================================================== */
Kojto 111:4336505e4b1c 48 /** SOFTWARE API DEFINITION FOR WDT */
Kojto 111:4336505e4b1c 49 /* ========================================================================== */
Kojto 111:4336505e4b1c 50 /** \addtogroup SAMR21_WDT Watchdog Timer */
Kojto 111:4336505e4b1c 51 /*@{*/
Kojto 111:4336505e4b1c 52
Kojto 111:4336505e4b1c 53 #define WDT_U2203
Kojto 111:4336505e4b1c 54 #define REV_WDT 0x200
Kojto 111:4336505e4b1c 55
Kojto 111:4336505e4b1c 56 /* -------- WDT_CTRL : (WDT Offset: 0x0) (R/W 8) Control -------- */
Kojto 111:4336505e4b1c 57 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
Kojto 111:4336505e4b1c 58 typedef union {
Kojto 111:4336505e4b1c 59 struct {
Kojto 111:4336505e4b1c 60 uint8_t :1; /*!< bit: 0 Reserved */
Kojto 111:4336505e4b1c 61 uint8_t ENABLE:1; /*!< bit: 1 Enable */
Kojto 111:4336505e4b1c 62 uint8_t WEN:1; /*!< bit: 2 Watchdog Timer Window Mode Enable */
Kojto 111:4336505e4b1c 63 uint8_t :4; /*!< bit: 3.. 6 Reserved */
Kojto 111:4336505e4b1c 64 uint8_t ALWAYSON:1; /*!< bit: 7 Always-On */
Kojto 111:4336505e4b1c 65 } bit; /*!< Structure used for bit access */
Kojto 111:4336505e4b1c 66 uint8_t reg; /*!< Type used for register access */
Kojto 111:4336505e4b1c 67 } WDT_CTRL_Type;
Kojto 111:4336505e4b1c 68 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
Kojto 111:4336505e4b1c 69
Kojto 111:4336505e4b1c 70 #define WDT_CTRL_OFFSET 0x0 /**< \brief (WDT_CTRL offset) Control */
Kojto 111:4336505e4b1c 71 #define WDT_CTRL_RESETVALUE 0x00ul /**< \brief (WDT_CTRL reset_value) Control */
Kojto 111:4336505e4b1c 72
Kojto 111:4336505e4b1c 73 #define WDT_CTRL_ENABLE_Pos 1 /**< \brief (WDT_CTRL) Enable */
Kojto 111:4336505e4b1c 74 #define WDT_CTRL_ENABLE (0x1ul << WDT_CTRL_ENABLE_Pos)
Kojto 111:4336505e4b1c 75 #define WDT_CTRL_WEN_Pos 2 /**< \brief (WDT_CTRL) Watchdog Timer Window Mode Enable */
Kojto 111:4336505e4b1c 76 #define WDT_CTRL_WEN (0x1ul << WDT_CTRL_WEN_Pos)
Kojto 111:4336505e4b1c 77 #define WDT_CTRL_ALWAYSON_Pos 7 /**< \brief (WDT_CTRL) Always-On */
Kojto 111:4336505e4b1c 78 #define WDT_CTRL_ALWAYSON (0x1ul << WDT_CTRL_ALWAYSON_Pos)
Kojto 111:4336505e4b1c 79 #define WDT_CTRL_MASK 0x86ul /**< \brief (WDT_CTRL) MASK Register */
Kojto 111:4336505e4b1c 80
Kojto 111:4336505e4b1c 81 /* -------- WDT_CONFIG : (WDT Offset: 0x1) (R/W 8) Configuration -------- */
Kojto 111:4336505e4b1c 82 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
Kojto 111:4336505e4b1c 83 typedef union {
Kojto 111:4336505e4b1c 84 struct {
Kojto 111:4336505e4b1c 85 uint8_t PER:4; /*!< bit: 0.. 3 Time-Out Period */
Kojto 111:4336505e4b1c 86 uint8_t WINDOW:4; /*!< bit: 4.. 7 Window Mode Time-Out Period */
Kojto 111:4336505e4b1c 87 } bit; /*!< Structure used for bit access */
Kojto 111:4336505e4b1c 88 uint8_t reg; /*!< Type used for register access */
Kojto 111:4336505e4b1c 89 } WDT_CONFIG_Type;
Kojto 111:4336505e4b1c 90 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
Kojto 111:4336505e4b1c 91
Kojto 111:4336505e4b1c 92 #define WDT_CONFIG_OFFSET 0x1 /**< \brief (WDT_CONFIG offset) Configuration */
Kojto 111:4336505e4b1c 93 #define WDT_CONFIG_RESETVALUE 0xBBul /**< \brief (WDT_CONFIG reset_value) Configuration */
Kojto 111:4336505e4b1c 94
Kojto 111:4336505e4b1c 95 #define WDT_CONFIG_PER_Pos 0 /**< \brief (WDT_CONFIG) Time-Out Period */
Kojto 111:4336505e4b1c 96 #define WDT_CONFIG_PER_Msk (0xFul << WDT_CONFIG_PER_Pos)
Kojto 111:4336505e4b1c 97 #define WDT_CONFIG_PER(value) (WDT_CONFIG_PER_Msk & ((value) << WDT_CONFIG_PER_Pos))
Kojto 111:4336505e4b1c 98 #define WDT_CONFIG_PER_8_Val 0x0ul /**< \brief (WDT_CONFIG) 8 clock cycles */
Kojto 111:4336505e4b1c 99 #define WDT_CONFIG_PER_16_Val 0x1ul /**< \brief (WDT_CONFIG) 16 clock cycles */
Kojto 111:4336505e4b1c 100 #define WDT_CONFIG_PER_32_Val 0x2ul /**< \brief (WDT_CONFIG) 32 clock cycles */
Kojto 111:4336505e4b1c 101 #define WDT_CONFIG_PER_64_Val 0x3ul /**< \brief (WDT_CONFIG) 64 clock cycles */
Kojto 111:4336505e4b1c 102 #define WDT_CONFIG_PER_128_Val 0x4ul /**< \brief (WDT_CONFIG) 128 clock cycles */
Kojto 111:4336505e4b1c 103 #define WDT_CONFIG_PER_256_Val 0x5ul /**< \brief (WDT_CONFIG) 256 clock cycles */
Kojto 111:4336505e4b1c 104 #define WDT_CONFIG_PER_512_Val 0x6ul /**< \brief (WDT_CONFIG) 512 clock cycles */
Kojto 111:4336505e4b1c 105 #define WDT_CONFIG_PER_1K_Val 0x7ul /**< \brief (WDT_CONFIG) 1024 clock cycles */
Kojto 111:4336505e4b1c 106 #define WDT_CONFIG_PER_2K_Val 0x8ul /**< \brief (WDT_CONFIG) 2048 clock cycles */
Kojto 111:4336505e4b1c 107 #define WDT_CONFIG_PER_4K_Val 0x9ul /**< \brief (WDT_CONFIG) 4096 clock cycles */
Kojto 111:4336505e4b1c 108 #define WDT_CONFIG_PER_8K_Val 0xAul /**< \brief (WDT_CONFIG) 8192 clock cycles */
Kojto 111:4336505e4b1c 109 #define WDT_CONFIG_PER_16K_Val 0xBul /**< \brief (WDT_CONFIG) 16384 clock cycles */
Kojto 111:4336505e4b1c 110 #define WDT_CONFIG_PER_8 (WDT_CONFIG_PER_8_Val << WDT_CONFIG_PER_Pos)
Kojto 111:4336505e4b1c 111 #define WDT_CONFIG_PER_16 (WDT_CONFIG_PER_16_Val << WDT_CONFIG_PER_Pos)
Kojto 111:4336505e4b1c 112 #define WDT_CONFIG_PER_32 (WDT_CONFIG_PER_32_Val << WDT_CONFIG_PER_Pos)
Kojto 111:4336505e4b1c 113 #define WDT_CONFIG_PER_64 (WDT_CONFIG_PER_64_Val << WDT_CONFIG_PER_Pos)
Kojto 111:4336505e4b1c 114 #define WDT_CONFIG_PER_128 (WDT_CONFIG_PER_128_Val << WDT_CONFIG_PER_Pos)
Kojto 111:4336505e4b1c 115 #define WDT_CONFIG_PER_256 (WDT_CONFIG_PER_256_Val << WDT_CONFIG_PER_Pos)
Kojto 111:4336505e4b1c 116 #define WDT_CONFIG_PER_512 (WDT_CONFIG_PER_512_Val << WDT_CONFIG_PER_Pos)
Kojto 111:4336505e4b1c 117 #define WDT_CONFIG_PER_1K (WDT_CONFIG_PER_1K_Val << WDT_CONFIG_PER_Pos)
Kojto 111:4336505e4b1c 118 #define WDT_CONFIG_PER_2K (WDT_CONFIG_PER_2K_Val << WDT_CONFIG_PER_Pos)
Kojto 111:4336505e4b1c 119 #define WDT_CONFIG_PER_4K (WDT_CONFIG_PER_4K_Val << WDT_CONFIG_PER_Pos)
Kojto 111:4336505e4b1c 120 #define WDT_CONFIG_PER_8K (WDT_CONFIG_PER_8K_Val << WDT_CONFIG_PER_Pos)
Kojto 111:4336505e4b1c 121 #define WDT_CONFIG_PER_16K (WDT_CONFIG_PER_16K_Val << WDT_CONFIG_PER_Pos)
Kojto 111:4336505e4b1c 122 #define WDT_CONFIG_WINDOW_Pos 4 /**< \brief (WDT_CONFIG) Window Mode Time-Out Period */
Kojto 111:4336505e4b1c 123 #define WDT_CONFIG_WINDOW_Msk (0xFul << WDT_CONFIG_WINDOW_Pos)
Kojto 111:4336505e4b1c 124 #define WDT_CONFIG_WINDOW(value) (WDT_CONFIG_WINDOW_Msk & ((value) << WDT_CONFIG_WINDOW_Pos))
Kojto 111:4336505e4b1c 125 #define WDT_CONFIG_WINDOW_8_Val 0x0ul /**< \brief (WDT_CONFIG) 8 clock cycles */
Kojto 111:4336505e4b1c 126 #define WDT_CONFIG_WINDOW_16_Val 0x1ul /**< \brief (WDT_CONFIG) 16 clock cycles */
Kojto 111:4336505e4b1c 127 #define WDT_CONFIG_WINDOW_32_Val 0x2ul /**< \brief (WDT_CONFIG) 32 clock cycles */
Kojto 111:4336505e4b1c 128 #define WDT_CONFIG_WINDOW_64_Val 0x3ul /**< \brief (WDT_CONFIG) 64 clock cycles */
Kojto 111:4336505e4b1c 129 #define WDT_CONFIG_WINDOW_128_Val 0x4ul /**< \brief (WDT_CONFIG) 128 clock cycles */
Kojto 111:4336505e4b1c 130 #define WDT_CONFIG_WINDOW_256_Val 0x5ul /**< \brief (WDT_CONFIG) 256 clock cycles */
Kojto 111:4336505e4b1c 131 #define WDT_CONFIG_WINDOW_512_Val 0x6ul /**< \brief (WDT_CONFIG) 512 clock cycles */
Kojto 111:4336505e4b1c 132 #define WDT_CONFIG_WINDOW_1K_Val 0x7ul /**< \brief (WDT_CONFIG) 1024 clock cycles */
Kojto 111:4336505e4b1c 133 #define WDT_CONFIG_WINDOW_2K_Val 0x8ul /**< \brief (WDT_CONFIG) 2048 clock cycles */
Kojto 111:4336505e4b1c 134 #define WDT_CONFIG_WINDOW_4K_Val 0x9ul /**< \brief (WDT_CONFIG) 4096 clock cycles */
Kojto 111:4336505e4b1c 135 #define WDT_CONFIG_WINDOW_8K_Val 0xAul /**< \brief (WDT_CONFIG) 8192 clock cycles */
Kojto 111:4336505e4b1c 136 #define WDT_CONFIG_WINDOW_16K_Val 0xBul /**< \brief (WDT_CONFIG) 16384 clock cycles */
Kojto 111:4336505e4b1c 137 #define WDT_CONFIG_WINDOW_8 (WDT_CONFIG_WINDOW_8_Val << WDT_CONFIG_WINDOW_Pos)
Kojto 111:4336505e4b1c 138 #define WDT_CONFIG_WINDOW_16 (WDT_CONFIG_WINDOW_16_Val << WDT_CONFIG_WINDOW_Pos)
Kojto 111:4336505e4b1c 139 #define WDT_CONFIG_WINDOW_32 (WDT_CONFIG_WINDOW_32_Val << WDT_CONFIG_WINDOW_Pos)
Kojto 111:4336505e4b1c 140 #define WDT_CONFIG_WINDOW_64 (WDT_CONFIG_WINDOW_64_Val << WDT_CONFIG_WINDOW_Pos)
Kojto 111:4336505e4b1c 141 #define WDT_CONFIG_WINDOW_128 (WDT_CONFIG_WINDOW_128_Val << WDT_CONFIG_WINDOW_Pos)
Kojto 111:4336505e4b1c 142 #define WDT_CONFIG_WINDOW_256 (WDT_CONFIG_WINDOW_256_Val << WDT_CONFIG_WINDOW_Pos)
Kojto 111:4336505e4b1c 143 #define WDT_CONFIG_WINDOW_512 (WDT_CONFIG_WINDOW_512_Val << WDT_CONFIG_WINDOW_Pos)
Kojto 111:4336505e4b1c 144 #define WDT_CONFIG_WINDOW_1K (WDT_CONFIG_WINDOW_1K_Val << WDT_CONFIG_WINDOW_Pos)
Kojto 111:4336505e4b1c 145 #define WDT_CONFIG_WINDOW_2K (WDT_CONFIG_WINDOW_2K_Val << WDT_CONFIG_WINDOW_Pos)
Kojto 111:4336505e4b1c 146 #define WDT_CONFIG_WINDOW_4K (WDT_CONFIG_WINDOW_4K_Val << WDT_CONFIG_WINDOW_Pos)
Kojto 111:4336505e4b1c 147 #define WDT_CONFIG_WINDOW_8K (WDT_CONFIG_WINDOW_8K_Val << WDT_CONFIG_WINDOW_Pos)
Kojto 111:4336505e4b1c 148 #define WDT_CONFIG_WINDOW_16K (WDT_CONFIG_WINDOW_16K_Val << WDT_CONFIG_WINDOW_Pos)
Kojto 111:4336505e4b1c 149 #define WDT_CONFIG_MASK 0xFFul /**< \brief (WDT_CONFIG) MASK Register */
Kojto 111:4336505e4b1c 150
Kojto 111:4336505e4b1c 151 /* -------- WDT_EWCTRL : (WDT Offset: 0x2) (R/W 8) Early Warning Interrupt Control -------- */
Kojto 111:4336505e4b1c 152 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
Kojto 111:4336505e4b1c 153 typedef union {
Kojto 111:4336505e4b1c 154 struct {
Kojto 111:4336505e4b1c 155 uint8_t EWOFFSET:4; /*!< bit: 0.. 3 Early Warning Interrupt Time Offset */
Kojto 111:4336505e4b1c 156 uint8_t :4; /*!< bit: 4.. 7 Reserved */
Kojto 111:4336505e4b1c 157 } bit; /*!< Structure used for bit access */
Kojto 111:4336505e4b1c 158 uint8_t reg; /*!< Type used for register access */
Kojto 111:4336505e4b1c 159 } WDT_EWCTRL_Type;
Kojto 111:4336505e4b1c 160 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
Kojto 111:4336505e4b1c 161
Kojto 111:4336505e4b1c 162 #define WDT_EWCTRL_OFFSET 0x2 /**< \brief (WDT_EWCTRL offset) Early Warning Interrupt Control */
Kojto 111:4336505e4b1c 163 #define WDT_EWCTRL_RESETVALUE 0x0Bul /**< \brief (WDT_EWCTRL reset_value) Early Warning Interrupt Control */
Kojto 111:4336505e4b1c 164
Kojto 111:4336505e4b1c 165 #define WDT_EWCTRL_EWOFFSET_Pos 0 /**< \brief (WDT_EWCTRL) Early Warning Interrupt Time Offset */
Kojto 111:4336505e4b1c 166 #define WDT_EWCTRL_EWOFFSET_Msk (0xFul << WDT_EWCTRL_EWOFFSET_Pos)
Kojto 111:4336505e4b1c 167 #define WDT_EWCTRL_EWOFFSET(value) (WDT_EWCTRL_EWOFFSET_Msk & ((value) << WDT_EWCTRL_EWOFFSET_Pos))
Kojto 111:4336505e4b1c 168 #define WDT_EWCTRL_EWOFFSET_8_Val 0x0ul /**< \brief (WDT_EWCTRL) 8 clock cycles */
Kojto 111:4336505e4b1c 169 #define WDT_EWCTRL_EWOFFSET_16_Val 0x1ul /**< \brief (WDT_EWCTRL) 16 clock cycles */
Kojto 111:4336505e4b1c 170 #define WDT_EWCTRL_EWOFFSET_32_Val 0x2ul /**< \brief (WDT_EWCTRL) 32 clock cycles */
Kojto 111:4336505e4b1c 171 #define WDT_EWCTRL_EWOFFSET_64_Val 0x3ul /**< \brief (WDT_EWCTRL) 64 clock cycles */
Kojto 111:4336505e4b1c 172 #define WDT_EWCTRL_EWOFFSET_128_Val 0x4ul /**< \brief (WDT_EWCTRL) 128 clock cycles */
Kojto 111:4336505e4b1c 173 #define WDT_EWCTRL_EWOFFSET_256_Val 0x5ul /**< \brief (WDT_EWCTRL) 256 clock cycles */
Kojto 111:4336505e4b1c 174 #define WDT_EWCTRL_EWOFFSET_512_Val 0x6ul /**< \brief (WDT_EWCTRL) 512 clock cycles */
Kojto 111:4336505e4b1c 175 #define WDT_EWCTRL_EWOFFSET_1K_Val 0x7ul /**< \brief (WDT_EWCTRL) 1024 clock cycles */
Kojto 111:4336505e4b1c 176 #define WDT_EWCTRL_EWOFFSET_2K_Val 0x8ul /**< \brief (WDT_EWCTRL) 2048 clock cycles */
Kojto 111:4336505e4b1c 177 #define WDT_EWCTRL_EWOFFSET_4K_Val 0x9ul /**< \brief (WDT_EWCTRL) 4096 clock cycles */
Kojto 111:4336505e4b1c 178 #define WDT_EWCTRL_EWOFFSET_8K_Val 0xAul /**< \brief (WDT_EWCTRL) 8192 clock cycles */
Kojto 111:4336505e4b1c 179 #define WDT_EWCTRL_EWOFFSET_16K_Val 0xBul /**< \brief (WDT_EWCTRL) 16384 clock cycles */
Kojto 111:4336505e4b1c 180 #define WDT_EWCTRL_EWOFFSET_8 (WDT_EWCTRL_EWOFFSET_8_Val << WDT_EWCTRL_EWOFFSET_Pos)
Kojto 111:4336505e4b1c 181 #define WDT_EWCTRL_EWOFFSET_16 (WDT_EWCTRL_EWOFFSET_16_Val << WDT_EWCTRL_EWOFFSET_Pos)
Kojto 111:4336505e4b1c 182 #define WDT_EWCTRL_EWOFFSET_32 (WDT_EWCTRL_EWOFFSET_32_Val << WDT_EWCTRL_EWOFFSET_Pos)
Kojto 111:4336505e4b1c 183 #define WDT_EWCTRL_EWOFFSET_64 (WDT_EWCTRL_EWOFFSET_64_Val << WDT_EWCTRL_EWOFFSET_Pos)
Kojto 111:4336505e4b1c 184 #define WDT_EWCTRL_EWOFFSET_128 (WDT_EWCTRL_EWOFFSET_128_Val << WDT_EWCTRL_EWOFFSET_Pos)
Kojto 111:4336505e4b1c 185 #define WDT_EWCTRL_EWOFFSET_256 (WDT_EWCTRL_EWOFFSET_256_Val << WDT_EWCTRL_EWOFFSET_Pos)
Kojto 111:4336505e4b1c 186 #define WDT_EWCTRL_EWOFFSET_512 (WDT_EWCTRL_EWOFFSET_512_Val << WDT_EWCTRL_EWOFFSET_Pos)
Kojto 111:4336505e4b1c 187 #define WDT_EWCTRL_EWOFFSET_1K (WDT_EWCTRL_EWOFFSET_1K_Val << WDT_EWCTRL_EWOFFSET_Pos)
Kojto 111:4336505e4b1c 188 #define WDT_EWCTRL_EWOFFSET_2K (WDT_EWCTRL_EWOFFSET_2K_Val << WDT_EWCTRL_EWOFFSET_Pos)
Kojto 111:4336505e4b1c 189 #define WDT_EWCTRL_EWOFFSET_4K (WDT_EWCTRL_EWOFFSET_4K_Val << WDT_EWCTRL_EWOFFSET_Pos)
Kojto 111:4336505e4b1c 190 #define WDT_EWCTRL_EWOFFSET_8K (WDT_EWCTRL_EWOFFSET_8K_Val << WDT_EWCTRL_EWOFFSET_Pos)
Kojto 111:4336505e4b1c 191 #define WDT_EWCTRL_EWOFFSET_16K (WDT_EWCTRL_EWOFFSET_16K_Val << WDT_EWCTRL_EWOFFSET_Pos)
Kojto 111:4336505e4b1c 192 #define WDT_EWCTRL_MASK 0x0Ful /**< \brief (WDT_EWCTRL) MASK Register */
Kojto 111:4336505e4b1c 193
Kojto 111:4336505e4b1c 194 /* -------- WDT_INTENCLR : (WDT Offset: 0x4) (R/W 8) Interrupt Enable Clear -------- */
Kojto 111:4336505e4b1c 195 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
Kojto 111:4336505e4b1c 196 typedef union {
Kojto 111:4336505e4b1c 197 struct {
Kojto 111:4336505e4b1c 198 uint8_t EW:1; /*!< bit: 0 Early Warning Interrupt Enable */
Kojto 111:4336505e4b1c 199 uint8_t :7; /*!< bit: 1.. 7 Reserved */
Kojto 111:4336505e4b1c 200 } bit; /*!< Structure used for bit access */
Kojto 111:4336505e4b1c 201 uint8_t reg; /*!< Type used for register access */
Kojto 111:4336505e4b1c 202 } WDT_INTENCLR_Type;
Kojto 111:4336505e4b1c 203 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
Kojto 111:4336505e4b1c 204
Kojto 111:4336505e4b1c 205 #define WDT_INTENCLR_OFFSET 0x4 /**< \brief (WDT_INTENCLR offset) Interrupt Enable Clear */
Kojto 111:4336505e4b1c 206 #define WDT_INTENCLR_RESETVALUE 0x00ul /**< \brief (WDT_INTENCLR reset_value) Interrupt Enable Clear */
Kojto 111:4336505e4b1c 207
Kojto 111:4336505e4b1c 208 #define WDT_INTENCLR_EW_Pos 0 /**< \brief (WDT_INTENCLR) Early Warning Interrupt Enable */
Kojto 111:4336505e4b1c 209 #define WDT_INTENCLR_EW (0x1ul << WDT_INTENCLR_EW_Pos)
Kojto 111:4336505e4b1c 210 #define WDT_INTENCLR_MASK 0x01ul /**< \brief (WDT_INTENCLR) MASK Register */
Kojto 111:4336505e4b1c 211
Kojto 111:4336505e4b1c 212 /* -------- WDT_INTENSET : (WDT Offset: 0x5) (R/W 8) Interrupt Enable Set -------- */
Kojto 111:4336505e4b1c 213 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
Kojto 111:4336505e4b1c 214 typedef union {
Kojto 111:4336505e4b1c 215 struct {
Kojto 111:4336505e4b1c 216 uint8_t EW:1; /*!< bit: 0 Early Warning Interrupt Enable */
Kojto 111:4336505e4b1c 217 uint8_t :7; /*!< bit: 1.. 7 Reserved */
Kojto 111:4336505e4b1c 218 } bit; /*!< Structure used for bit access */
Kojto 111:4336505e4b1c 219 uint8_t reg; /*!< Type used for register access */
Kojto 111:4336505e4b1c 220 } WDT_INTENSET_Type;
Kojto 111:4336505e4b1c 221 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
Kojto 111:4336505e4b1c 222
Kojto 111:4336505e4b1c 223 #define WDT_INTENSET_OFFSET 0x5 /**< \brief (WDT_INTENSET offset) Interrupt Enable Set */
Kojto 111:4336505e4b1c 224 #define WDT_INTENSET_RESETVALUE 0x00ul /**< \brief (WDT_INTENSET reset_value) Interrupt Enable Set */
Kojto 111:4336505e4b1c 225
Kojto 111:4336505e4b1c 226 #define WDT_INTENSET_EW_Pos 0 /**< \brief (WDT_INTENSET) Early Warning Interrupt Enable */
Kojto 111:4336505e4b1c 227 #define WDT_INTENSET_EW (0x1ul << WDT_INTENSET_EW_Pos)
Kojto 111:4336505e4b1c 228 #define WDT_INTENSET_MASK 0x01ul /**< \brief (WDT_INTENSET) MASK Register */
Kojto 111:4336505e4b1c 229
Kojto 111:4336505e4b1c 230 /* -------- WDT_INTFLAG : (WDT Offset: 0x6) (R/W 8) Interrupt Flag Status and Clear -------- */
Kojto 111:4336505e4b1c 231 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
Kojto 111:4336505e4b1c 232 typedef union { // __I to avoid read-modify-write on write-to-clear register
Kojto 111:4336505e4b1c 233 struct {
Kojto 111:4336505e4b1c 234 __I uint8_t EW:1; /*!< bit: 0 Early Warning */
Kojto 111:4336505e4b1c 235 __I uint8_t :7; /*!< bit: 1.. 7 Reserved */
Kojto 111:4336505e4b1c 236 } bit; /*!< Structure used for bit access */
Kojto 111:4336505e4b1c 237 uint8_t reg; /*!< Type used for register access */
Kojto 111:4336505e4b1c 238 } WDT_INTFLAG_Type;
Kojto 111:4336505e4b1c 239 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
Kojto 111:4336505e4b1c 240
Kojto 111:4336505e4b1c 241 #define WDT_INTFLAG_OFFSET 0x6 /**< \brief (WDT_INTFLAG offset) Interrupt Flag Status and Clear */
Kojto 111:4336505e4b1c 242 #define WDT_INTFLAG_RESETVALUE 0x00ul /**< \brief (WDT_INTFLAG reset_value) Interrupt Flag Status and Clear */
Kojto 111:4336505e4b1c 243
Kojto 111:4336505e4b1c 244 #define WDT_INTFLAG_EW_Pos 0 /**< \brief (WDT_INTFLAG) Early Warning */
Kojto 111:4336505e4b1c 245 #define WDT_INTFLAG_EW (0x1ul << WDT_INTFLAG_EW_Pos)
Kojto 111:4336505e4b1c 246 #define WDT_INTFLAG_MASK 0x01ul /**< \brief (WDT_INTFLAG) MASK Register */
Kojto 111:4336505e4b1c 247
Kojto 111:4336505e4b1c 248 /* -------- WDT_STATUS : (WDT Offset: 0x7) (R/ 8) Status -------- */
Kojto 111:4336505e4b1c 249 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
Kojto 111:4336505e4b1c 250 typedef union {
Kojto 111:4336505e4b1c 251 struct {
Kojto 111:4336505e4b1c 252 uint8_t :7; /*!< bit: 0.. 6 Reserved */
Kojto 111:4336505e4b1c 253 uint8_t SYNCBUSY:1; /*!< bit: 7 Synchronization Busy */
Kojto 111:4336505e4b1c 254 } bit; /*!< Structure used for bit access */
Kojto 111:4336505e4b1c 255 uint8_t reg; /*!< Type used for register access */
Kojto 111:4336505e4b1c 256 } WDT_STATUS_Type;
Kojto 111:4336505e4b1c 257 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
Kojto 111:4336505e4b1c 258
Kojto 111:4336505e4b1c 259 #define WDT_STATUS_OFFSET 0x7 /**< \brief (WDT_STATUS offset) Status */
Kojto 111:4336505e4b1c 260 #define WDT_STATUS_RESETVALUE 0x00ul /**< \brief (WDT_STATUS reset_value) Status */
Kojto 111:4336505e4b1c 261
Kojto 111:4336505e4b1c 262 #define WDT_STATUS_SYNCBUSY_Pos 7 /**< \brief (WDT_STATUS) Synchronization Busy */
Kojto 111:4336505e4b1c 263 #define WDT_STATUS_SYNCBUSY (0x1ul << WDT_STATUS_SYNCBUSY_Pos)
Kojto 111:4336505e4b1c 264 #define WDT_STATUS_MASK 0x80ul /**< \brief (WDT_STATUS) MASK Register */
Kojto 111:4336505e4b1c 265
Kojto 111:4336505e4b1c 266 /* -------- WDT_CLEAR : (WDT Offset: 0x8) ( /W 8) Clear -------- */
Kojto 111:4336505e4b1c 267 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
Kojto 111:4336505e4b1c 268 typedef union {
Kojto 111:4336505e4b1c 269 struct {
Kojto 111:4336505e4b1c 270 uint8_t CLEAR:8; /*!< bit: 0.. 7 Watchdog Clear */
Kojto 111:4336505e4b1c 271 } bit; /*!< Structure used for bit access */
Kojto 111:4336505e4b1c 272 uint8_t reg; /*!< Type used for register access */
Kojto 111:4336505e4b1c 273 } WDT_CLEAR_Type;
Kojto 111:4336505e4b1c 274 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
Kojto 111:4336505e4b1c 275
Kojto 111:4336505e4b1c 276 #define WDT_CLEAR_OFFSET 0x8 /**< \brief (WDT_CLEAR offset) Clear */
Kojto 111:4336505e4b1c 277 #define WDT_CLEAR_RESETVALUE 0x00ul /**< \brief (WDT_CLEAR reset_value) Clear */
Kojto 111:4336505e4b1c 278
Kojto 111:4336505e4b1c 279 #define WDT_CLEAR_CLEAR_Pos 0 /**< \brief (WDT_CLEAR) Watchdog Clear */
Kojto 111:4336505e4b1c 280 #define WDT_CLEAR_CLEAR_Msk (0xFFul << WDT_CLEAR_CLEAR_Pos)
Kojto 111:4336505e4b1c 281 #define WDT_CLEAR_CLEAR(value) (WDT_CLEAR_CLEAR_Msk & ((value) << WDT_CLEAR_CLEAR_Pos))
Kojto 111:4336505e4b1c 282 #define WDT_CLEAR_CLEAR_KEY_Val 0xA5ul /**< \brief (WDT_CLEAR) Clear Key */
Kojto 111:4336505e4b1c 283 #define WDT_CLEAR_CLEAR_KEY (WDT_CLEAR_CLEAR_KEY_Val << WDT_CLEAR_CLEAR_Pos)
Kojto 111:4336505e4b1c 284 #define WDT_CLEAR_MASK 0xFFul /**< \brief (WDT_CLEAR) MASK Register */
Kojto 111:4336505e4b1c 285
Kojto 111:4336505e4b1c 286 /** \brief WDT hardware registers */
Kojto 111:4336505e4b1c 287 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
Kojto 111:4336505e4b1c 288 typedef struct {
Kojto 111:4336505e4b1c 289 __IO WDT_CTRL_Type CTRL; /**< \brief Offset: 0x0 (R/W 8) Control */
Kojto 111:4336505e4b1c 290 __IO WDT_CONFIG_Type CONFIG; /**< \brief Offset: 0x1 (R/W 8) Configuration */
Kojto 111:4336505e4b1c 291 __IO WDT_EWCTRL_Type EWCTRL; /**< \brief Offset: 0x2 (R/W 8) Early Warning Interrupt Control */
Kojto 111:4336505e4b1c 292 RoReg8 Reserved1[0x1];
Kojto 111:4336505e4b1c 293 __IO WDT_INTENCLR_Type INTENCLR; /**< \brief Offset: 0x4 (R/W 8) Interrupt Enable Clear */
Kojto 111:4336505e4b1c 294 __IO WDT_INTENSET_Type INTENSET; /**< \brief Offset: 0x5 (R/W 8) Interrupt Enable Set */
Kojto 111:4336505e4b1c 295 __IO WDT_INTFLAG_Type INTFLAG; /**< \brief Offset: 0x6 (R/W 8) Interrupt Flag Status and Clear */
Kojto 111:4336505e4b1c 296 __I WDT_STATUS_Type STATUS; /**< \brief Offset: 0x7 (R/ 8) Status */
Kojto 111:4336505e4b1c 297 __O WDT_CLEAR_Type CLEAR; /**< \brief Offset: 0x8 ( /W 8) Clear */
Kojto 111:4336505e4b1c 298 } Wdt;
Kojto 111:4336505e4b1c 299 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
Kojto 111:4336505e4b1c 300
Kojto 111:4336505e4b1c 301 /*@}*/
Kojto 111:4336505e4b1c 302
Kojto 111:4336505e4b1c 303 #endif /* _SAMR21_WDT_COMPONENT_ */