I-O DATA DEV2 / KANI-GS1_mbed-dev

Fork of UDNS1_mbed-dev by I-O DATA DEV2

Committer:
Kojto
Date:
Tue Feb 14 14:44:10 2017 +0000
Revision:
158:b23ee177fd68
This updates the lib to the mbed lib v136

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 158:b23ee177fd68 1 /**
Kojto 158:b23ee177fd68 2 ******************************************************************************
Kojto 158:b23ee177fd68 3 * @file stm32l0xx_ll_iwdg.h
Kojto 158:b23ee177fd68 4 * @author MCD Application Team
Kojto 158:b23ee177fd68 5 * @version V1.7.0
Kojto 158:b23ee177fd68 6 * @date 31-May-2016
Kojto 158:b23ee177fd68 7 * @brief Header file of IWDG LL module.
Kojto 158:b23ee177fd68 8 ******************************************************************************
Kojto 158:b23ee177fd68 9 * @attention
Kojto 158:b23ee177fd68 10 *
Kojto 158:b23ee177fd68 11 * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
Kojto 158:b23ee177fd68 12 *
Kojto 158:b23ee177fd68 13 * Redistribution and use in source and binary forms, with or without modification,
Kojto 158:b23ee177fd68 14 * are permitted provided that the following conditions are met:
Kojto 158:b23ee177fd68 15 * 1. Redistributions of source code must retain the above copyright notice,
Kojto 158:b23ee177fd68 16 * this list of conditions and the following disclaimer.
Kojto 158:b23ee177fd68 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
Kojto 158:b23ee177fd68 18 * this list of conditions and the following disclaimer in the documentation
Kojto 158:b23ee177fd68 19 * and/or other materials provided with the distribution.
Kojto 158:b23ee177fd68 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Kojto 158:b23ee177fd68 21 * may be used to endorse or promote products derived from this software
Kojto 158:b23ee177fd68 22 * without specific prior written permission.
Kojto 158:b23ee177fd68 23 *
Kojto 158:b23ee177fd68 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Kojto 158:b23ee177fd68 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Kojto 158:b23ee177fd68 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Kojto 158:b23ee177fd68 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Kojto 158:b23ee177fd68 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Kojto 158:b23ee177fd68 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Kojto 158:b23ee177fd68 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Kojto 158:b23ee177fd68 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Kojto 158:b23ee177fd68 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Kojto 158:b23ee177fd68 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Kojto 158:b23ee177fd68 34 *
Kojto 158:b23ee177fd68 35 ******************************************************************************
Kojto 158:b23ee177fd68 36 */
Kojto 158:b23ee177fd68 37
Kojto 158:b23ee177fd68 38 /* Define to prevent recursive inclusion -------------------------------------*/
Kojto 158:b23ee177fd68 39 #ifndef __STM32L0xx_LL_IWDG_H
Kojto 158:b23ee177fd68 40 #define __STM32L0xx_LL_IWDG_H
Kojto 158:b23ee177fd68 41
Kojto 158:b23ee177fd68 42 #ifdef __cplusplus
Kojto 158:b23ee177fd68 43 extern "C" {
Kojto 158:b23ee177fd68 44 #endif
Kojto 158:b23ee177fd68 45
Kojto 158:b23ee177fd68 46 /* Includes ------------------------------------------------------------------*/
Kojto 158:b23ee177fd68 47 #include "stm32l0xx.h"
Kojto 158:b23ee177fd68 48
Kojto 158:b23ee177fd68 49 /** @addtogroup STM32L0xx_LL_Driver
Kojto 158:b23ee177fd68 50 * @{
Kojto 158:b23ee177fd68 51 */
Kojto 158:b23ee177fd68 52
Kojto 158:b23ee177fd68 53 #if defined(IWDG)
Kojto 158:b23ee177fd68 54
Kojto 158:b23ee177fd68 55 /** @defgroup IWDG_LL IWDG
Kojto 158:b23ee177fd68 56 * @{
Kojto 158:b23ee177fd68 57 */
Kojto 158:b23ee177fd68 58
Kojto 158:b23ee177fd68 59 /* Private types -------------------------------------------------------------*/
Kojto 158:b23ee177fd68 60 /* Private variables ---------------------------------------------------------*/
Kojto 158:b23ee177fd68 61
Kojto 158:b23ee177fd68 62 /* Private constants ---------------------------------------------------------*/
Kojto 158:b23ee177fd68 63 /** @defgroup IWDG_LL_Private_Constants IWDG Private Constants
Kojto 158:b23ee177fd68 64 * @{
Kojto 158:b23ee177fd68 65 */
Kojto 158:b23ee177fd68 66
Kojto 158:b23ee177fd68 67 #define LL_IWDG_KEY_RELOAD ((uint32_t)0x0000AAAAU) /*!< IWDG Reload Counter Enable */
Kojto 158:b23ee177fd68 68 #define LL_IWDG_KEY_ENABLE ((uint32_t)0x0000CCCCU) /*!< IWDG Peripheral Enable */
Kojto 158:b23ee177fd68 69 #define LL_IWDG_KEY_WR_ACCESS_ENABLE ((uint32_t)0x00005555U) /*!< IWDG KR Write Access Enable */
Kojto 158:b23ee177fd68 70 #define LL_IWDG_KEY_WR_ACCESS_DISABLE ((uint32_t)0x00000000U) /*!< IWDG KR Write Access Disable */
Kojto 158:b23ee177fd68 71
Kojto 158:b23ee177fd68 72 /**
Kojto 158:b23ee177fd68 73 * @}
Kojto 158:b23ee177fd68 74 */
Kojto 158:b23ee177fd68 75
Kojto 158:b23ee177fd68 76 /* Private macros ------------------------------------------------------------*/
Kojto 158:b23ee177fd68 77
Kojto 158:b23ee177fd68 78 /* Exported types ------------------------------------------------------------*/
Kojto 158:b23ee177fd68 79 /* Exported constants --------------------------------------------------------*/
Kojto 158:b23ee177fd68 80 /** @defgroup IWDG_LL_Exported_Constants IWDG Exported Constants
Kojto 158:b23ee177fd68 81 * @{
Kojto 158:b23ee177fd68 82 */
Kojto 158:b23ee177fd68 83
Kojto 158:b23ee177fd68 84 /** @defgroup IWDG_LL_EC_GET_FLAG Get Flags Defines
Kojto 158:b23ee177fd68 85 * @brief Flags defines which can be used with LL_IWDG_ReadReg function
Kojto 158:b23ee177fd68 86 * @{
Kojto 158:b23ee177fd68 87 */
Kojto 158:b23ee177fd68 88 #define LL_IWDG_SR_PVU IWDG_SR_PVU /*!< Watchdog prescaler value update */
Kojto 158:b23ee177fd68 89 #define LL_IWDG_SR_RVU IWDG_SR_RVU /*!< Watchdog counter reload value update */
Kojto 158:b23ee177fd68 90 #define LL_IWDG_SR_WVU IWDG_SR_WVU /*!< Watchdog counter window value update */
Kojto 158:b23ee177fd68 91
Kojto 158:b23ee177fd68 92 /**
Kojto 158:b23ee177fd68 93 * @}
Kojto 158:b23ee177fd68 94 */
Kojto 158:b23ee177fd68 95
Kojto 158:b23ee177fd68 96 /** @defgroup IWDG_LL_EC_PRESCALER Prescaler Divider
Kojto 158:b23ee177fd68 97 * @{
Kojto 158:b23ee177fd68 98 */
Kojto 158:b23ee177fd68 99 #define LL_IWDG_PRESCALER_4 ((uint32_t)0x00000000U) /*!< Divider by 4 */
Kojto 158:b23ee177fd68 100 #define LL_IWDG_PRESCALER_8 (IWDG_PR_PR_0) /*!< Divider by 8 */
Kojto 158:b23ee177fd68 101 #define LL_IWDG_PRESCALER_16 (IWDG_PR_PR_1) /*!< Divider by 16 */
Kojto 158:b23ee177fd68 102 #define LL_IWDG_PRESCALER_32 (IWDG_PR_PR_1 | IWDG_PR_PR_0) /*!< Divider by 32 */
Kojto 158:b23ee177fd68 103 #define LL_IWDG_PRESCALER_64 (IWDG_PR_PR_2) /*!< Divider by 64 */
Kojto 158:b23ee177fd68 104 #define LL_IWDG_PRESCALER_128 (IWDG_PR_PR_2 | IWDG_PR_PR_0) /*!< Divider by 128 */
Kojto 158:b23ee177fd68 105 #define LL_IWDG_PRESCALER_256 (IWDG_PR_PR_2 | IWDG_PR_PR_1) /*!< Divider by 256 */
Kojto 158:b23ee177fd68 106 /**
Kojto 158:b23ee177fd68 107 * @}
Kojto 158:b23ee177fd68 108 */
Kojto 158:b23ee177fd68 109
Kojto 158:b23ee177fd68 110 /**
Kojto 158:b23ee177fd68 111 * @}
Kojto 158:b23ee177fd68 112 */
Kojto 158:b23ee177fd68 113
Kojto 158:b23ee177fd68 114 /* Exported macro ------------------------------------------------------------*/
Kojto 158:b23ee177fd68 115 /** @defgroup IWDG_LL_Exported_Macros IWDG Exported Macros
Kojto 158:b23ee177fd68 116 * @{
Kojto 158:b23ee177fd68 117 */
Kojto 158:b23ee177fd68 118
Kojto 158:b23ee177fd68 119 /** @defgroup IWDG_LL_EM_WRITE_READ Common Write and read registers Macros
Kojto 158:b23ee177fd68 120 * @{
Kojto 158:b23ee177fd68 121 */
Kojto 158:b23ee177fd68 122
Kojto 158:b23ee177fd68 123 /**
Kojto 158:b23ee177fd68 124 * @brief Write a value in IWDG register
Kojto 158:b23ee177fd68 125 * @param __INSTANCE__ IWDG Instance
Kojto 158:b23ee177fd68 126 * @param __REG__ Register to be written
Kojto 158:b23ee177fd68 127 * @param __VALUE__ Value to be written in the register
Kojto 158:b23ee177fd68 128 * @retval None
Kojto 158:b23ee177fd68 129 */
Kojto 158:b23ee177fd68 130 #define LL_IWDG_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG(__INSTANCE__->__REG__, (__VALUE__))
Kojto 158:b23ee177fd68 131
Kojto 158:b23ee177fd68 132 /**
Kojto 158:b23ee177fd68 133 * @brief Read a value in IWDG register
Kojto 158:b23ee177fd68 134 * @param __INSTANCE__ IWDG Instance
Kojto 158:b23ee177fd68 135 * @param __REG__ Register to be read
Kojto 158:b23ee177fd68 136 * @retval Register value
Kojto 158:b23ee177fd68 137 */
Kojto 158:b23ee177fd68 138 #define LL_IWDG_ReadReg(__INSTANCE__, __REG__) READ_REG(__INSTANCE__->__REG__)
Kojto 158:b23ee177fd68 139 /**
Kojto 158:b23ee177fd68 140 * @}
Kojto 158:b23ee177fd68 141 */
Kojto 158:b23ee177fd68 142
Kojto 158:b23ee177fd68 143 /**
Kojto 158:b23ee177fd68 144 * @}
Kojto 158:b23ee177fd68 145 */
Kojto 158:b23ee177fd68 146
Kojto 158:b23ee177fd68 147
Kojto 158:b23ee177fd68 148 /* Exported functions --------------------------------------------------------*/
Kojto 158:b23ee177fd68 149 /** @defgroup IWDG_LL_Exported_Functions IWDG Exported Functions
Kojto 158:b23ee177fd68 150 * @{
Kojto 158:b23ee177fd68 151 */
Kojto 158:b23ee177fd68 152 /** @defgroup IWDG_LL_EF_Configuration Configuration
Kojto 158:b23ee177fd68 153 * @{
Kojto 158:b23ee177fd68 154 */
Kojto 158:b23ee177fd68 155
Kojto 158:b23ee177fd68 156 /**
Kojto 158:b23ee177fd68 157 * @brief Start the Independent Watchdog
Kojto 158:b23ee177fd68 158 * @note Except if the hardware watchdog option is selected
Kojto 158:b23ee177fd68 159 * @rmtoll KR KEY LL_IWDG_Enable
Kojto 158:b23ee177fd68 160 * @param IWDGx IWDG Instance
Kojto 158:b23ee177fd68 161 * @retval None
Kojto 158:b23ee177fd68 162 */
Kojto 158:b23ee177fd68 163 __STATIC_INLINE void LL_IWDG_Enable(IWDG_TypeDef *IWDGx)
Kojto 158:b23ee177fd68 164 {
Kojto 158:b23ee177fd68 165 WRITE_REG(IWDG->KR, LL_IWDG_KEY_ENABLE);
Kojto 158:b23ee177fd68 166 }
Kojto 158:b23ee177fd68 167
Kojto 158:b23ee177fd68 168 /**
Kojto 158:b23ee177fd68 169 * @brief Reloads IWDG counter with value defined in the reload register
Kojto 158:b23ee177fd68 170 * @rmtoll KR KEY LL_IWDG_ReloadCounter
Kojto 158:b23ee177fd68 171 * @param IWDGx IWDG Instance
Kojto 158:b23ee177fd68 172 * @retval None
Kojto 158:b23ee177fd68 173 */
Kojto 158:b23ee177fd68 174 __STATIC_INLINE void LL_IWDG_ReloadCounter(IWDG_TypeDef *IWDGx)
Kojto 158:b23ee177fd68 175 {
Kojto 158:b23ee177fd68 176 WRITE_REG(IWDG->KR, LL_IWDG_KEY_RELOAD);
Kojto 158:b23ee177fd68 177 }
Kojto 158:b23ee177fd68 178
Kojto 158:b23ee177fd68 179 /**
Kojto 158:b23ee177fd68 180 * @brief Enable write access to IWDG_PR, IWDG_RLR and IWDG_WINR registers
Kojto 158:b23ee177fd68 181 * @rmtoll KR KEY LL_IWDG_EnableWriteAccess
Kojto 158:b23ee177fd68 182 * @param IWDGx IWDG Instance
Kojto 158:b23ee177fd68 183 * @retval None
Kojto 158:b23ee177fd68 184 */
Kojto 158:b23ee177fd68 185 __STATIC_INLINE void LL_IWDG_EnableWriteAccess(IWDG_TypeDef *IWDGx)
Kojto 158:b23ee177fd68 186 {
Kojto 158:b23ee177fd68 187 WRITE_REG(IWDG->KR, LL_IWDG_KEY_WR_ACCESS_ENABLE);
Kojto 158:b23ee177fd68 188 }
Kojto 158:b23ee177fd68 189
Kojto 158:b23ee177fd68 190 /**
Kojto 158:b23ee177fd68 191 * @brief Disable write access to IWDG_PR, IWDG_RLR and IWDG_WINR registers
Kojto 158:b23ee177fd68 192 * @rmtoll KR KEY LL_IWDG_DisableWriteAccess
Kojto 158:b23ee177fd68 193 * @param IWDGx IWDG Instance
Kojto 158:b23ee177fd68 194 * @retval None
Kojto 158:b23ee177fd68 195 */
Kojto 158:b23ee177fd68 196 __STATIC_INLINE void LL_IWDG_DisableWriteAccess(IWDG_TypeDef *IWDGx)
Kojto 158:b23ee177fd68 197 {
Kojto 158:b23ee177fd68 198 WRITE_REG(IWDG->KR, LL_IWDG_KEY_WR_ACCESS_DISABLE);
Kojto 158:b23ee177fd68 199 }
Kojto 158:b23ee177fd68 200
Kojto 158:b23ee177fd68 201 /**
Kojto 158:b23ee177fd68 202 * @brief Select the prescaler of the IWDG
Kojto 158:b23ee177fd68 203 * @rmtoll PR PR LL_IWDG_SetPrescaler
Kojto 158:b23ee177fd68 204 * @param IWDGx IWDG Instance
Kojto 158:b23ee177fd68 205 * @param Prescaler This parameter can be one of the following values:
Kojto 158:b23ee177fd68 206 * @arg @ref LL_IWDG_PRESCALER_4
Kojto 158:b23ee177fd68 207 * @arg @ref LL_IWDG_PRESCALER_8
Kojto 158:b23ee177fd68 208 * @arg @ref LL_IWDG_PRESCALER_16
Kojto 158:b23ee177fd68 209 * @arg @ref LL_IWDG_PRESCALER_32
Kojto 158:b23ee177fd68 210 * @arg @ref LL_IWDG_PRESCALER_64
Kojto 158:b23ee177fd68 211 * @arg @ref LL_IWDG_PRESCALER_128
Kojto 158:b23ee177fd68 212 * @arg @ref LL_IWDG_PRESCALER_256
Kojto 158:b23ee177fd68 213 * @retval None
Kojto 158:b23ee177fd68 214 */
Kojto 158:b23ee177fd68 215 __STATIC_INLINE void LL_IWDG_SetPrescaler(IWDG_TypeDef *IWDGx, uint32_t Prescaler)
Kojto 158:b23ee177fd68 216 {
Kojto 158:b23ee177fd68 217 WRITE_REG(IWDGx->PR, IWDG_PR_PR & Prescaler);
Kojto 158:b23ee177fd68 218 }
Kojto 158:b23ee177fd68 219
Kojto 158:b23ee177fd68 220 /**
Kojto 158:b23ee177fd68 221 * @brief Get the selected prescaler of the IWDG
Kojto 158:b23ee177fd68 222 * @rmtoll PR PR LL_IWDG_GetPrescaler
Kojto 158:b23ee177fd68 223 * @param IWDGx IWDG Instance
Kojto 158:b23ee177fd68 224 * @retval Returned value can be one of the following values:
Kojto 158:b23ee177fd68 225 * @arg @ref LL_IWDG_PRESCALER_4
Kojto 158:b23ee177fd68 226 * @arg @ref LL_IWDG_PRESCALER_8
Kojto 158:b23ee177fd68 227 * @arg @ref LL_IWDG_PRESCALER_16
Kojto 158:b23ee177fd68 228 * @arg @ref LL_IWDG_PRESCALER_32
Kojto 158:b23ee177fd68 229 * @arg @ref LL_IWDG_PRESCALER_64
Kojto 158:b23ee177fd68 230 * @arg @ref LL_IWDG_PRESCALER_128
Kojto 158:b23ee177fd68 231 * @arg @ref LL_IWDG_PRESCALER_256
Kojto 158:b23ee177fd68 232 */
Kojto 158:b23ee177fd68 233 __STATIC_INLINE uint32_t LL_IWDG_GetPrescaler(IWDG_TypeDef *IWDGx)
Kojto 158:b23ee177fd68 234 {
Kojto 158:b23ee177fd68 235 return (uint32_t)(READ_REG(IWDGx->PR));
Kojto 158:b23ee177fd68 236 }
Kojto 158:b23ee177fd68 237
Kojto 158:b23ee177fd68 238 /**
Kojto 158:b23ee177fd68 239 * @brief Specify the IWDG down-counter reload value
Kojto 158:b23ee177fd68 240 * @rmtoll RLR RL LL_IWDG_SetReloadCounter
Kojto 158:b23ee177fd68 241 * @param IWDGx IWDG Instance
Kojto 158:b23ee177fd68 242 * @param Counter Value between Min_Data=0 and Max_Data=0x0FFF
Kojto 158:b23ee177fd68 243 * @retval None
Kojto 158:b23ee177fd68 244 */
Kojto 158:b23ee177fd68 245 __STATIC_INLINE void LL_IWDG_SetReloadCounter(IWDG_TypeDef *IWDGx, uint32_t Counter)
Kojto 158:b23ee177fd68 246 {
Kojto 158:b23ee177fd68 247 WRITE_REG(IWDGx->RLR, IWDG_RLR_RL & Counter);
Kojto 158:b23ee177fd68 248 }
Kojto 158:b23ee177fd68 249
Kojto 158:b23ee177fd68 250 /**
Kojto 158:b23ee177fd68 251 * @brief Get the specified IWDG down-counter reload value
Kojto 158:b23ee177fd68 252 * @rmtoll RLR RL LL_IWDG_GetReloadCounter
Kojto 158:b23ee177fd68 253 * @param IWDGx IWDG Instance
Kojto 158:b23ee177fd68 254 * @retval Value between Min_Data=0 and Max_Data=0x0FFF
Kojto 158:b23ee177fd68 255 */
Kojto 158:b23ee177fd68 256 __STATIC_INLINE uint32_t LL_IWDG_GetReloadCounter(IWDG_TypeDef *IWDGx)
Kojto 158:b23ee177fd68 257 {
Kojto 158:b23ee177fd68 258 return (uint32_t)(READ_REG(IWDGx->RLR));
Kojto 158:b23ee177fd68 259 }
Kojto 158:b23ee177fd68 260
Kojto 158:b23ee177fd68 261 /**
Kojto 158:b23ee177fd68 262 * @brief Specify high limit of the window value to be compared to the down-counter.
Kojto 158:b23ee177fd68 263 * @rmtoll WINR WIN LL_IWDG_SetWindow
Kojto 158:b23ee177fd68 264 * @param IWDGx IWDG Instance
Kojto 158:b23ee177fd68 265 * @param Window Value between Min_Data=0 and Max_Data=0x0FFF
Kojto 158:b23ee177fd68 266 * @retval None
Kojto 158:b23ee177fd68 267 */
Kojto 158:b23ee177fd68 268 __STATIC_INLINE void LL_IWDG_SetWindow(IWDG_TypeDef *IWDGx, uint32_t Window)
Kojto 158:b23ee177fd68 269 {
Kojto 158:b23ee177fd68 270 WRITE_REG(IWDGx->WINR, IWDG_WINR_WIN & Window);
Kojto 158:b23ee177fd68 271 }
Kojto 158:b23ee177fd68 272
Kojto 158:b23ee177fd68 273 /**
Kojto 158:b23ee177fd68 274 * @brief Get the high limit of the window value specified.
Kojto 158:b23ee177fd68 275 * @rmtoll WINR WIN LL_IWDG_GetWindow
Kojto 158:b23ee177fd68 276 * @param IWDGx IWDG Instance
Kojto 158:b23ee177fd68 277 * @retval Value between Min_Data=0 and Max_Data=0x0FFF
Kojto 158:b23ee177fd68 278 */
Kojto 158:b23ee177fd68 279 __STATIC_INLINE uint32_t LL_IWDG_GetWindow(IWDG_TypeDef *IWDGx)
Kojto 158:b23ee177fd68 280 {
Kojto 158:b23ee177fd68 281 return (uint32_t)(READ_REG(IWDGx->WINR));
Kojto 158:b23ee177fd68 282 }
Kojto 158:b23ee177fd68 283
Kojto 158:b23ee177fd68 284 /**
Kojto 158:b23ee177fd68 285 * @}
Kojto 158:b23ee177fd68 286 */
Kojto 158:b23ee177fd68 287
Kojto 158:b23ee177fd68 288 /** @defgroup IWDG_LL_EF_FLAG_Management FLAG_Management
Kojto 158:b23ee177fd68 289 * @{
Kojto 158:b23ee177fd68 290 */
Kojto 158:b23ee177fd68 291
Kojto 158:b23ee177fd68 292 /**
Kojto 158:b23ee177fd68 293 * @brief Check if flag Prescaler Value Update is set or not
Kojto 158:b23ee177fd68 294 * @rmtoll SR PVU LL_IWDG_IsActiveFlag_PVU
Kojto 158:b23ee177fd68 295 * @param IWDGx IWDG Instance
Kojto 158:b23ee177fd68 296 * @retval State of bit (1 or 0).
Kojto 158:b23ee177fd68 297 */
Kojto 158:b23ee177fd68 298 __STATIC_INLINE uint32_t LL_IWDG_IsActiveFlag_PVU(IWDG_TypeDef *IWDGx)
Kojto 158:b23ee177fd68 299 {
Kojto 158:b23ee177fd68 300 return (READ_BIT(IWDGx->SR, IWDG_SR_PVU) == (IWDG_SR_PVU));
Kojto 158:b23ee177fd68 301 }
Kojto 158:b23ee177fd68 302
Kojto 158:b23ee177fd68 303 /**
Kojto 158:b23ee177fd68 304 * @brief Check if flag Reload Value Update is set or not
Kojto 158:b23ee177fd68 305 * @rmtoll SR RVU LL_IWDG_IsActiveFlag_RVU
Kojto 158:b23ee177fd68 306 * @param IWDGx IWDG Instance
Kojto 158:b23ee177fd68 307 * @retval State of bit (1 or 0).
Kojto 158:b23ee177fd68 308 */
Kojto 158:b23ee177fd68 309 __STATIC_INLINE uint32_t LL_IWDG_IsActiveFlag_RVU(IWDG_TypeDef *IWDGx)
Kojto 158:b23ee177fd68 310 {
Kojto 158:b23ee177fd68 311 return (READ_BIT(IWDGx->SR, IWDG_SR_RVU) == (IWDG_SR_RVU));
Kojto 158:b23ee177fd68 312 }
Kojto 158:b23ee177fd68 313
Kojto 158:b23ee177fd68 314 /**
Kojto 158:b23ee177fd68 315 * @brief Check if flag Window Value Update is set or not
Kojto 158:b23ee177fd68 316 * @rmtoll SR WVU LL_IWDG_IsActiveFlag_WVU
Kojto 158:b23ee177fd68 317 * @param IWDGx IWDG Instance
Kojto 158:b23ee177fd68 318 * @retval State of bit (1 or 0).
Kojto 158:b23ee177fd68 319 */
Kojto 158:b23ee177fd68 320 __STATIC_INLINE uint32_t LL_IWDG_IsActiveFlag_WVU(IWDG_TypeDef *IWDGx)
Kojto 158:b23ee177fd68 321 {
Kojto 158:b23ee177fd68 322 return (READ_BIT(IWDGx->SR, IWDG_SR_WVU) == (IWDG_SR_WVU));
Kojto 158:b23ee177fd68 323 }
Kojto 158:b23ee177fd68 324
Kojto 158:b23ee177fd68 325 /**
Kojto 158:b23ee177fd68 326 * @brief Check if all flags Prescaler, Reload & Window Value Update are reset or not
Kojto 158:b23ee177fd68 327 * @rmtoll SR PVU LL_IWDG_IsReady\n
Kojto 158:b23ee177fd68 328 * SR WVU LL_IWDG_IsReady\n
Kojto 158:b23ee177fd68 329 * SR RVU LL_IWDG_IsReady
Kojto 158:b23ee177fd68 330 * @param IWDGx IWDG Instance
Kojto 158:b23ee177fd68 331 * @retval State of bits (1 or 0).
Kojto 158:b23ee177fd68 332 */
Kojto 158:b23ee177fd68 333 __STATIC_INLINE uint32_t LL_IWDG_IsReady(IWDG_TypeDef *IWDGx)
Kojto 158:b23ee177fd68 334 {
Kojto 158:b23ee177fd68 335 return (READ_BIT(IWDGx->SR, IWDG_SR_PVU | IWDG_SR_RVU | IWDG_SR_WVU) == 0U);
Kojto 158:b23ee177fd68 336 }
Kojto 158:b23ee177fd68 337
Kojto 158:b23ee177fd68 338 /**
Kojto 158:b23ee177fd68 339 * @}
Kojto 158:b23ee177fd68 340 */
Kojto 158:b23ee177fd68 341
Kojto 158:b23ee177fd68 342
Kojto 158:b23ee177fd68 343 /**
Kojto 158:b23ee177fd68 344 * @}
Kojto 158:b23ee177fd68 345 */
Kojto 158:b23ee177fd68 346
Kojto 158:b23ee177fd68 347 /**
Kojto 158:b23ee177fd68 348 * @}
Kojto 158:b23ee177fd68 349 */
Kojto 158:b23ee177fd68 350
Kojto 158:b23ee177fd68 351 #endif /* IWDG) */
Kojto 158:b23ee177fd68 352
Kojto 158:b23ee177fd68 353 /**
Kojto 158:b23ee177fd68 354 * @}
Kojto 158:b23ee177fd68 355 */
Kojto 158:b23ee177fd68 356
Kojto 158:b23ee177fd68 357 #ifdef __cplusplus
Kojto 158:b23ee177fd68 358 }
Kojto 158:b23ee177fd68 359 #endif
Kojto 158:b23ee177fd68 360
Kojto 158:b23ee177fd68 361 #endif /* __STM32L0xx_LL_IWDG_H */
Kojto 158:b23ee177fd68 362
Kojto 158:b23ee177fd68 363 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/