my fork
Fork of mbed by
Diff: TARGET_NUCLEO_L053R8/stm32l0xx_hal_wwdg.h
- Revision:
- 92:4fc01daae5a5
- Parent:
- 84:0b3ab51c8877
- Child:
- 96:487b796308b0
--- a/TARGET_NUCLEO_L053R8/stm32l0xx_hal_wwdg.h Wed Oct 29 11:02:04 2014 +0000 +++ b/TARGET_NUCLEO_L053R8/stm32l0xx_hal_wwdg.h Thu Nov 27 13:33:22 2014 +0000 @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32l0xx_hal_wwdg.h * @author MCD Application Team - * @version V1.0.0 - * @date 22-April-2014 + * @version V1.1.0 + * @date 18-June-2014 * @brief Header file of WWDG HAL module. ****************************************************************************** * @attention @@ -56,6 +56,10 @@ /* Exported types ------------------------------------------------------------*/ +/** @defgroup WWDG_Exported_Types WWDG Exported Types + * @{ + */ + /** * @brief WWDG HAL State Structure definition */ @@ -66,7 +70,6 @@ HAL_WWDG_STATE_BUSY = 0x02, /*!< WWDG internal process is ongoing */ HAL_WWDG_STATE_TIMEOUT = 0x03, /*!< WWDG timeout state */ HAL_WWDG_STATE_ERROR = 0x04 /*!< WWDG error state */ - }HAL_WWDG_StateTypeDef; /** @@ -100,13 +103,17 @@ }WWDG_HandleTypeDef; +/** + * @} + */ + /* Exported constants --------------------------------------------------------*/ -/** @defgroup WWDG_Exported_Constants +/** @defgroup WWDG_Exported_Constants WWDG Exported Constants * @{ */ -/** @defgroup WWDG_BitAddress_AliasRegion +/** @defgroup WWDG_BitAddress_AliasRegion WWDG BitAddress AliasRegion * @brief WWDG registers bit address in the alias region * @{ */ @@ -119,59 +126,59 @@ * @} */ -/** @defgroup WWDG_Interrupt_definition +/** @defgroup WWDG_Interrupt_definition WWDG Interrupt definition * @{ */ #define WWDG_IT_EWI ((uint32_t)WWDG_CFR_EWI) -#define IS_WWDG_IT(IT) ((IT) == WWDG_IT_EWI) +#define IS_WWDG_IT(__IT__) ((__IT__) == WWDG_IT_EWI) /** * @} */ -/** @defgroup WWDG_Flag_definition +/** @defgroup WWDG_Flag_definition WWDG Flag definition * @brief WWDG Flag definition * @{ */ -#define WWDG_FLAG_EWIF ((uint32_t)0x0001) /*!< Early wakeup interrupt flag */ +#define WWDG_FLAG_EWIF ((uint32_t)WWDG_SR_EWIF) /*!< Early wakeup interrupt flag */ -#define IS_WWDG_FLAG(FLAG) ((FLAG) == WWDG_FLAG_EWIF)) +#define IS_WWDG_FLAG(__FLAG__) ((__FLAG__) == WWDG_FLAG_EWIF)) /** * @} */ -/** @defgroup WWDG_Prescaler +/** @defgroup WWDG_Prescaler WWDG Prescaler * @{ */ #define WWDG_PRESCALER_1 ((uint32_t)0x00000000) /*!< WWDG counter clock = (PCLK1/4096)/1 */ -#define WWDG_PRESCALER_2 ((uint32_t)0x00000080) /*!< WWDG counter clock = (PCLK1/4096)/2 */ -#define WWDG_PRESCALER_4 ((uint32_t)0x00000100) /*!< WWDG counter clock = (PCLK1/4096)/4 */ -#define WWDG_PRESCALER_8 ((uint32_t)0x00000180) /*!< WWDG counter clock = (PCLK1/4096)/8 */ +#define WWDG_PRESCALER_2 ((uint32_t)WWDG_CFR_WDGTB0) /*!< WWDG counter clock = (PCLK1/4096)/2 */ +#define WWDG_PRESCALER_4 ((uint32_t)WWDG_CFR_WDGTB1) /*!< WWDG counter clock = (PCLK1/4096)/4 */ +#define WWDG_PRESCALER_8 ((uint32_t)WWDG_CFR_WDGTB) /*!< WWDG counter clock = (PCLK1/4096)/8 */ -#define IS_WWDG_PRESCALER(PRESCALER) (((PRESCALER) == WWDG_PRESCALER_1) || \ - ((PRESCALER) == WWDG_PRESCALER_2) || \ - ((PRESCALER) == WWDG_PRESCALER_4) || \ - ((PRESCALER) == WWDG_PRESCALER_8)) +#define IS_WWDG_PRESCALER(__PRESCALER__) (((__PRESCALER__) == WWDG_PRESCALER_1) || \ + ((__PRESCALER__) == WWDG_PRESCALER_2) || \ + ((__PRESCALER__) == WWDG_PRESCALER_4) || \ + ((__PRESCALER__) == WWDG_PRESCALER_8)) /** * @} */ -/** @defgroup WWDG_Window +/** @defgroup WWDG_Window WWDG Window * @{ */ -#define IS_WWDG_WINDOW(WINDOW) ((WINDOW) <= 0x7F) +#define IS_WWDG_WINDOW(__WINDOW__) ((__WINDOW__) <= 0x7F) /** * @} */ -/** @defgroup WWDG_Counter +/** @defgroup WWDG_Counter WWDG Counter * @{ */ -#define IS_WWDG_COUNTER(COUNTER) (((COUNTER) >= 0x40) && ((COUNTER) <= 0x7F)) +#define IS_WWDG_COUNTER(__COUNTER__) (((__COUNTER__) >= 0x40) && ((__COUNTER__) <= 0x7F)) /** * @} @@ -183,7 +190,7 @@ /* Exported macro ------------------------------------------------------------*/ -/** @defgroup WWDG_Exported_Macro +/** @defgroup WWDG_Exported_Macros WWDG Exported Macros * @{ */ @@ -198,7 +205,7 @@ * @param __HANDLE__: WWDG handle * @retval None */ -#define __HAL_WWDG_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= WWDG_CR_WDGA) +#define __HAL_WWDG_ENABLE(__HANDLE__) SET_BIT((__HANDLE__)->Instance->CR, WWDG_CR_WDGA) /** * @brief Gets the selected WWDG's flag status. @@ -218,7 +225,7 @@ * @arg WWDG_FLAG_EWIF: Early wakeup interrupt flag * @retval None */ -#define __HAL_WWDG_CLEAR_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->SR) &= ~(__FLAG__)) +#define __HAL_WWDG_CLEAR_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->SR) = ~(__FLAG__)) /** * @brief Enables the WWDG early wakeup interrupt. @@ -230,12 +237,25 @@ */ #define __HAL_WWDG_ENABLE_IT(__INTERRUPT__) (*(__IO uint32_t *) CFR_BASE |= (__INTERRUPT__)) +/** @brief Clear the WWDG's interrupt pending bits + * bits to clear the selected interrupt pending bits. + * @param __HANDLE__: WWDG handle + * @param __INTERRUPT__: specifies the interrupt pending bit to clear. + * This parameter can be one of the following values: + * @arg WWDG_FLAG_EWIF: Early wakeup interrupt flag + */ +#define __HAL_WWDG_CLEAR_IT(__HANDLE__, __INTERRUPT__) __HAL_WWDG_CLEAR_FLAG((__HANDLE__), (__INTERRUPT__)) + /** * @} */ /* Exported functions --------------------------------------------------------*/ +/** @addtogroup WWDG_Exported_Functions + * @{ + */ + /* Initialization/de-initialization functions **********************************/ HAL_StatusTypeDef HAL_WWDG_Init(WWDG_HandleTypeDef *hwwdg); HAL_StatusTypeDef HAL_WWDG_DeInit(WWDG_HandleTypeDef *hwwdg); @@ -254,6 +274,10 @@ /** * @} + */ + +/** + * @} */ /**