Merge branch 'jnosky/master'
[fw/stlink] / exampleF4 / STM32F4xx_StdPeriph_Driver / inc / stm32f4xx_wwdg.h
1 /**
2   ******************************************************************************
3   * @file    stm32f4xx_wwdg.h
4   * @author  MCD Application Team
5   * @version V1.0.0RC1
6   * @date    25-August-2011
7   * @brief   This file contains all the functions prototypes for the WWDG firmware
8   *          library.
9   ******************************************************************************
10   * @attention
11   *
12   * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
13   * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
14   * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
15   * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
16   * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
17   * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
18   *
19   * <h2><center>&copy; COPYRIGHT 2011 STMicroelectronics</center></h2>
20   ******************************************************************************
21   */
22
23 /* Define to prevent recursive inclusion -------------------------------------*/
24 #ifndef __STM32F4xx_WWDG_H
25 #define __STM32F4xx_WWDG_H
26
27 #ifdef __cplusplus
28  extern "C" {
29 #endif
30
31 /* Includes ------------------------------------------------------------------*/
32 #include "stm32f4xx.h"
33
34 /** @addtogroup STM32F4xx_StdPeriph_Driver
35   * @{
36   */
37
38 /** @addtogroup WWDG
39   * @{
40   */ 
41
42 /* Exported types ------------------------------------------------------------*/
43 /* Exported constants --------------------------------------------------------*/
44
45 /** @defgroup WWDG_Exported_Constants
46   * @{
47   */ 
48   
49 /** @defgroup WWDG_Prescaler 
50   * @{
51   */
52   
53 #define WWDG_Prescaler_1    ((uint32_t)0x00000000)
54 #define WWDG_Prescaler_2    ((uint32_t)0x00000080)
55 #define WWDG_Prescaler_4    ((uint32_t)0x00000100)
56 #define WWDG_Prescaler_8    ((uint32_t)0x00000180)
57 #define IS_WWDG_PRESCALER(PRESCALER) (((PRESCALER) == WWDG_Prescaler_1) || \
58                                       ((PRESCALER) == WWDG_Prescaler_2) || \
59                                       ((PRESCALER) == WWDG_Prescaler_4) || \
60                                       ((PRESCALER) == WWDG_Prescaler_8))
61 #define IS_WWDG_WINDOW_VALUE(VALUE) ((VALUE) <= 0x7F)
62 #define IS_WWDG_COUNTER(COUNTER) (((COUNTER) >= 0x40) && ((COUNTER) <= 0x7F))
63
64 /**
65   * @}
66   */ 
67
68 /**
69   * @}
70   */ 
71
72 /* Exported macro ------------------------------------------------------------*/
73 /* Exported functions --------------------------------------------------------*/
74   
75 /*  Function used to set the WWDG configuration to the default reset state ****/  
76 void WWDG_DeInit(void);
77
78 /* Prescaler, Refresh window and Counter configuration functions **************/
79 void WWDG_SetPrescaler(uint32_t WWDG_Prescaler);
80 void WWDG_SetWindowValue(uint8_t WindowValue);
81 void WWDG_EnableIT(void);
82 void WWDG_SetCounter(uint8_t Counter);
83
84 /* WWDG activation function ***************************************************/
85 void WWDG_Enable(uint8_t Counter);
86
87 /* Interrupts and flags management functions **********************************/
88 FlagStatus WWDG_GetFlagStatus(void);
89 void WWDG_ClearFlag(void);
90
91 #ifdef __cplusplus
92 }
93 #endif
94
95 #endif /* __STM32F4xx_WWDG_H */
96
97 /**
98   * @}
99   */ 
100
101 /**
102   * @}
103   */ 
104
105 /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/