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.

Committer:
AnnaBridge
Date:
Fri May 26 12:30:20 2017 +0100
Revision:
143:86740a56073b
Parent:
134:ad3be0349dc5
Release 143 of the mbed library.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bogdanm 85:024bf7f99721 1 /**
bogdanm 85:024bf7f99721 2 ******************************************************************************
bogdanm 85:024bf7f99721 3 * @file stm32f0xx_hal_wwdg.h
bogdanm 85:024bf7f99721 4 * @author MCD Application Team
<> 134:ad3be0349dc5 5 * @version V1.5.0
<> 134:ad3be0349dc5 6 * @date 04-November-2016
bogdanm 85:024bf7f99721 7 * @brief Header file of WWDG HAL module.
bogdanm 85:024bf7f99721 8 ******************************************************************************
bogdanm 85:024bf7f99721 9 * @attention
bogdanm 85:024bf7f99721 10 *
Kojto 122:f9eeca106725 11 * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
bogdanm 85:024bf7f99721 12 *
bogdanm 85:024bf7f99721 13 * Redistribution and use in source and binary forms, with or without modification,
bogdanm 85:024bf7f99721 14 * are permitted provided that the following conditions are met:
bogdanm 85:024bf7f99721 15 * 1. Redistributions of source code must retain the above copyright notice,
bogdanm 85:024bf7f99721 16 * this list of conditions and the following disclaimer.
bogdanm 85:024bf7f99721 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
bogdanm 85:024bf7f99721 18 * this list of conditions and the following disclaimer in the documentation
bogdanm 85:024bf7f99721 19 * and/or other materials provided with the distribution.
bogdanm 85:024bf7f99721 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
bogdanm 85:024bf7f99721 21 * may be used to endorse or promote products derived from this software
bogdanm 85:024bf7f99721 22 * without specific prior written permission.
bogdanm 85:024bf7f99721 23 *
bogdanm 85:024bf7f99721 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
bogdanm 85:024bf7f99721 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
bogdanm 85:024bf7f99721 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
bogdanm 85:024bf7f99721 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
bogdanm 85:024bf7f99721 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
bogdanm 85:024bf7f99721 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
bogdanm 85:024bf7f99721 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
bogdanm 85:024bf7f99721 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
bogdanm 85:024bf7f99721 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
bogdanm 85:024bf7f99721 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
bogdanm 85:024bf7f99721 34 *
bogdanm 85:024bf7f99721 35 ******************************************************************************
<> 134:ad3be0349dc5 36 */
bogdanm 85:024bf7f99721 37
bogdanm 85:024bf7f99721 38 /* Define to prevent recursive inclusion -------------------------------------*/
bogdanm 85:024bf7f99721 39 #ifndef __STM32F0xx_HAL_WWDG_H
bogdanm 85:024bf7f99721 40 #define __STM32F0xx_HAL_WWDG_H
bogdanm 85:024bf7f99721 41
bogdanm 85:024bf7f99721 42 #ifdef __cplusplus
bogdanm 85:024bf7f99721 43 extern "C" {
bogdanm 85:024bf7f99721 44 #endif
bogdanm 85:024bf7f99721 45
bogdanm 85:024bf7f99721 46 /* Includes ------------------------------------------------------------------*/
bogdanm 85:024bf7f99721 47 #include "stm32f0xx_hal_def.h"
bogdanm 85:024bf7f99721 48
bogdanm 85:024bf7f99721 49 /** @addtogroup STM32F0xx_HAL_Driver
bogdanm 85:024bf7f99721 50 * @{
bogdanm 85:024bf7f99721 51 */
bogdanm 85:024bf7f99721 52
bogdanm 85:024bf7f99721 53 /** @addtogroup WWDG
bogdanm 85:024bf7f99721 54 * @{
<> 134:ad3be0349dc5 55 */
bogdanm 85:024bf7f99721 56
<> 134:ad3be0349dc5 57 /* Exported types ------------------------------------------------------------*/
bogdanm 85:024bf7f99721 58
bogdanm 92:4fc01daae5a5 59 /** @defgroup WWDG_Exported_Types WWDG Exported Types
bogdanm 92:4fc01daae5a5 60 * @{
bogdanm 92:4fc01daae5a5 61 */
bogdanm 85:024bf7f99721 62
bogdanm 85:024bf7f99721 63 /**
<> 134:ad3be0349dc5 64 * @brief WWDG Init structure definition
bogdanm 85:024bf7f99721 65 */
bogdanm 85:024bf7f99721 66 typedef struct
bogdanm 85:024bf7f99721 67 {
<> 134:ad3be0349dc5 68 uint32_t Prescaler; /*!< Specifies the prescaler value of the WWDG.
<> 134:ad3be0349dc5 69 This parameter can be a value of @ref WWDG_Prescaler */
<> 134:ad3be0349dc5 70
<> 134:ad3be0349dc5 71 uint32_t Window; /*!< Specifies the WWDG window value to be compared to the downcounter.
<> 134:ad3be0349dc5 72 This parameter must be a number Min_Data = 0x40 and Max_Data = 0x7F */
<> 134:ad3be0349dc5 73
<> 134:ad3be0349dc5 74 uint32_t Counter; /*!< Specifies the WWDG free-running downcounter value.
<> 134:ad3be0349dc5 75 This parameter must be a number between Min_Data = 0x40 and Max_Data = 0x7F */
bogdanm 85:024bf7f99721 76
<> 134:ad3be0349dc5 77 uint32_t EWIMode ; /*!< Specifies if WWDG Early Wakeup Interupt is enable or not.
<> 134:ad3be0349dc5 78 This parameter can be a value of @ref WWDG_EWI_Mode */
bogdanm 85:024bf7f99721 79
<> 134:ad3be0349dc5 80 }WWDG_InitTypeDef;
bogdanm 85:024bf7f99721 81
<> 134:ad3be0349dc5 82 /**
<> 134:ad3be0349dc5 83 * @brief WWDG handle Structure definition
<> 134:ad3be0349dc5 84 */
bogdanm 85:024bf7f99721 85 typedef struct
bogdanm 85:024bf7f99721 86 {
<> 134:ad3be0349dc5 87 WWDG_TypeDef *Instance; /*!< Register base address */
bogdanm 85:024bf7f99721 88
<> 134:ad3be0349dc5 89 WWDG_InitTypeDef Init; /*!< WWDG required parameters */
<> 134:ad3be0349dc5 90
<> 134:ad3be0349dc5 91 }WWDG_HandleTypeDef;
bogdanm 92:4fc01daae5a5 92 /**
bogdanm 92:4fc01daae5a5 93 * @}
bogdanm 92:4fc01daae5a5 94 */
bogdanm 92:4fc01daae5a5 95
bogdanm 85:024bf7f99721 96 /* Exported constants --------------------------------------------------------*/
bogdanm 85:024bf7f99721 97
bogdanm 92:4fc01daae5a5 98 /** @defgroup WWDG_Exported_Constants WWDG Exported Constants
bogdanm 85:024bf7f99721 99 * @{
bogdanm 85:024bf7f99721 100 */
bogdanm 85:024bf7f99721 101
bogdanm 92:4fc01daae5a5 102 /** @defgroup WWDG_Interrupt_definition WWDG Interrupt definition
bogdanm 85:024bf7f99721 103 * @{
<> 134:ad3be0349dc5 104 */
<> 134:ad3be0349dc5 105 #define WWDG_IT_EWI WWDG_CFR_EWI /*!< Early wakeup interrupt */
bogdanm 85:024bf7f99721 106 /**
bogdanm 85:024bf7f99721 107 * @}
bogdanm 85:024bf7f99721 108 */
bogdanm 85:024bf7f99721 109
bogdanm 92:4fc01daae5a5 110 /** @defgroup WWDG_Flag_definition WWDG Flag definition
bogdanm 85:024bf7f99721 111 * @brief WWDG Flag definition
bogdanm 85:024bf7f99721 112 * @{
<> 134:ad3be0349dc5 113 */
<> 134:ad3be0349dc5 114 #define WWDG_FLAG_EWIF WWDG_SR_EWIF /*!< Early wakeup interrupt flag */
bogdanm 85:024bf7f99721 115 /**
bogdanm 85:024bf7f99721 116 * @}
bogdanm 85:024bf7f99721 117 */
bogdanm 85:024bf7f99721 118
bogdanm 92:4fc01daae5a5 119 /** @defgroup WWDG_Prescaler WWDG Prescaler
bogdanm 85:024bf7f99721 120 * @{
<> 134:ad3be0349dc5 121 */
<> 134:ad3be0349dc5 122 #define WWDG_PRESCALER_1 0x00000000U /*!< WWDG counter clock = (PCLK1/4096)/1 */
<> 134:ad3be0349dc5 123 #define WWDG_PRESCALER_2 WWDG_CFR_WDGTB_0 /*!< WWDG counter clock = (PCLK1/4096)/2 */
<> 134:ad3be0349dc5 124 #define WWDG_PRESCALER_4 WWDG_CFR_WDGTB_1 /*!< WWDG counter clock = (PCLK1/4096)/4 */
<> 134:ad3be0349dc5 125 #define WWDG_PRESCALER_8 WWDG_CFR_WDGTB /*!< WWDG counter clock = (PCLK1/4096)/8 */
<> 134:ad3be0349dc5 126 /**
<> 134:ad3be0349dc5 127 * @}
<> 134:ad3be0349dc5 128 */
<> 134:ad3be0349dc5 129
<> 134:ad3be0349dc5 130 /** @defgroup WWDG_EWI_Mode WWDG Early Wakeup Interrupt Mode
<> 134:ad3be0349dc5 131 * @{
<> 134:ad3be0349dc5 132 */
<> 134:ad3be0349dc5 133 #define WWDG_EWI_DISABLE 0x00000000U /*!< EWI Disable */
<> 134:ad3be0349dc5 134 #define WWDG_EWI_ENABLE WWDG_CFR_EWI /*!< EWI Enable */
Kojto 108:34e6b704fe68 135 /**
Kojto 108:34e6b704fe68 136 * @}
Kojto 108:34e6b704fe68 137 */
bogdanm 85:024bf7f99721 138
bogdanm 85:024bf7f99721 139 /**
bogdanm 85:024bf7f99721 140 * @}
bogdanm 85:024bf7f99721 141 */
bogdanm 85:024bf7f99721 142
Kojto 108:34e6b704fe68 143 /* Private macros ------------------------------------------------------------*/
<> 134:ad3be0349dc5 144
Kojto 108:34e6b704fe68 145 /** @defgroup WWDG_Private_Macros WWDG Private Macros
bogdanm 85:024bf7f99721 146 * @{
<> 134:ad3be0349dc5 147 */
<> 134:ad3be0349dc5 148 #define IS_WWDG_PRESCALER(__PRESCALER__) (((__PRESCALER__) == WWDG_PRESCALER_1) || \
<> 134:ad3be0349dc5 149 ((__PRESCALER__) == WWDG_PRESCALER_2) || \
<> 134:ad3be0349dc5 150 ((__PRESCALER__) == WWDG_PRESCALER_4) || \
<> 134:ad3be0349dc5 151 ((__PRESCALER__) == WWDG_PRESCALER_8))
Kojto 108:34e6b704fe68 152
<> 134:ad3be0349dc5 153 #define IS_WWDG_WINDOW(__WINDOW__) (((__WINDOW__) >= WWDG_CFR_W_6) && ((__WINDOW__) <= WWDG_CFR_W))
bogdanm 85:024bf7f99721 154
<> 134:ad3be0349dc5 155 #define IS_WWDG_COUNTER(__COUNTER__) (((__COUNTER__) >= WWDG_CR_T_6) && ((__COUNTER__) <= WWDG_CR_T))
<> 134:ad3be0349dc5 156
<> 134:ad3be0349dc5 157 #define IS_WWDG_EWI_MODE(__MODE__) (((__MODE__) == WWDG_EWI_ENABLE) || \
<> 134:ad3be0349dc5 158 ((__MODE__) == WWDG_EWI_DISABLE))
bogdanm 85:024bf7f99721 159 /**
bogdanm 85:024bf7f99721 160 * @}
<> 134:ad3be0349dc5 161 */
bogdanm 85:024bf7f99721 162
<> 134:ad3be0349dc5 163
Kojto 108:34e6b704fe68 164 /* Exported macros ------------------------------------------------------------*/
bogdanm 85:024bf7f99721 165
bogdanm 92:4fc01daae5a5 166 /** @defgroup WWDG_Exported_Macros WWDG Exported Macros
<> 134:ad3be0349dc5 167 * @{
bogdanm 85:024bf7f99721 168 */
bogdanm 85:024bf7f99721 169
bogdanm 85:024bf7f99721 170 /**
Kojto 108:34e6b704fe68 171 * @brief Enable the WWDG peripheral.
<> 134:ad3be0349dc5 172 * @param __HANDLE__ WWDG handle
bogdanm 85:024bf7f99721 173 * @retval None
bogdanm 85:024bf7f99721 174 */
<> 134:ad3be0349dc5 175 #define __HAL_WWDG_ENABLE(__HANDLE__) SET_BIT((__HANDLE__)->Instance->CR, WWDG_CR_WDGA)
Kojto 93:e188a91d3eaa 176
Kojto 93:e188a91d3eaa 177 /**
Kojto 108:34e6b704fe68 178 * @brief Enable the WWDG early wakeup interrupt.
Kojto 93:e188a91d3eaa 179 * @param __HANDLE__: WWDG handle
<> 134:ad3be0349dc5 180 * @param __INTERRUPT__ specifies the interrupt to enable.
Kojto 93:e188a91d3eaa 181 * This parameter can be one of the following values:
Kojto 93:e188a91d3eaa 182 * @arg WWDG_IT_EWI: Early wakeup interrupt
Kojto 93:e188a91d3eaa 183 * @note Once enabled this interrupt cannot be disabled except by a system reset.
Kojto 93:e188a91d3eaa 184 * @retval None
Kojto 93:e188a91d3eaa 185 */
<> 134:ad3be0349dc5 186 #define __HAL_WWDG_ENABLE_IT(__HANDLE__, __INTERRUPT__) SET_BIT((__HANDLE__)->Instance->CFR, (__INTERRUPT__))
Kojto 93:e188a91d3eaa 187
Kojto 93:e188a91d3eaa 188 /**
Kojto 108:34e6b704fe68 189 * @brief Check whether the selected WWDG interrupt has occurred or not.
<> 134:ad3be0349dc5 190 * @param __HANDLE__ WWDG handle
<> 134:ad3be0349dc5 191 * @param __INTERRUPT__ specifies the it to check.
Kojto 93:e188a91d3eaa 192 * This parameter can be one of the following values:
Kojto 93:e188a91d3eaa 193 * @arg WWDG_FLAG_EWIF: Early wakeup interrupt IT
Kojto 93:e188a91d3eaa 194 * @retval The new state of WWDG_FLAG (SET or RESET).
Kojto 93:e188a91d3eaa 195 */
<> 134:ad3be0349dc5 196 #define __HAL_WWDG_GET_IT(__HANDLE__, __INTERRUPT__) __HAL_WWDG_GET_FLAG((__HANDLE__),(__INTERRUPT__))
Kojto 93:e188a91d3eaa 197
Kojto 108:34e6b704fe68 198 /** @brief Clear the WWDG interrupt pending bits.
Kojto 93:e188a91d3eaa 199 * bits to clear the selected interrupt pending bits.
<> 134:ad3be0349dc5 200 * @param __HANDLE__ WWDG handle
<> 134:ad3be0349dc5 201 * @param __INTERRUPT__ specifies the interrupt pending bit to clear.
Kojto 93:e188a91d3eaa 202 * This parameter can be one of the following values:
Kojto 93:e188a91d3eaa 203 * @arg WWDG_FLAG_EWIF: Early wakeup interrupt flag
Kojto 93:e188a91d3eaa 204 */
<> 134:ad3be0349dc5 205 #define __HAL_WWDG_CLEAR_IT(__HANDLE__, __INTERRUPT__) __HAL_WWDG_CLEAR_FLAG((__HANDLE__), (__INTERRUPT__))
bogdanm 85:024bf7f99721 206
bogdanm 85:024bf7f99721 207 /**
Kojto 108:34e6b704fe68 208 * @brief Check whether the specified WWDG flag is set or not.
<> 134:ad3be0349dc5 209 * @param __HANDLE__ WWDG handle
<> 134:ad3be0349dc5 210 * @param __FLAG__ specifies the flag to check.
<> 134:ad3be0349dc5 211 * This parameter can be one of the following values:
bogdanm 85:024bf7f99721 212 * @arg WWDG_FLAG_EWIF: Early wakeup interrupt flag
bogdanm 85:024bf7f99721 213 * @retval The new state of WWDG_FLAG (SET or RESET).
bogdanm 85:024bf7f99721 214 */
Kojto 93:e188a91d3eaa 215 #define __HAL_WWDG_GET_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->SR & (__FLAG__)) == (__FLAG__))
bogdanm 85:024bf7f99721 216
bogdanm 85:024bf7f99721 217 /**
Kojto 108:34e6b704fe68 218 * @brief Clear the WWDG's pending flags.
<> 134:ad3be0349dc5 219 * @param __HANDLE__ WWDG handle
<> 134:ad3be0349dc5 220 * @param __FLAG__ specifies the flag to clear.
<> 134:ad3be0349dc5 221 * This parameter can be one of the following values:
bogdanm 85:024bf7f99721 222 * @arg WWDG_FLAG_EWIF: Early wakeup interrupt flag
bogdanm 85:024bf7f99721 223 * @retval None
bogdanm 85:024bf7f99721 224 */
Kojto 93:e188a91d3eaa 225 #define __HAL_WWDG_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->SR = ~(__FLAG__))
bogdanm 85:024bf7f99721 226
Kojto 108:34e6b704fe68 227 /** @brief Check whether the specified WWDG interrupt source is enabled or not.
<> 134:ad3be0349dc5 228 * @param __HANDLE__ WWDG Handle.
<> 134:ad3be0349dc5 229 * @param __INTERRUPT__ specifies the WWDG interrupt source to check.
<> 134:ad3be0349dc5 230 * This parameter can be one of the following values:
Kojto 93:e188a91d3eaa 231 * @arg WWDG_IT_EWI: Early Wakeup Interrupt
Kojto 93:e188a91d3eaa 232 * @retval state of __INTERRUPT__ (TRUE or FALSE).
bogdanm 85:024bf7f99721 233 */
Kojto 93:e188a91d3eaa 234 #define __HAL_WWDG_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->CFR & (__INTERRUPT__)) == (__INTERRUPT__))
bogdanm 92:4fc01daae5a5 235
bogdanm 85:024bf7f99721 236 /**
bogdanm 85:024bf7f99721 237 * @}
bogdanm 85:024bf7f99721 238 */
bogdanm 85:024bf7f99721 239
bogdanm 85:024bf7f99721 240 /* Exported functions --------------------------------------------------------*/
bogdanm 85:024bf7f99721 241
bogdanm 92:4fc01daae5a5 242 /** @addtogroup WWDG_Exported_Functions
bogdanm 92:4fc01daae5a5 243 * @{
bogdanm 92:4fc01daae5a5 244 */
bogdanm 92:4fc01daae5a5 245
bogdanm 92:4fc01daae5a5 246 /** @addtogroup WWDG_Exported_Functions_Group1
bogdanm 92:4fc01daae5a5 247 * @{
bogdanm 92:4fc01daae5a5 248 */
bogdanm 85:024bf7f99721 249 /* Initialization/de-initialization functions **********************************/
bogdanm 92:4fc01daae5a5 250 HAL_StatusTypeDef HAL_WWDG_Init(WWDG_HandleTypeDef *hwwdg);
bogdanm 92:4fc01daae5a5 251 void HAL_WWDG_MspInit(WWDG_HandleTypeDef *hwwdg);
bogdanm 92:4fc01daae5a5 252 /**
bogdanm 92:4fc01daae5a5 253 * @}
bogdanm 92:4fc01daae5a5 254 */
bogdanm 92:4fc01daae5a5 255
bogdanm 92:4fc01daae5a5 256 /** @addtogroup WWDG_Exported_Functions_Group2
bogdanm 92:4fc01daae5a5 257 * @{
bogdanm 92:4fc01daae5a5 258 */
bogdanm 85:024bf7f99721 259 /* I/O operation functions ******************************************************/
<> 134:ad3be0349dc5 260 HAL_StatusTypeDef HAL_WWDG_Refresh(WWDG_HandleTypeDef *hwwdg);
bogdanm 92:4fc01daae5a5 261 void HAL_WWDG_IRQHandler(WWDG_HandleTypeDef *hwwdg);
<> 134:ad3be0349dc5 262 void HAL_WWDG_EarlyWakeupCallback(WWDG_HandleTypeDef* hwwdg);
bogdanm 92:4fc01daae5a5 263 /**
bogdanm 92:4fc01daae5a5 264 * @}
bogdanm 92:4fc01daae5a5 265 */
bogdanm 92:4fc01daae5a5 266
bogdanm 85:024bf7f99721 267 /**
bogdanm 85:024bf7f99721 268 * @}
<> 134:ad3be0349dc5 269 */
bogdanm 85:024bf7f99721 270
bogdanm 85:024bf7f99721 271 /**
bogdanm 85:024bf7f99721 272 * @}
<> 134:ad3be0349dc5 273 */
bogdanm 85:024bf7f99721 274
bogdanm 92:4fc01daae5a5 275 /**
bogdanm 92:4fc01daae5a5 276 * @}
<> 134:ad3be0349dc5 277 */
bogdanm 92:4fc01daae5a5 278
bogdanm 85:024bf7f99721 279 #ifdef __cplusplus
bogdanm 85:024bf7f99721 280 }
bogdanm 85:024bf7f99721 281 #endif
bogdanm 85:024bf7f99721 282
bogdanm 85:024bf7f99721 283 #endif /* __STM32F0xx_HAL_WWDG_H */
bogdanm 85:024bf7f99721 284
bogdanm 85:024bf7f99721 285 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/