Merge pull request #10592 from iNavFlight/MrD_Update-parameter-description
[inav.git] / lib / main / STM32F7 / Drivers / STM32F7xx_HAL_Driver / Inc / stm32f7xx_hal_iwdg.h
blob50f28792814b071d36099980e17588ac2aae4789
1 /**
2 ******************************************************************************
3 * @file stm32f7xx_hal_iwdg.h
4 * @author MCD Application Team
5 * @version V1.2.2
6 * @date 14-April-2017
7 * @brief Header file of IWDG HAL module.
8 ******************************************************************************
9 * @attention
11 * <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
13 * Redistribution and use in source and binary forms, with or without modification,
14 * are permitted provided that the following conditions are met:
15 * 1. Redistributions of source code must retain the above copyright notice,
16 * this list of conditions and the following disclaimer.
17 * 2. Redistributions in binary form must reproduce the above copyright notice,
18 * this list of conditions and the following disclaimer in the documentation
19 * and/or other materials provided with the distribution.
20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
21 * may be used to endorse or promote products derived from this software
22 * without specific prior written permission.
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 ******************************************************************************
38 /* Define to prevent recursive inclusion -------------------------------------*/
39 #ifndef __STM32F7xx_HAL_IWDG_H
40 #define __STM32F7xx_HAL_IWDG_H
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
46 /* Includes ------------------------------------------------------------------*/
47 #include "stm32f7xx_hal_def.h"
49 /** @addtogroup STM32F7xx_HAL_Driver
50 * @{
53 /** @defgroup IWDG IWDG
54 * @{
57 /* Exported types ------------------------------------------------------------*/
58 /** @defgroup IWDG_Exported_Types IWDG Exported Types
59 * @{
62 /**
63 * @brief IWDG Init structure definition
65 typedef struct
67 uint32_t Prescaler; /*!< Select the prescaler of the IWDG.
68 This parameter can be a value of @ref IWDG_Prescaler */
70 uint32_t Reload; /*!< Specifies the IWDG down-counter reload value.
71 This parameter must be a number between Min_Data = 0 and Max_Data = 0x0FFF */
73 uint32_t Window; /*!< Specifies the window value to be compared to the down-counter.
74 This parameter must be a number between Min_Data = 0 and Max_Data = 0x0FFF */
76 } IWDG_InitTypeDef;
78 /**
79 * @brief IWDG Handle Structure definition
81 typedef struct
83 IWDG_TypeDef *Instance; /*!< Register base address */
85 IWDG_InitTypeDef Init; /*!< IWDG required parameters */
87 }IWDG_HandleTypeDef;
89 /**
90 * @}
93 /* Exported constants --------------------------------------------------------*/
94 /** @defgroup IWDG_Exported_Constants IWDG Exported Constants
95 * @{
98 /** @defgroup IWDG_Prescaler IWDG Prescaler
99 * @{
101 #define IWDG_PRESCALER_4 0x00000000u /*!< IWDG prescaler set to 4 */
102 #define IWDG_PRESCALER_8 IWDG_PR_PR_0 /*!< IWDG prescaler set to 8 */
103 #define IWDG_PRESCALER_16 IWDG_PR_PR_1 /*!< IWDG prescaler set to 16 */
104 #define IWDG_PRESCALER_32 (IWDG_PR_PR_1 | IWDG_PR_PR_0) /*!< IWDG prescaler set to 32 */
105 #define IWDG_PRESCALER_64 IWDG_PR_PR_2 /*!< IWDG prescaler set to 64 */
106 #define IWDG_PRESCALER_128 (IWDG_PR_PR_2 | IWDG_PR_PR_0) /*!< IWDG prescaler set to 128 */
107 #define IWDG_PRESCALER_256 (IWDG_PR_PR_2 | IWDG_PR_PR_1) /*!< IWDG prescaler set to 256 */
109 * @}
112 /** @defgroup IWDG_Window_option IWDG Window option
113 * @{
115 #define IWDG_WINDOW_DISABLE IWDG_WINR_WIN
117 * @}
121 * @}
124 /* Exported macros -----------------------------------------------------------*/
125 /** @defgroup IWDG_Exported_Macros IWDG Exported Macros
126 * @{
130 * @brief Enable the IWDG peripheral.
131 * @param __HANDLE__: IWDG handle
132 * @retval None
134 #define __HAL_IWDG_START(__HANDLE__) WRITE_REG((__HANDLE__)->Instance->KR, IWDG_KEY_ENABLE)
137 * @brief Reload IWDG counter with value defined in the reload register
138 * (write access to IWDG_PR, IWDG_RLR & IWDG_WINR registers disabled).
139 * @param __HANDLE__: IWDG handle
140 * @retval None
142 #define __HAL_IWDG_RELOAD_COUNTER(__HANDLE__) WRITE_REG((__HANDLE__)->Instance->KR, IWDG_KEY_RELOAD)
145 * @}
148 /* Exported functions --------------------------------------------------------*/
149 /** @defgroup IWDG_Exported_Functions IWDG Exported Functions
150 * @{
153 /** @defgroup IWDG_Exported_Functions_Group1 Initialization and Start functions
154 * @{
156 /* Initialization/Start functions ********************************************/
157 HAL_StatusTypeDef HAL_IWDG_Init(IWDG_HandleTypeDef *hiwdg);
159 * @}
162 /** @defgroup IWDG_Exported_Functions_Group2 IO operation functions
163 * @{
165 /* I/O operation functions ****************************************************/
166 HAL_StatusTypeDef HAL_IWDG_Refresh(IWDG_HandleTypeDef *hiwdg);
168 * @}
172 * @}
175 /* Private constants ---------------------------------------------------------*/
176 /** @defgroup IWDG_Private_Constants IWDG Private Constants
177 * @{
181 * @brief IWDG Key Register BitMask
183 #define IWDG_KEY_RELOAD 0x0000AAAAu /*!< IWDG Reload Counter Enable */
184 #define IWDG_KEY_ENABLE 0x0000CCCCu /*!< IWDG Peripheral Enable */
185 #define IWDG_KEY_WRITE_ACCESS_ENABLE 0x00005555u /*!< IWDG KR Write Access Enable */
186 #define IWDG_KEY_WRITE_ACCESS_DISABLE 0x00000000u /*!< IWDG KR Write Access Disable */
189 * @}
192 /* Private macros ------------------------------------------------------------*/
193 /** @defgroup IWDG_Private_Macros IWDG Private Macros
194 * @{
198 * @brief Enable write access to IWDG_PR, IWDG_RLR and IWDG_WINR registers.
199 * @param __HANDLE__: IWDG handle
200 * @retval None
202 #define IWDG_ENABLE_WRITE_ACCESS(__HANDLE__) WRITE_REG((__HANDLE__)->Instance->KR, IWDG_KEY_WRITE_ACCESS_ENABLE)
205 * @brief Disable write access to IWDG_PR, IWDG_RLR and IWDG_WINR registers.
206 * @param __HANDLE__: IWDG handle
207 * @retval None
209 #define IWDG_DISABLE_WRITE_ACCESS(__HANDLE__) WRITE_REG((__HANDLE__)->Instance->KR, IWDG_KEY_WRITE_ACCESS_DISABLE)
212 * @brief Check IWDG prescaler value.
213 * @param __PRESCALER__: IWDG prescaler value
214 * @retval None
216 #define IS_IWDG_PRESCALER(__PRESCALER__) (((__PRESCALER__) == IWDG_PRESCALER_4) || \
217 ((__PRESCALER__) == IWDG_PRESCALER_8) || \
218 ((__PRESCALER__) == IWDG_PRESCALER_16) || \
219 ((__PRESCALER__) == IWDG_PRESCALER_32) || \
220 ((__PRESCALER__) == IWDG_PRESCALER_64) || \
221 ((__PRESCALER__) == IWDG_PRESCALER_128)|| \
222 ((__PRESCALER__) == IWDG_PRESCALER_256))
225 * @brief Check IWDG reload value.
226 * @param __RELOAD__: IWDG reload value
227 * @retval None
229 #define IS_IWDG_RELOAD(__RELOAD__) ((__RELOAD__) <= IWDG_RLR_RL)
232 * @brief Check IWDG window value.
233 * @param __WINDOW__: IWDG window value
234 * @retval None
236 #define IS_IWDG_WINDOW(__WINDOW__) ((__WINDOW__) <= IWDG_WINR_WIN)
239 * @}
243 * @}
247 * @}
251 #ifdef __cplusplus
253 #endif
255 #endif /* __STM32F7xx_HAL_IWDG_H */
257 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/