STM32F10x Standard Peripherals Library  3.5.0
/opt/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/STM32F10x_StdPeriph_Driver/inc/stm32f10x_iwdg.h
Go to the documentation of this file.
00001 
00023 /* Define to prevent recursive inclusion -------------------------------------*/
00024 #ifndef __STM32F10x_IWDG_H
00025 #define __STM32F10x_IWDG_H
00026 
00027 #ifdef __cplusplus
00028  extern "C" {
00029 #endif
00030 
00031 /* Includes ------------------------------------------------------------------*/
00032 #include "stm32f10x.h"
00033 
00058 #define IWDG_WriteAccess_Enable     ((uint16_t)0x5555)
00059 #define IWDG_WriteAccess_Disable    ((uint16_t)0x0000)
00060 #define IS_IWDG_WRITE_ACCESS(ACCESS) (((ACCESS) == IWDG_WriteAccess_Enable) || \
00061                                       ((ACCESS) == IWDG_WriteAccess_Disable))
00062 
00070 #define IWDG_Prescaler_4            ((uint8_t)0x00)
00071 #define IWDG_Prescaler_8            ((uint8_t)0x01)
00072 #define IWDG_Prescaler_16           ((uint8_t)0x02)
00073 #define IWDG_Prescaler_32           ((uint8_t)0x03)
00074 #define IWDG_Prescaler_64           ((uint8_t)0x04)
00075 #define IWDG_Prescaler_128          ((uint8_t)0x05)
00076 #define IWDG_Prescaler_256          ((uint8_t)0x06)
00077 #define IS_IWDG_PRESCALER(PRESCALER) (((PRESCALER) == IWDG_Prescaler_4)  || \
00078                                       ((PRESCALER) == IWDG_Prescaler_8)  || \
00079                                       ((PRESCALER) == IWDG_Prescaler_16) || \
00080                                       ((PRESCALER) == IWDG_Prescaler_32) || \
00081                                       ((PRESCALER) == IWDG_Prescaler_64) || \
00082                                       ((PRESCALER) == IWDG_Prescaler_128)|| \
00083                                       ((PRESCALER) == IWDG_Prescaler_256))
00084 
00092 #define IWDG_FLAG_PVU               ((uint16_t)0x0001)
00093 #define IWDG_FLAG_RVU               ((uint16_t)0x0002)
00094 #define IS_IWDG_FLAG(FLAG) (((FLAG) == IWDG_FLAG_PVU) || ((FLAG) == IWDG_FLAG_RVU))
00095 #define IS_IWDG_RELOAD(RELOAD) ((RELOAD) <= 0xFFF)
00096 
00116 void IWDG_WriteAccessCmd(uint16_t IWDG_WriteAccess);
00117 void IWDG_SetPrescaler(uint8_t IWDG_Prescaler);
00118 void IWDG_SetReload(uint16_t Reload);
00119 void IWDG_ReloadCounter(void);
00120 void IWDG_Enable(void);
00121 FlagStatus IWDG_GetFlagStatus(uint16_t IWDG_FLAG);
00122 
00123 #ifdef __cplusplus
00124 }
00125 #endif
00126 
00127 #endif /* __STM32F10x_IWDG_H */
00128 
00140 /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/