Added STM32F4xx StdPeriph Driver sources
[fw/stlink] / example / stm32f4 / STM32F4xx_StdPeriph_Driver / inc / stm32f4xx_iwdg.h
1 /**
2   ******************************************************************************
3   * @file    stm32f4xx_iwdg.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 IWDG 
8   *          firmware 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_IWDG_H
25 #define __STM32F4xx_IWDG_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 IWDG
39   * @{
40   */
41
42 /* Exported types ------------------------------------------------------------*/
43 /* Exported constants --------------------------------------------------------*/
44
45 /** @defgroup IWDG_Exported_Constants
46   * @{
47   */
48   
49 /** @defgroup IWDG_WriteAccess
50   * @{
51   */
52 #define IWDG_WriteAccess_Enable     ((uint16_t)0x5555)
53 #define IWDG_WriteAccess_Disable    ((uint16_t)0x0000)
54 #define IS_IWDG_WRITE_ACCESS(ACCESS) (((ACCESS) == IWDG_WriteAccess_Enable) || \
55                                       ((ACCESS) == IWDG_WriteAccess_Disable))
56 /**
57   * @}
58   */
59
60 /** @defgroup IWDG_prescaler 
61   * @{
62   */
63 #define IWDG_Prescaler_4            ((uint8_t)0x00)
64 #define IWDG_Prescaler_8            ((uint8_t)0x01)
65 #define IWDG_Prescaler_16           ((uint8_t)0x02)
66 #define IWDG_Prescaler_32           ((uint8_t)0x03)
67 #define IWDG_Prescaler_64           ((uint8_t)0x04)
68 #define IWDG_Prescaler_128          ((uint8_t)0x05)
69 #define IWDG_Prescaler_256          ((uint8_t)0x06)
70 #define IS_IWDG_PRESCALER(PRESCALER) (((PRESCALER) == IWDG_Prescaler_4)  || \
71                                       ((PRESCALER) == IWDG_Prescaler_8)  || \
72                                       ((PRESCALER) == IWDG_Prescaler_16) || \
73                                       ((PRESCALER) == IWDG_Prescaler_32) || \
74                                       ((PRESCALER) == IWDG_Prescaler_64) || \
75                                       ((PRESCALER) == IWDG_Prescaler_128)|| \
76                                       ((PRESCALER) == IWDG_Prescaler_256))
77 /**
78   * @}
79   */
80
81 /** @defgroup IWDG_Flag 
82   * @{
83   */
84 #define IWDG_FLAG_PVU               ((uint16_t)0x0001)
85 #define IWDG_FLAG_RVU               ((uint16_t)0x0002)
86 #define IS_IWDG_FLAG(FLAG) (((FLAG) == IWDG_FLAG_PVU) || ((FLAG) == IWDG_FLAG_RVU))
87 #define IS_IWDG_RELOAD(RELOAD) ((RELOAD) <= 0xFFF)
88 /**
89   * @}
90   */
91
92 /**
93   * @}
94   */
95
96 /* Exported macro ------------------------------------------------------------*/
97 /* Exported functions --------------------------------------------------------*/
98
99 /* Prescaler and Counter configuration functions ******************************/
100 void IWDG_WriteAccessCmd(uint16_t IWDG_WriteAccess);
101 void IWDG_SetPrescaler(uint8_t IWDG_Prescaler);
102 void IWDG_SetReload(uint16_t Reload);
103 void IWDG_ReloadCounter(void);
104
105 /* IWDG activation function ***************************************************/
106 void IWDG_Enable(void);
107
108 /* Flag management function ***************************************************/
109 FlagStatus IWDG_GetFlagStatus(uint16_t IWDG_FLAG);
110
111 #ifdef __cplusplus
112 }
113 #endif
114
115 #endif /* __STM32F4xx_IWDG_H */
116
117 /**
118   * @}
119   */
120
121 /**
122   * @}
123   */
124
125 /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/