Rev Author Line No. Line
3328 povik 1 /**
2 ******************************************************************************
3 * @file stm32f10x_iwdg.h
4 * @author MCD Application Team
5 * @version V3.1.0
6 * @date 06/19/2009
7 * @brief This file contains all the functions prototypes for the IWDG
8 * firmware library.
9 ******************************************************************************
10 * @copy
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 2009 STMicroelectronics</center></h2>
20 */
21  
22 /* Define to prevent recursive inclusion -------------------------------------*/
23 #ifndef __STM32F10x_IWDG_H
24 #define __STM32F10x_IWDG_H
25  
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29  
30 /* Includes ------------------------------------------------------------------*/
31 #include "stm32f10x.h"
32  
33 /** @addtogroup STM32F10x_StdPeriph_Driver
34 * @{
35 */
36  
37 /** @addtogroup IWDG
38 * @{
39 */
40  
41 /** @defgroup IWDG_Exported_Types
42 * @{
43 */
44  
45 /**
46 * @}
47 */
48  
49 /** @defgroup IWDG_Exported_Constants
50 * @{
51 */
52  
53 /** @defgroup IWDG_WriteAccess
54 * @{
55 */
56  
57 #define IWDG_WriteAccess_Enable ((uint16_t)0x5555)
58 #define IWDG_WriteAccess_Disable ((uint16_t)0x0000)
59 #define IS_IWDG_WRITE_ACCESS(ACCESS) (((ACCESS) == IWDG_WriteAccess_Enable) || \
60 ((ACCESS) == IWDG_WriteAccess_Disable))
61 /**
62 * @}
63 */
64  
65 /** @defgroup IWDG_prescaler
66 * @{
67 */
68  
69 #define IWDG_Prescaler_4 ((uint8_t)0x00)
70 #define IWDG_Prescaler_8 ((uint8_t)0x01)
71 #define IWDG_Prescaler_16 ((uint8_t)0x02)
72 #define IWDG_Prescaler_32 ((uint8_t)0x03)
73 #define IWDG_Prescaler_64 ((uint8_t)0x04)
74 #define IWDG_Prescaler_128 ((uint8_t)0x05)
75 #define IWDG_Prescaler_256 ((uint8_t)0x06)
76 #define IS_IWDG_PRESCALER(PRESCALER) (((PRESCALER) == IWDG_Prescaler_4) || \
77 ((PRESCALER) == IWDG_Prescaler_8) || \
78 ((PRESCALER) == IWDG_Prescaler_16) || \
79 ((PRESCALER) == IWDG_Prescaler_32) || \
80 ((PRESCALER) == IWDG_Prescaler_64) || \
81 ((PRESCALER) == IWDG_Prescaler_128)|| \
82 ((PRESCALER) == IWDG_Prescaler_256))
83 /**
84 * @}
85 */
86  
87 /** @defgroup IWDG_Flag
88 * @{
89 */
90  
91 #define IWDG_FLAG_PVU ((uint16_t)0x0001)
92 #define IWDG_FLAG_RVU ((uint16_t)0x0002)
93 #define IS_IWDG_FLAG(FLAG) (((FLAG) == IWDG_FLAG_PVU) || ((FLAG) == IWDG_FLAG_RVU))
94 #define IS_IWDG_RELOAD(RELOAD) ((RELOAD) <= 0xFFF)
95 /**
96 * @}
97 */
98  
99 /**
100 * @}
101 */
102  
103 /** @defgroup IWDG_Exported_Macros
104 * @{
105 */
106  
107 /**
108 * @}
109 */
110  
111 /** @defgroup IWDG_Exported_Functions
112 * @{
113 */
114  
115 void IWDG_WriteAccessCmd(uint16_t IWDG_WriteAccess);
116 void IWDG_SetPrescaler(uint8_t IWDG_Prescaler);
117 void IWDG_SetReload(uint16_t Reload);
118 void IWDG_ReloadCounter(void);
119 void IWDG_Enable(void);
120 FlagStatus IWDG_GetFlagStatus(uint16_t IWDG_FLAG);
121  
122 #ifdef __cplusplus
123 }
124 #endif
125  
126 #endif /* __STM32F10x_IWDG_H */
127 /**
128 * @}
129 */
130  
131 /**
132 * @}
133 */
134  
135 /**
136 * @}
137 */
138  
139 /******************* (C) COPYRIGHT 2009 STMicroelectronics *****END OF FILE****/