The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.
Dependents: hello SerialTestv11 SerialTestv12 Sierpinski ... more
mbed 2
This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.
TARGET_ARCH_MAX/stm32f4xx_hal_iwdg.h@122:f9eeca106725, 2016-07-07 (annotated)
- Committer:
- Kojto
- Date:
- Thu Jul 07 14:34:11 2016 +0100
- Revision:
- 122:f9eeca106725
- Parent:
- 110:165afa46840b
Release 122 of the mbed library
Changes:
- new targets - Nucleo L432KC, Beetle, Nucleo F446ZE, Nucleo L011K4
- Thread safety addition - mbed API should contain a statement about thread safety
- critical section API addition
- CAS API (core_util_atomic_incr/decr)
- DEVICE_ are generated from targets.json file, device.h deprecated
- Callback replaces FunctionPointer to provide std like interface
- mbed HAL API docs improvements
- toolchain - prexif attributes with MBED_
- add new attributes - packed, weak, forcedinline, align
- target.json - contains targets definitions
- ST - L1XX - Cube update to 1.5
- SPI clock selection fix (clock from APB domain)
- F7 - Cube update v1.4.0
- L0 - baudrate init fix
- L1 - Cube update v1.5
- F3 - baudrate init fix, 3 targets CAN support
- F4 - Cube update v1.12.0, 3 targets CAN support
- L4XX - Cube update v1.5.1
- F0 - update Cube to v1.5.0
- L4 - 2 targets (L476RG/VG) CAN support
- NXP - pwm clock fix for KSDK2 MCU
- LPC2368 - remove ARM toolchain support - due to regression
- KSDK2 - fix SPI , I2C address and repeat start
- Silabs - some fixes backported from mbed 3
- Renesas - RZ_A1H - SystemCoreClockUpdate addition
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
bogdanm | 89:552587b429a1 | 1 | /** |
bogdanm | 89:552587b429a1 | 2 | ****************************************************************************** |
bogdanm | 89:552587b429a1 | 3 | * @file stm32f4xx_hal_iwdg.h |
bogdanm | 89:552587b429a1 | 4 | * @author MCD Application Team |
Kojto | 122:f9eeca106725 | 5 | * @version V1.5.0 |
Kojto | 122:f9eeca106725 | 6 | * @date 06-May-2016 |
bogdanm | 89:552587b429a1 | 7 | * @brief Header file of IWDG HAL module. |
bogdanm | 89:552587b429a1 | 8 | ****************************************************************************** |
bogdanm | 89:552587b429a1 | 9 | * @attention |
bogdanm | 89:552587b429a1 | 10 | * |
Kojto | 122:f9eeca106725 | 11 | * <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2> |
bogdanm | 89:552587b429a1 | 12 | * |
bogdanm | 89:552587b429a1 | 13 | * Redistribution and use in source and binary forms, with or without modification, |
bogdanm | 89:552587b429a1 | 14 | * are permitted provided that the following conditions are met: |
bogdanm | 89:552587b429a1 | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
bogdanm | 89:552587b429a1 | 16 | * this list of conditions and the following disclaimer. |
bogdanm | 89:552587b429a1 | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
bogdanm | 89:552587b429a1 | 18 | * this list of conditions and the following disclaimer in the documentation |
bogdanm | 89:552587b429a1 | 19 | * and/or other materials provided with the distribution. |
bogdanm | 89:552587b429a1 | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
bogdanm | 89:552587b429a1 | 21 | * may be used to endorse or promote products derived from this software |
bogdanm | 89:552587b429a1 | 22 | * without specific prior written permission. |
bogdanm | 89:552587b429a1 | 23 | * |
bogdanm | 89:552587b429a1 | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
bogdanm | 89:552587b429a1 | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
bogdanm | 89:552587b429a1 | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
bogdanm | 89:552587b429a1 | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
bogdanm | 89:552587b429a1 | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
bogdanm | 89:552587b429a1 | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
bogdanm | 89:552587b429a1 | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
bogdanm | 89:552587b429a1 | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
bogdanm | 89:552587b429a1 | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
bogdanm | 89:552587b429a1 | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
bogdanm | 89:552587b429a1 | 34 | * |
bogdanm | 89:552587b429a1 | 35 | ****************************************************************************** |
Kojto | 122:f9eeca106725 | 36 | */ |
bogdanm | 89:552587b429a1 | 37 | |
bogdanm | 89:552587b429a1 | 38 | /* Define to prevent recursive inclusion -------------------------------------*/ |
bogdanm | 89:552587b429a1 | 39 | #ifndef __STM32F4xx_HAL_IWDG_H |
bogdanm | 89:552587b429a1 | 40 | #define __STM32F4xx_HAL_IWDG_H |
bogdanm | 89:552587b429a1 | 41 | |
bogdanm | 89:552587b429a1 | 42 | #ifdef __cplusplus |
bogdanm | 89:552587b429a1 | 43 | extern "C" { |
bogdanm | 89:552587b429a1 | 44 | #endif |
bogdanm | 89:552587b429a1 | 45 | |
bogdanm | 89:552587b429a1 | 46 | /* Includes ------------------------------------------------------------------*/ |
bogdanm | 89:552587b429a1 | 47 | #include "stm32f4xx_hal_def.h" |
bogdanm | 89:552587b429a1 | 48 | |
bogdanm | 89:552587b429a1 | 49 | /** @addtogroup STM32F4xx_HAL_Driver |
bogdanm | 89:552587b429a1 | 50 | * @{ |
bogdanm | 89:552587b429a1 | 51 | */ |
bogdanm | 89:552587b429a1 | 52 | |
bogdanm | 89:552587b429a1 | 53 | /** @addtogroup IWDG |
bogdanm | 89:552587b429a1 | 54 | * @{ |
Kojto | 122:f9eeca106725 | 55 | */ |
bogdanm | 89:552587b429a1 | 56 | |
bogdanm | 89:552587b429a1 | 57 | /* Exported types ------------------------------------------------------------*/ |
Kojto | 99:dbbf35b96557 | 58 | /** @defgroup IWDG_Exported_Types IWDG Exported Types |
Kojto | 99:dbbf35b96557 | 59 | * @{ |
Kojto | 99:dbbf35b96557 | 60 | */ |
bogdanm | 89:552587b429a1 | 61 | |
bogdanm | 89:552587b429a1 | 62 | /** |
Kojto | 122:f9eeca106725 | 63 | * @brief IWDG Init structure definition |
Kojto | 122:f9eeca106725 | 64 | */ |
bogdanm | 89:552587b429a1 | 65 | typedef struct |
bogdanm | 89:552587b429a1 | 66 | { |
Kojto | 122:f9eeca106725 | 67 | uint32_t Prescaler; /*!< Select the prescaler of the IWDG. |
bogdanm | 89:552587b429a1 | 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. |
bogdanm | 89:552587b429a1 | 71 | This parameter must be a number between Min_Data = 0 and Max_Data = 0x0FFF */ |
Kojto | 122:f9eeca106725 | 72 | |
Kojto | 122:f9eeca106725 | 73 | } IWDG_InitTypeDef; |
bogdanm | 89:552587b429a1 | 74 | |
Kojto | 122:f9eeca106725 | 75 | /** |
Kojto | 122:f9eeca106725 | 76 | * @brief IWDG Handle Structure definition |
Kojto | 122:f9eeca106725 | 77 | */ |
bogdanm | 89:552587b429a1 | 78 | typedef struct |
bogdanm | 89:552587b429a1 | 79 | { |
Kojto | 122:f9eeca106725 | 80 | IWDG_TypeDef *Instance; /*!< Register base address */ |
Kojto | 122:f9eeca106725 | 81 | |
bogdanm | 89:552587b429a1 | 82 | IWDG_InitTypeDef Init; /*!< IWDG required parameters */ |
Kojto | 122:f9eeca106725 | 83 | |
bogdanm | 89:552587b429a1 | 84 | }IWDG_HandleTypeDef; |
bogdanm | 89:552587b429a1 | 85 | |
bogdanm | 89:552587b429a1 | 86 | /** |
bogdanm | 89:552587b429a1 | 87 | * @} |
bogdanm | 89:552587b429a1 | 88 | */ |
bogdanm | 89:552587b429a1 | 89 | |
Kojto | 99:dbbf35b96557 | 90 | /* Exported constants --------------------------------------------------------*/ |
Kojto | 99:dbbf35b96557 | 91 | /** @defgroup IWDG_Exported_Constants IWDG Exported Constants |
Kojto | 99:dbbf35b96557 | 92 | * @{ |
Kojto | 99:dbbf35b96557 | 93 | */ |
Kojto | 99:dbbf35b96557 | 94 | |
Kojto | 122:f9eeca106725 | 95 | /** @defgroup IWDG_Prescaler IWDG Prescaler |
Kojto | 99:dbbf35b96557 | 96 | * @{ |
Kojto | 99:dbbf35b96557 | 97 | */ |
Kojto | 122:f9eeca106725 | 98 | #define IWDG_PRESCALER_4 0x00000000U /*!< IWDG prescaler set to 4 */ |
Kojto | 122:f9eeca106725 | 99 | #define IWDG_PRESCALER_8 IWDG_PR_PR_0 /*!< IWDG prescaler set to 8 */ |
Kojto | 122:f9eeca106725 | 100 | #define IWDG_PRESCALER_16 IWDG_PR_PR_1 /*!< IWDG prescaler set to 16 */ |
Kojto | 122:f9eeca106725 | 101 | #define IWDG_PRESCALER_32 (IWDG_PR_PR_1 | IWDG_PR_PR_0) /*!< IWDG prescaler set to 32 */ |
Kojto | 122:f9eeca106725 | 102 | #define IWDG_PRESCALER_64 IWDG_PR_PR_2 /*!< IWDG prescaler set to 64 */ |
Kojto | 122:f9eeca106725 | 103 | #define IWDG_PRESCALER_128 (IWDG_PR_PR_2 | IWDG_PR_PR_0) /*!< IWDG prescaler set to 128 */ |
Kojto | 122:f9eeca106725 | 104 | #define IWDG_PRESCALER_256 (IWDG_PR_PR_2 | IWDG_PR_PR_1) /*!< IWDG prescaler set to 256 */ |
Kojto | 99:dbbf35b96557 | 105 | /** |
Kojto | 99:dbbf35b96557 | 106 | * @} |
Kojto | 99:dbbf35b96557 | 107 | */ |
Kojto | 99:dbbf35b96557 | 108 | |
Kojto | 99:dbbf35b96557 | 109 | /** |
Kojto | 99:dbbf35b96557 | 110 | * @} |
Kojto | 99:dbbf35b96557 | 111 | */ |
Kojto | 99:dbbf35b96557 | 112 | |
bogdanm | 89:552587b429a1 | 113 | /** |
bogdanm | 89:552587b429a1 | 114 | * @} |
bogdanm | 89:552587b429a1 | 115 | */ |
bogdanm | 89:552587b429a1 | 116 | |
Kojto | 99:dbbf35b96557 | 117 | /* Exported macros -----------------------------------------------------------*/ |
Kojto | 99:dbbf35b96557 | 118 | /** @defgroup IWDG_Exported_Macros IWDG Exported Macros |
Kojto | 99:dbbf35b96557 | 119 | * @{ |
Kojto | 99:dbbf35b96557 | 120 | */ |
bogdanm | 89:552587b429a1 | 121 | |
Kojto | 122:f9eeca106725 | 122 | /** |
Kojto | 122:f9eeca106725 | 123 | * @brief Enable the IWDG peripheral. |
Kojto | 122:f9eeca106725 | 124 | * @param __HANDLE__ IWDG handle |
bogdanm | 89:552587b429a1 | 125 | * @retval None |
bogdanm | 89:552587b429a1 | 126 | */ |
Kojto | 122:f9eeca106725 | 127 | #define __HAL_IWDG_START(__HANDLE__) WRITE_REG((__HANDLE__)->Instance->KR, IWDG_KEY_ENABLE) |
bogdanm | 89:552587b429a1 | 128 | |
bogdanm | 89:552587b429a1 | 129 | /** |
Kojto | 122:f9eeca106725 | 130 | * @brief Reload IWDG counter with value defined in the reload register |
Kojto | 122:f9eeca106725 | 131 | * (write access to IWDG_PR & IWDG_RLR registers disabled). |
Kojto | 122:f9eeca106725 | 132 | * @param __HANDLE__ IWDG handle |
Kojto | 122:f9eeca106725 | 133 | * @retval None |
bogdanm | 89:552587b429a1 | 134 | */ |
Kojto | 122:f9eeca106725 | 135 | #define __HAL_IWDG_RELOAD_COUNTER(__HANDLE__) WRITE_REG((__HANDLE__)->Instance->KR, IWDG_KEY_RELOAD) |
bogdanm | 89:552587b429a1 | 136 | |
Kojto | 99:dbbf35b96557 | 137 | /** |
Kojto | 99:dbbf35b96557 | 138 | * @} |
Kojto | 99:dbbf35b96557 | 139 | */ |
bogdanm | 89:552587b429a1 | 140 | |
Kojto | 122:f9eeca106725 | 141 | /* Exported functions --------------------------------------------------------*/ |
Kojto | 122:f9eeca106725 | 142 | /** @defgroup IWDG_Exported_Functions IWDG Exported Functions |
Kojto | 99:dbbf35b96557 | 143 | * @{ |
Kojto | 99:dbbf35b96557 | 144 | */ |
Kojto | 122:f9eeca106725 | 145 | |
Kojto | 122:f9eeca106725 | 146 | /** @defgroup IWDG_Exported_Functions_Group1 Initialization and Start functions |
Kojto | 122:f9eeca106725 | 147 | * @{ |
Kojto | 122:f9eeca106725 | 148 | */ |
Kojto | 122:f9eeca106725 | 149 | /* Initialization/Start functions ********************************************/ |
Kojto | 122:f9eeca106725 | 150 | HAL_StatusTypeDef HAL_IWDG_Init(IWDG_HandleTypeDef *hiwdg); |
Kojto | 99:dbbf35b96557 | 151 | /** |
Kojto | 99:dbbf35b96557 | 152 | * @} |
Kojto | 99:dbbf35b96557 | 153 | */ |
bogdanm | 89:552587b429a1 | 154 | |
Kojto | 122:f9eeca106725 | 155 | /** @defgroup IWDG_Exported_Functions_Group2 IO operation functions |
Kojto | 99:dbbf35b96557 | 156 | * @{ |
Kojto | 99:dbbf35b96557 | 157 | */ |
Kojto | 122:f9eeca106725 | 158 | /* I/O operation functions ****************************************************/ |
Kojto | 122:f9eeca106725 | 159 | HAL_StatusTypeDef HAL_IWDG_Refresh(IWDG_HandleTypeDef *hiwdg); |
bogdanm | 89:552587b429a1 | 160 | /** |
bogdanm | 89:552587b429a1 | 161 | * @} |
Kojto | 99:dbbf35b96557 | 162 | */ |
Kojto | 99:dbbf35b96557 | 163 | |
Kojto | 99:dbbf35b96557 | 164 | /** |
Kojto | 99:dbbf35b96557 | 165 | * @} |
Kojto | 122:f9eeca106725 | 166 | */ |
Kojto | 122:f9eeca106725 | 167 | |
Kojto | 122:f9eeca106725 | 168 | /* Private constants ---------------------------------------------------------*/ |
Kojto | 122:f9eeca106725 | 169 | /** @defgroup IWDG_Private_Constants IWDG Private Constants |
Kojto | 122:f9eeca106725 | 170 | * @{ |
Kojto | 122:f9eeca106725 | 171 | */ |
Kojto | 99:dbbf35b96557 | 172 | |
Kojto | 122:f9eeca106725 | 173 | /** |
Kojto | 122:f9eeca106725 | 174 | * @brief IWDG Key Register BitMask |
Kojto | 122:f9eeca106725 | 175 | */ |
Kojto | 122:f9eeca106725 | 176 | #define IWDG_KEY_RELOAD 0x0000AAAAU /*!< IWDG Reload Counter Enable */ |
Kojto | 122:f9eeca106725 | 177 | #define IWDG_KEY_ENABLE 0x0000CCCCU /*!< IWDG Peripheral Enable */ |
Kojto | 122:f9eeca106725 | 178 | #define IWDG_KEY_WRITE_ACCESS_ENABLE 0x00005555U /*!< IWDG KR Write Access Enable */ |
Kojto | 122:f9eeca106725 | 179 | #define IWDG_KEY_WRITE_ACCESS_DISABLE 0x00000000U /*!< IWDG KR Write Access Disable */ |
Kojto | 122:f9eeca106725 | 180 | |
Kojto | 122:f9eeca106725 | 181 | /** |
Kojto | 122:f9eeca106725 | 182 | * @} |
Kojto | 122:f9eeca106725 | 183 | */ |
Kojto | 122:f9eeca106725 | 184 | |
Kojto | 122:f9eeca106725 | 185 | /* Private macros ------------------------------------------------------------*/ |
Kojto | 99:dbbf35b96557 | 186 | /** @defgroup IWDG_Private_Macros IWDG Private Macros |
Kojto | 99:dbbf35b96557 | 187 | * @{ |
Kojto | 99:dbbf35b96557 | 188 | */ |
Kojto | 99:dbbf35b96557 | 189 | |
Kojto | 99:dbbf35b96557 | 190 | /** |
Kojto | 122:f9eeca106725 | 191 | * @brief Enable write access to IWDG_PR and IWDG_RLR registers. |
Kojto | 122:f9eeca106725 | 192 | * @param __HANDLE__ IWDG handle |
Kojto | 99:dbbf35b96557 | 193 | * @retval None |
Kojto | 99:dbbf35b96557 | 194 | */ |
Kojto | 122:f9eeca106725 | 195 | #define IWDG_ENABLE_WRITE_ACCESS(__HANDLE__) WRITE_REG((__HANDLE__)->Instance->KR, IWDG_KEY_WRITE_ACCESS_ENABLE) |
Kojto | 99:dbbf35b96557 | 196 | |
Kojto | 99:dbbf35b96557 | 197 | /** |
Kojto | 122:f9eeca106725 | 198 | * @brief Disable write access to IWDG_PR and IWDG_RLR registers. |
Kojto | 122:f9eeca106725 | 199 | * @param __HANDLE__ IWDG handle |
Kojto | 99:dbbf35b96557 | 200 | * @retval None |
Kojto | 99:dbbf35b96557 | 201 | */ |
Kojto | 99:dbbf35b96557 | 202 | #define IWDG_DISABLE_WRITE_ACCESS(__HANDLE__) WRITE_REG((__HANDLE__)->Instance->KR, IWDG_KEY_WRITE_ACCESS_DISABLE) |
Kojto | 99:dbbf35b96557 | 203 | |
Kojto | 122:f9eeca106725 | 204 | /** |
Kojto | 122:f9eeca106725 | 205 | * @brief Check IWDG prescaler value. |
Kojto | 122:f9eeca106725 | 206 | * @param __PRESCALER__ IWDG prescaler value |
Kojto | 122:f9eeca106725 | 207 | * @retval None |
Kojto | 122:f9eeca106725 | 208 | */ |
Kojto | 122:f9eeca106725 | 209 | #define IS_IWDG_PRESCALER(__PRESCALER__) (((__PRESCALER__) == IWDG_PRESCALER_4) || \ |
Kojto | 122:f9eeca106725 | 210 | ((__PRESCALER__) == IWDG_PRESCALER_8) || \ |
Kojto | 122:f9eeca106725 | 211 | ((__PRESCALER__) == IWDG_PRESCALER_16) || \ |
Kojto | 122:f9eeca106725 | 212 | ((__PRESCALER__) == IWDG_PRESCALER_32) || \ |
Kojto | 122:f9eeca106725 | 213 | ((__PRESCALER__) == IWDG_PRESCALER_64) || \ |
Kojto | 122:f9eeca106725 | 214 | ((__PRESCALER__) == IWDG_PRESCALER_128)|| \ |
Kojto | 122:f9eeca106725 | 215 | ((__PRESCALER__) == IWDG_PRESCALER_256)) |
Kojto | 99:dbbf35b96557 | 216 | |
Kojto | 122:f9eeca106725 | 217 | /** |
Kojto | 122:f9eeca106725 | 218 | * @brief Check IWDG reload value. |
Kojto | 122:f9eeca106725 | 219 | * @param __RELOAD__ IWDG reload value |
Kojto | 122:f9eeca106725 | 220 | * @retval None |
Kojto | 122:f9eeca106725 | 221 | */ |
Kojto | 122:f9eeca106725 | 222 | #define IS_IWDG_RELOAD(__RELOAD__) ((__RELOAD__) <= IWDG_RLR_RL) |
Kojto | 99:dbbf35b96557 | 223 | |
Kojto | 99:dbbf35b96557 | 224 | /** |
Kojto | 99:dbbf35b96557 | 225 | * @} |
Kojto | 99:dbbf35b96557 | 226 | */ |
Kojto | 99:dbbf35b96557 | 227 | |
Kojto | 99:dbbf35b96557 | 228 | /** |
Kojto | 99:dbbf35b96557 | 229 | * @} |
Kojto | 99:dbbf35b96557 | 230 | */ |
Kojto | 99:dbbf35b96557 | 231 | |
Kojto | 99:dbbf35b96557 | 232 | /** |
Kojto | 99:dbbf35b96557 | 233 | * @} |
Kojto | 122:f9eeca106725 | 234 | */ |
bogdanm | 89:552587b429a1 | 235 | |
Kojto | 122:f9eeca106725 | 236 | |
bogdanm | 89:552587b429a1 | 237 | #ifdef __cplusplus |
bogdanm | 89:552587b429a1 | 238 | } |
bogdanm | 89:552587b429a1 | 239 | #endif |
bogdanm | 89:552587b429a1 | 240 | |
bogdanm | 89:552587b429a1 | 241 | #endif /* __STM32F4xx_HAL_IWDG_H */ |
bogdanm | 89:552587b429a1 | 242 | |
bogdanm | 89:552587b429a1 | 243 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |