/** * @brief Refreshs the WWDG peripheral. * @param Counter : WWDG Counter Value * This parameter must be a number between 0x40 and 0x7F. * @retval None */ void WWDG_SetCounter(uint8_t Counter) { /* Check the parameters */ assert_param(IS_WWDG_COUNTER_VALUE(Counter)); /* Write Counter in the WWDG counter register */ WWDG->CR = (uint8_t) (WWDG_CR_WDGA | Counter); }
/** * @brief Sets the WWDG counter value. * @param Counter: specifies the watchdog counter value. * This parameter must be a number between 0x40 and 0x7F (to prevent generating * an immediate reset) * @retval None */ void WWDG_SetCounter(uint8_t Counter) { /* Check the parameters */ assert_param(IS_WWDG_COUNTER_VALUE(Counter)); /* Write to T[6:0] bits to configure the counter value, no need to do a read-modify-write; writing a 0 to WDGA bit does nothing */ WWDG->CR = (uint8_t)(Counter & (uint8_t)BIT_MASK); }
/** * @brief Enables WWDG and load the counter value. * @param Counter: specifies the watchdog counter value. * This parameter must be a number between 0x40 and 0x7F. * @retval None */ void WWDG_Enable(uint8_t Counter) { /* Check the parameters */ assert_param(IS_WWDG_COUNTER_VALUE(Counter)); WWDG->CR = (uint8_t)(WWDG_CR_WDGA | Counter); }