Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: hello SerialTestv11 SerialTestv12 Sierpinski ... more
TARGET_NUCLEO_F303RE/stm32f3xx_hal_iwdg.h@123:b0220dba8be7, 2016-08-12 (annotated)
- Committer:
- Kojto
- Date:
- Fri Aug 12 13:04:35 2016 +0200
- Revision:
- 123:b0220dba8be7
- Parent:
- 122:f9eeca106725
Release 123 of the mbed library
Changes:
- new targets: nucleo_f207zg, beetle, nrf51_dk, hexiwear,
nuvoton nuc472, vk rz a1h
- ST - fix timer interrupt handler, sleep api fix
- NXP - lpc15xx us ticker fix
- Nordic - analogin fixes, LF clock init addition, enable i2c async
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Kojto | 93:e188a91d3eaa | 1 | /** |
Kojto | 93:e188a91d3eaa | 2 | ****************************************************************************** |
Kojto | 93:e188a91d3eaa | 3 | * @file stm32f3xx_hal_iwdg.h |
Kojto | 93:e188a91d3eaa | 4 | * @author MCD Application Team |
Kojto | 123:b0220dba8be7 | 5 | * @version V1.3.0 |
Kojto | 123:b0220dba8be7 | 6 | * @date 01-July-2016 |
Kojto | 93:e188a91d3eaa | 7 | * @brief Header file of IWDG HAL module. |
Kojto | 93:e188a91d3eaa | 8 | ****************************************************************************** |
Kojto | 93:e188a91d3eaa | 9 | * @attention |
Kojto | 93:e188a91d3eaa | 10 | * |
Kojto | 122:f9eeca106725 | 11 | * <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2> |
Kojto | 93:e188a91d3eaa | 12 | * |
Kojto | 93:e188a91d3eaa | 13 | * Redistribution and use in source and binary forms, with or without modification, |
Kojto | 93:e188a91d3eaa | 14 | * are permitted provided that the following conditions are met: |
Kojto | 93:e188a91d3eaa | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
Kojto | 93:e188a91d3eaa | 16 | * this list of conditions and the following disclaimer. |
Kojto | 93:e188a91d3eaa | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
Kojto | 93:e188a91d3eaa | 18 | * this list of conditions and the following disclaimer in the documentation |
Kojto | 93:e188a91d3eaa | 19 | * and/or other materials provided with the distribution. |
Kojto | 93:e188a91d3eaa | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
Kojto | 93:e188a91d3eaa | 21 | * may be used to endorse or promote products derived from this software |
Kojto | 93:e188a91d3eaa | 22 | * without specific prior written permission. |
Kojto | 93:e188a91d3eaa | 23 | * |
Kojto | 93:e188a91d3eaa | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
Kojto | 93:e188a91d3eaa | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
Kojto | 93:e188a91d3eaa | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
Kojto | 93:e188a91d3eaa | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
Kojto | 93:e188a91d3eaa | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
Kojto | 93:e188a91d3eaa | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
Kojto | 93:e188a91d3eaa | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
Kojto | 93:e188a91d3eaa | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
Kojto | 93:e188a91d3eaa | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
Kojto | 93:e188a91d3eaa | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Kojto | 93:e188a91d3eaa | 34 | * |
Kojto | 122:f9eeca106725 | 35 | ****************************************************************************** |
Kojto | 93:e188a91d3eaa | 36 | */ |
Kojto | 93:e188a91d3eaa | 37 | |
Kojto | 93:e188a91d3eaa | 38 | /* Define to prevent recursive inclusion -------------------------------------*/ |
Kojto | 93:e188a91d3eaa | 39 | #ifndef __STM32F3xx_HAL_IWDG_H |
Kojto | 93:e188a91d3eaa | 40 | #define __STM32F3xx_HAL_IWDG_H |
Kojto | 93:e188a91d3eaa | 41 | |
Kojto | 93:e188a91d3eaa | 42 | #ifdef __cplusplus |
Kojto | 93:e188a91d3eaa | 43 | extern "C" { |
Kojto | 93:e188a91d3eaa | 44 | #endif |
Kojto | 93:e188a91d3eaa | 45 | |
Kojto | 93:e188a91d3eaa | 46 | /* Includes ------------------------------------------------------------------*/ |
Kojto | 93:e188a91d3eaa | 47 | #include "stm32f3xx_hal_def.h" |
Kojto | 93:e188a91d3eaa | 48 | |
Kojto | 93:e188a91d3eaa | 49 | /** @addtogroup STM32F3xx_HAL_Driver |
Kojto | 93:e188a91d3eaa | 50 | * @{ |
Kojto | 93:e188a91d3eaa | 51 | */ |
Kojto | 93:e188a91d3eaa | 52 | |
Kojto | 123:b0220dba8be7 | 53 | /** @defgroup IWDG IWDG |
Kojto | 93:e188a91d3eaa | 54 | * @{ |
Kojto | 122:f9eeca106725 | 55 | */ |
Kojto | 93:e188a91d3eaa | 56 | |
Kojto | 122:f9eeca106725 | 57 | /* Exported types ------------------------------------------------------------*/ |
Kojto | 93:e188a91d3eaa | 58 | /** @defgroup IWDG_Exported_Types IWDG Exported Types |
Kojto | 93:e188a91d3eaa | 59 | * @{ |
Kojto | 93:e188a91d3eaa | 60 | */ |
Kojto | 93:e188a91d3eaa | 61 | |
Kojto | 93:e188a91d3eaa | 62 | /** |
Kojto | 122:f9eeca106725 | 63 | * @brief IWDG Init structure definition |
Kojto | 93:e188a91d3eaa | 64 | */ |
Kojto | 93:e188a91d3eaa | 65 | typedef struct |
Kojto | 93:e188a91d3eaa | 66 | { |
Kojto | 122:f9eeca106725 | 67 | uint32_t Prescaler; /*!< Select the prescaler of the IWDG. |
Kojto | 122:f9eeca106725 | 68 | This parameter can be a value of @ref IWDG_Prescaler */ |
Kojto | 122:f9eeca106725 | 69 | |
Kojto | 122:f9eeca106725 | 70 | uint32_t Reload; /*!< Specifies the IWDG down-counter reload value. |
Kojto | 122:f9eeca106725 | 71 | This parameter must be a number between Min_Data = 0 and Max_Data = 0x0FFF */ |
Kojto | 122:f9eeca106725 | 72 | |
Kojto | 122:f9eeca106725 | 73 | uint32_t Window; /*!< Specifies the window value to be compared to the down-counter. |
Kojto | 122:f9eeca106725 | 74 | This parameter must be a number between Min_Data = 0 and Max_Data = 0x0FFF */ |
Kojto | 93:e188a91d3eaa | 75 | |
Kojto | 93:e188a91d3eaa | 76 | } IWDG_InitTypeDef; |
Kojto | 93:e188a91d3eaa | 77 | |
Kojto | 93:e188a91d3eaa | 78 | /** |
Kojto | 93:e188a91d3eaa | 79 | * @brief IWDG Handle Structure definition |
Kojto | 122:f9eeca106725 | 80 | */ |
Kojto | 93:e188a91d3eaa | 81 | typedef struct |
Kojto | 93:e188a91d3eaa | 82 | { |
Kojto | 122:f9eeca106725 | 83 | IWDG_TypeDef *Instance; /*!< Register base address */ |
Kojto | 122:f9eeca106725 | 84 | |
Kojto | 122:f9eeca106725 | 85 | IWDG_InitTypeDef Init; /*!< IWDG required parameters */ |
Kojto | 122:f9eeca106725 | 86 | |
Kojto | 93:e188a91d3eaa | 87 | }IWDG_HandleTypeDef; |
Kojto | 93:e188a91d3eaa | 88 | |
Kojto | 93:e188a91d3eaa | 89 | /** |
Kojto | 93:e188a91d3eaa | 90 | * @} |
Kojto | 93:e188a91d3eaa | 91 | */ |
Kojto | 93:e188a91d3eaa | 92 | |
Kojto | 93:e188a91d3eaa | 93 | /* Exported constants --------------------------------------------------------*/ |
Kojto | 93:e188a91d3eaa | 94 | /** @defgroup IWDG_Exported_Constants IWDG Exported Constants |
Kojto | 93:e188a91d3eaa | 95 | * @{ |
Kojto | 93:e188a91d3eaa | 96 | */ |
Kojto | 93:e188a91d3eaa | 97 | |
Kojto | 93:e188a91d3eaa | 98 | /** @defgroup IWDG_Prescaler IWDG Prescaler |
Kojto | 93:e188a91d3eaa | 99 | * @{ |
Kojto | 122:f9eeca106725 | 100 | */ |
Kojto | 123:b0220dba8be7 | 101 | #define IWDG_PRESCALER_4 0x00000000u /*!< IWDG prescaler set to 4 */ |
Kojto | 123:b0220dba8be7 | 102 | #define IWDG_PRESCALER_8 IWDG_PR_PR_0 /*!< IWDG prescaler set to 8 */ |
Kojto | 123:b0220dba8be7 | 103 | #define IWDG_PRESCALER_16 IWDG_PR_PR_1 /*!< IWDG prescaler set to 16 */ |
Kojto | 123:b0220dba8be7 | 104 | #define IWDG_PRESCALER_32 (IWDG_PR_PR_1 | IWDG_PR_PR_0) /*!< IWDG prescaler set to 32 */ |
Kojto | 123:b0220dba8be7 | 105 | #define IWDG_PRESCALER_64 IWDG_PR_PR_2 /*!< IWDG prescaler set to 64 */ |
Kojto | 123:b0220dba8be7 | 106 | #define IWDG_PRESCALER_128 (IWDG_PR_PR_2 | IWDG_PR_PR_0) /*!< IWDG prescaler set to 128 */ |
Kojto | 123:b0220dba8be7 | 107 | #define IWDG_PRESCALER_256 (IWDG_PR_PR_2 | IWDG_PR_PR_1) /*!< IWDG prescaler set to 256 */ |
Kojto | 93:e188a91d3eaa | 108 | /** |
Kojto | 93:e188a91d3eaa | 109 | * @} |
Kojto | 93:e188a91d3eaa | 110 | */ |
Kojto | 93:e188a91d3eaa | 111 | |
Kojto | 123:b0220dba8be7 | 112 | /** @defgroup IWDG_Window_option IWDG Window option |
Kojto | 93:e188a91d3eaa | 113 | * @{ |
Kojto | 122:f9eeca106725 | 114 | */ |
Kojto | 123:b0220dba8be7 | 115 | #define IWDG_WINDOW_DISABLE IWDG_WINR_WIN |
Kojto | 93:e188a91d3eaa | 116 | /** |
Kojto | 93:e188a91d3eaa | 117 | * @} |
Kojto | 93:e188a91d3eaa | 118 | */ |
Kojto | 93:e188a91d3eaa | 119 | |
Kojto | 93:e188a91d3eaa | 120 | /** |
Kojto | 93:e188a91d3eaa | 121 | * @} |
Kojto | 93:e188a91d3eaa | 122 | */ |
Kojto | 93:e188a91d3eaa | 123 | |
Kojto | 93:e188a91d3eaa | 124 | /* Exported macros -----------------------------------------------------------*/ |
Kojto | 122:f9eeca106725 | 125 | /** @defgroup IWDG_Exported_Macros IWDG Exported Macros |
Kojto | 122:f9eeca106725 | 126 | * @{ |
Kojto | 122:f9eeca106725 | 127 | */ |
Kojto | 93:e188a91d3eaa | 128 | |
Kojto | 93:e188a91d3eaa | 129 | /** |
Kojto | 122:f9eeca106725 | 130 | * @brief Enable the IWDG peripheral. |
Kojto | 123:b0220dba8be7 | 131 | * @param __HANDLE__ IWDG handle |
Kojto | 93:e188a91d3eaa | 132 | * @retval None |
Kojto | 93:e188a91d3eaa | 133 | */ |
Kojto | 122:f9eeca106725 | 134 | #define __HAL_IWDG_START(__HANDLE__) WRITE_REG((__HANDLE__)->Instance->KR, IWDG_KEY_ENABLE) |
Kojto | 93:e188a91d3eaa | 135 | |
Kojto | 93:e188a91d3eaa | 136 | /** |
Kojto | 123:b0220dba8be7 | 137 | * @brief Reload IWDG counter with value defined in the reload register |
Kojto | 123:b0220dba8be7 | 138 | * (write access to IWDG_PR, IWDG_RLR & IWDG_WINR registers disabled). |
Kojto | 123:b0220dba8be7 | 139 | * @param __HANDLE__ IWDG handle |
Kojto | 93:e188a91d3eaa | 140 | * @retval None |
Kojto | 93:e188a91d3eaa | 141 | */ |
Kojto | 122:f9eeca106725 | 142 | #define __HAL_IWDG_RELOAD_COUNTER(__HANDLE__) WRITE_REG((__HANDLE__)->Instance->KR, IWDG_KEY_RELOAD) |
Kojto | 93:e188a91d3eaa | 143 | |
Kojto | 93:e188a91d3eaa | 144 | /** |
Kojto | 93:e188a91d3eaa | 145 | * @} |
Kojto | 93:e188a91d3eaa | 146 | */ |
Kojto | 93:e188a91d3eaa | 147 | |
Kojto | 93:e188a91d3eaa | 148 | /* Exported functions --------------------------------------------------------*/ |
Kojto | 123:b0220dba8be7 | 149 | /** @defgroup IWDG_Exported_Functions IWDG Exported Functions |
Kojto | 93:e188a91d3eaa | 150 | * @{ |
Kojto | 93:e188a91d3eaa | 151 | */ |
Kojto | 93:e188a91d3eaa | 152 | |
Kojto | 123:b0220dba8be7 | 153 | /** @defgroup IWDG_Exported_Functions_Group1 Initialization and Start functions |
Kojto | 93:e188a91d3eaa | 154 | * @{ |
Kojto | 93:e188a91d3eaa | 155 | */ |
Kojto | 123:b0220dba8be7 | 156 | /* Initialization/Start functions ********************************************/ |
Kojto | 93:e188a91d3eaa | 157 | HAL_StatusTypeDef HAL_IWDG_Init(IWDG_HandleTypeDef *hiwdg); |
Kojto | 93:e188a91d3eaa | 158 | /** |
Kojto | 93:e188a91d3eaa | 159 | * @} |
Kojto | 93:e188a91d3eaa | 160 | */ |
Kojto | 122:f9eeca106725 | 161 | |
Kojto | 123:b0220dba8be7 | 162 | /** @defgroup IWDG_Exported_Functions_Group2 IO operation functions |
Kojto | 93:e188a91d3eaa | 163 | * @{ |
Kojto | 93:e188a91d3eaa | 164 | */ |
Kojto | 93:e188a91d3eaa | 165 | /* I/O operation functions ****************************************************/ |
Kojto | 93:e188a91d3eaa | 166 | HAL_StatusTypeDef HAL_IWDG_Refresh(IWDG_HandleTypeDef *hiwdg); |
Kojto | 93:e188a91d3eaa | 167 | /** |
Kojto | 93:e188a91d3eaa | 168 | * @} |
Kojto | 93:e188a91d3eaa | 169 | */ |
Kojto | 122:f9eeca106725 | 170 | |
Kojto | 93:e188a91d3eaa | 171 | /** |
Kojto | 93:e188a91d3eaa | 172 | * @} |
Kojto | 122:f9eeca106725 | 173 | */ |
Kojto | 122:f9eeca106725 | 174 | |
Kojto | 122:f9eeca106725 | 175 | /* Private constants ---------------------------------------------------------*/ |
Kojto | 123:b0220dba8be7 | 176 | /** @defgroup IWDG_Private_Constants IWDG Private Constants |
Kojto | 122:f9eeca106725 | 177 | * @{ |
Kojto | 122:f9eeca106725 | 178 | */ |
Kojto | 122:f9eeca106725 | 179 | /** |
Kojto | 122:f9eeca106725 | 180 | * @brief IWDG Key Register BitMask |
Kojto | 122:f9eeca106725 | 181 | */ |
Kojto | 123:b0220dba8be7 | 182 | #define IWDG_KEY_RELOAD 0x0000AAAAu /*!< IWDG Reload Counter Enable */ |
Kojto | 123:b0220dba8be7 | 183 | #define IWDG_KEY_ENABLE 0x0000CCCCu /*!< IWDG Peripheral Enable */ |
Kojto | 123:b0220dba8be7 | 184 | #define IWDG_KEY_WRITE_ACCESS_ENABLE 0x00005555u /*!< IWDG KR Write Access Enable */ |
Kojto | 123:b0220dba8be7 | 185 | #define IWDG_KEY_WRITE_ACCESS_DISABLE 0x00000000u /*!< IWDG KR Write Access Disable */ |
Kojto | 93:e188a91d3eaa | 186 | |
Kojto | 93:e188a91d3eaa | 187 | /** |
Kojto | 93:e188a91d3eaa | 188 | * @} |
Kojto | 122:f9eeca106725 | 189 | */ |
Kojto | 122:f9eeca106725 | 190 | |
Kojto | 122:f9eeca106725 | 191 | /* Private macros ------------------------------------------------------------*/ |
Kojto | 123:b0220dba8be7 | 192 | /** @defgroup IWDG_Private_Macros IWDG Private Macros |
Kojto | 122:f9eeca106725 | 193 | * @{ |
Kojto | 122:f9eeca106725 | 194 | */ |
Kojto | 122:f9eeca106725 | 195 | /** |
Kojto | 123:b0220dba8be7 | 196 | * @brief Enable write access to IWDG_PR, IWDG_RLR and IWDG_WINR registers. |
Kojto | 123:b0220dba8be7 | 197 | * @param __HANDLE__ IWDG handle |
Kojto | 122:f9eeca106725 | 198 | * @retval None |
Kojto | 122:f9eeca106725 | 199 | */ |
Kojto | 122:f9eeca106725 | 200 | #define IWDG_ENABLE_WRITE_ACCESS(__HANDLE__) WRITE_REG((__HANDLE__)->Instance->KR, IWDG_KEY_WRITE_ACCESS_ENABLE) |
Kojto | 122:f9eeca106725 | 201 | |
Kojto | 122:f9eeca106725 | 202 | /** |
Kojto | 123:b0220dba8be7 | 203 | * @brief Disable write access to IWDG_PR, IWDG_RLR and IWDG_WINR registers. |
Kojto | 123:b0220dba8be7 | 204 | * @param __HANDLE__ IWDG handle |
Kojto | 122:f9eeca106725 | 205 | * @retval None |
Kojto | 122:f9eeca106725 | 206 | */ |
Kojto | 122:f9eeca106725 | 207 | #define IWDG_DISABLE_WRITE_ACCESS(__HANDLE__) WRITE_REG((__HANDLE__)->Instance->KR, IWDG_KEY_WRITE_ACCESS_DISABLE) |
Kojto | 122:f9eeca106725 | 208 | |
Kojto | 122:f9eeca106725 | 209 | /** |
Kojto | 122:f9eeca106725 | 210 | * @brief Check IWDG prescaler value. |
Kojto | 123:b0220dba8be7 | 211 | * @param __PRESCALER__ IWDG prescaler value |
Kojto | 122:f9eeca106725 | 212 | * @retval None |
Kojto | 122:f9eeca106725 | 213 | */ |
Kojto | 122:f9eeca106725 | 214 | #define IS_IWDG_PRESCALER(__PRESCALER__) (((__PRESCALER__) == IWDG_PRESCALER_4) || \ |
Kojto | 122:f9eeca106725 | 215 | ((__PRESCALER__) == IWDG_PRESCALER_8) || \ |
Kojto | 122:f9eeca106725 | 216 | ((__PRESCALER__) == IWDG_PRESCALER_16) || \ |
Kojto | 122:f9eeca106725 | 217 | ((__PRESCALER__) == IWDG_PRESCALER_32) || \ |
Kojto | 122:f9eeca106725 | 218 | ((__PRESCALER__) == IWDG_PRESCALER_64) || \ |
Kojto | 122:f9eeca106725 | 219 | ((__PRESCALER__) == IWDG_PRESCALER_128)|| \ |
Kojto | 122:f9eeca106725 | 220 | ((__PRESCALER__) == IWDG_PRESCALER_256)) |
Kojto | 122:f9eeca106725 | 221 | |
Kojto | 122:f9eeca106725 | 222 | /** |
Kojto | 122:f9eeca106725 | 223 | * @brief Check IWDG reload value. |
Kojto | 123:b0220dba8be7 | 224 | * @param __RELOAD__ IWDG reload value |
Kojto | 122:f9eeca106725 | 225 | * @retval None |
Kojto | 122:f9eeca106725 | 226 | */ |
Kojto | 123:b0220dba8be7 | 227 | #define IS_IWDG_RELOAD(__RELOAD__) ((__RELOAD__) <= IWDG_RLR_RL) |
Kojto | 122:f9eeca106725 | 228 | |
Kojto | 122:f9eeca106725 | 229 | /** |
Kojto | 122:f9eeca106725 | 230 | * @brief Check IWDG window value. |
Kojto | 123:b0220dba8be7 | 231 | * @param __WINDOW__ IWDG window value |
Kojto | 122:f9eeca106725 | 232 | * @retval None |
Kojto | 122:f9eeca106725 | 233 | */ |
Kojto | 123:b0220dba8be7 | 234 | #define IS_IWDG_WINDOW(__WINDOW__) ((__WINDOW__) <= IWDG_WINR_WIN) |
Kojto | 93:e188a91d3eaa | 235 | |
Kojto | 93:e188a91d3eaa | 236 | /** |
Kojto | 93:e188a91d3eaa | 237 | * @} |
Kojto | 122:f9eeca106725 | 238 | */ |
Kojto | 93:e188a91d3eaa | 239 | |
Kojto | 93:e188a91d3eaa | 240 | /** |
Kojto | 93:e188a91d3eaa | 241 | * @} |
Kojto | 122:f9eeca106725 | 242 | */ |
Kojto | 122:f9eeca106725 | 243 | |
Kojto | 122:f9eeca106725 | 244 | /** |
Kojto | 122:f9eeca106725 | 245 | * @} |
Kojto | 122:f9eeca106725 | 246 | */ |
Kojto | 122:f9eeca106725 | 247 | |
Kojto | 122:f9eeca106725 | 248 | |
Kojto | 93:e188a91d3eaa | 249 | #ifdef __cplusplus |
Kojto | 93:e188a91d3eaa | 250 | } |
Kojto | 93:e188a91d3eaa | 251 | #endif |
Kojto | 93:e188a91d3eaa | 252 | |
Kojto | 122:f9eeca106725 | 253 | #endif /* __STM32L4xx_HAL_IWDG_H */ |
Kojto | 93:e188a91d3eaa | 254 | |
Kojto | 93:e188a91d3eaa | 255 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |