2 ******************************************************************************
3 * @file stm32f30x_wwdg.h
4 * @author MCD Application Team
6 * @date 27-February-2014
7 * @brief This file contains all the functions prototypes for the WWDG
9 ******************************************************************************
12 * <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
14 * Redistribution and use in source and binary forms, with or without modification,
15 * are permitted provided that the following conditions are met:
16 * 1. Redistributions of source code must retain the above copyright notice,
17 * this list of conditions and the following disclaimer.
18 * 2. Redistributions in binary form must reproduce the above copyright notice,
19 * this list of conditions and the following disclaimer in the documentation
20 * and/or other materials provided with the distribution.
21 * 3. Neither the name of STMicroelectronics nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
28 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
31 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
32 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
33 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
34 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 ******************************************************************************
39 /* Define to prevent recursive inclusion -------------------------------------*/
40 #ifndef __STM32F30x_WWDG_H
41 #define __STM32F30x_WWDG_H
47 /* Includes ------------------------------------------------------------------*/
48 #include "stm32f30x.h"
50 /** @addtogroup STM32F30x_StdPeriph_Driver
57 /* Exported types ------------------------------------------------------------*/
58 /* Exported constants --------------------------------------------------------*/
60 /** @defgroup WWDG_Exported_Constants
64 /** @defgroup WWDG_Prescaler
68 #define WWDG_Prescaler_1 ((uint32_t)0x00000000)
69 #define WWDG_Prescaler_2 ((uint32_t)0x00000080)
70 #define WWDG_Prescaler_4 ((uint32_t)0x00000100)
71 #define WWDG_Prescaler_8 ((uint32_t)0x00000180)
72 #define IS_WWDG_PRESCALER(PRESCALER) (((PRESCALER) == WWDG_Prescaler_1) || \
73 ((PRESCALER) == WWDG_Prescaler_2) || \
74 ((PRESCALER) == WWDG_Prescaler_4) || \
75 ((PRESCALER) == WWDG_Prescaler_8))
76 #define IS_WWDG_WINDOW_VALUE(VALUE) ((VALUE) <= 0x7F)
77 #define IS_WWDG_COUNTER(COUNTER) (((COUNTER) >= 0x40) && ((COUNTER) <= 0x7F))
87 /* Exported macro ------------------------------------------------------------*/
88 /* Exported functions ------------------------------------------------------- */
89 /* Function used to set the WWDG configuration to the default reset state ****/
90 void WWDG_DeInit(void);
92 /* Prescaler, Refresh window and Counter configuration functions **************/
93 void WWDG_SetPrescaler(uint32_t WWDG_Prescaler);
94 void WWDG_SetWindowValue(uint8_t WindowValue);
95 void WWDG_EnableIT(void);
96 void WWDG_SetCounter(uint8_t Counter);
98 /* WWDG activation functions **************************************************/
99 void WWDG_Enable(uint8_t Counter);
101 /* Interrupts and flags management functions **********************************/
102 FlagStatus WWDG_GetFlagStatus(void);
103 void WWDG_ClearFlag(void);
109 #endif /* __STM32F30x_WWDG_H */
119 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/