00001
00029
00030 #ifndef __STM32F4xx_IWDG_H
00031 #define __STM32F4xx_IWDG_H
00032
00033 #ifdef __cplusplus
00034 extern "C" {
00035 #endif
00036
00037
00038 #include "stm32f4xx.h"
00039
00048
00049
00050
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
00069 #define IWDG_Prescaler_4 ((uint8_t)0x00)
00070 #define IWDG_Prescaler_8 ((uint8_t)0x01)
00071 #define IWDG_Prescaler_16 ((uint8_t)0x02)
00072 #define IWDG_Prescaler_32 ((uint8_t)0x03)
00073 #define IWDG_Prescaler_64 ((uint8_t)0x04)
00074 #define IWDG_Prescaler_128 ((uint8_t)0x05)
00075 #define IWDG_Prescaler_256 ((uint8_t)0x06)
00076 #define IS_IWDG_PRESCALER(PRESCALER) (((PRESCALER) == IWDG_Prescaler_4) || \
00077 ((PRESCALER) == IWDG_Prescaler_8) || \
00078 ((PRESCALER) == IWDG_Prescaler_16) || \
00079 ((PRESCALER) == IWDG_Prescaler_32) || \
00080 ((PRESCALER) == IWDG_Prescaler_64) || \
00081 ((PRESCALER) == IWDG_Prescaler_128)|| \
00082 ((PRESCALER) == IWDG_Prescaler_256))
00083
00090 #define IWDG_FLAG_PVU ((uint16_t)0x0001)
00091 #define IWDG_FLAG_RVU ((uint16_t)0x0002)
00092 #define IS_IWDG_FLAG(FLAG) (((FLAG) == IWDG_FLAG_PVU) || ((FLAG) == IWDG_FLAG_RVU))
00093 #define IS_IWDG_RELOAD(RELOAD) ((RELOAD) <= 0xFFF)
00094
00102
00103
00104
00105
00106 void IWDG_WriteAccessCmd(uint16_t IWDG_WriteAccess);
00107 void IWDG_SetPrescaler(uint8_t IWDG_Prescaler);
00108 void IWDG_SetReload(uint16_t Reload);
00109 void IWDG_ReloadCounter(void);
00110
00111
00112 void IWDG_Enable(void);
00113
00114
00115 FlagStatus IWDG_GetFlagStatus(uint16_t IWDG_FLAG);
00116
00117 #ifdef __cplusplus
00118 }
00119 #endif
00120
00121 #endif
00122
00131