mbed library sources. Supersedes mbed-src.

Dependents:   Nucleo_Hello_Encoder BLE_iBeaconScan AM1805_DEMO DISCO-F429ZI_ExportTemplate1 ... more

Committer:
AnnaBridge
Date:
Wed Feb 20 22:31:08 2019 +0000
Revision:
189:f392fc9709a3
Parent:
186:707f6e361f3e
mbed library release version 165

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