30 #ifndef __STM32F30x_IWDG_H 31 #define __STM32F30x_IWDG_H 38 #include "stm32f30x.h" 59 #define IWDG_WriteAccess_Enable ((uint16_t)0x5555) 60 #define IWDG_WriteAccess_Disable ((uint16_t)0x0000) 61 #define IS_IWDG_WRITE_ACCESS(ACCESS) (((ACCESS) == IWDG_WriteAccess_Enable) || \ 62 ((ACCESS) == IWDG_WriteAccess_Disable)) 71 #define IWDG_Prescaler_4 ((uint8_t)0x00) 72 #define IWDG_Prescaler_8 ((uint8_t)0x01) 73 #define IWDG_Prescaler_16 ((uint8_t)0x02) 74 #define IWDG_Prescaler_32 ((uint8_t)0x03) 75 #define IWDG_Prescaler_64 ((uint8_t)0x04) 76 #define IWDG_Prescaler_128 ((uint8_t)0x05) 77 #define IWDG_Prescaler_256 ((uint8_t)0x06) 78 #define IS_IWDG_PRESCALER(PRESCALER) (((PRESCALER) == IWDG_Prescaler_4) || \ 79 ((PRESCALER) == IWDG_Prescaler_8) || \ 80 ((PRESCALER) == IWDG_Prescaler_16) || \ 81 ((PRESCALER) == IWDG_Prescaler_32) || \ 82 ((PRESCALER) == IWDG_Prescaler_64) || \ 83 ((PRESCALER) == IWDG_Prescaler_128)|| \ 84 ((PRESCALER) == IWDG_Prescaler_256)) 93 #define IWDG_FLAG_PVU ((uint16_t)0x0001) 94 #define IWDG_FLAG_RVU ((uint16_t)0x0002) 95 #define IWDG_FLAG_WVU ((uint16_t)0x0002) 96 #define IS_IWDG_FLAG(FLAG) (((FLAG) == IWDG_FLAG_PVU) || ((FLAG) == IWDG_FLAG_RVU) || \ 97 ((FLAG) == IWDG_FLAG_WVU)) 105 #define IS_IWDG_RELOAD(RELOAD) ((RELOAD) <= 0xFFF) 114 #define IS_IWDG_WINDOW_VALUE(VALUE) ((VALUE) <= 0xFFF)
void IWDG_Enable(void)
Enables IWDG (write access to IWDG_PR and IWDG_RLR registers disabled).
void IWDG_WriteAccessCmd(uint16_t IWDG_WriteAccess)
Enables or disables write access to IWDG_PR and IWDG_RLR registers.
void IWDG_SetWindowValue(uint16_t WindowValue)
Sets the IWDG window value.
void IWDG_ReloadCounter(void)
Reloads IWDG counter with value defined in the reload register (write access to IWDG_PR and IWDG_RLR ...
void IWDG_SetReload(uint16_t Reload)
Sets IWDG Reload value.
void IWDG_SetPrescaler(uint8_t IWDG_Prescaler)
Sets IWDG Prescaler value.
FlagStatus IWDG_GetFlagStatus(uint16_t IWDG_FLAG)
Checks whether the specified IWDG flag is set or not.