Beispiel #1
0
/**
  * @brief  Sets the WWDG window value.
  * @param WindowValue: specifies the window value to be compared to
  *   the downcounter.
  *   This parameter value must be lower than 0x80.
  * @retval : None
  */
void WWDG_SetWindowValue(uint8_t WindowValue)
{
  uint32_t tmpreg = 0;
  /* Check the parameters */
  assert_param(IS_WWDG_WINDOW_VALUE(WindowValue));
  /* Clear W[6:0] bits */
  tmpreg = WWDG->CFR & CFR_W_Mask;
  /* Set W[6:0] bits according to WindowValue value */
  tmpreg |= WindowValue & BIT_Mask;
  /* Store the new value */
  WWDG->CFR = tmpreg;
}
Beispiel #2
0
/**
  * @简述  设置 WWDG 窗口值.
  * @参数  指明要和倒计数器比较的窗口值.
  *        这个个参数的值必须小于0x80.
  * @返回  没有
  */
void WWDG_SetWindowValue(uint8_t WindowValue)
{
  __IO uint32_t tmpreg = 0;

  /* 检查参数 */
  assert_param(IS_WWDG_WINDOW_VALUE(WindowValue));
  /* 清除 W[6:0] 位 */

  tmpreg = WWDG->CFR & CFR_W_Mask;

  /* 依照窗口值的值设置 W[6:0] 位 */
  tmpreg |= WindowValue & (uint32_t) BIT_Mask;

  /* 存储新值 */
  WWDG->CFR = tmpreg;
}
Beispiel #3
0
/**
  * @brief  WWDG_SetWindowValue - Sets the WWDG window value.
  * @param  WindowValue: specifies the window value to be compared to the downcounter.
  *   This parameter value must be lower than 0x80.
  * @retval None
  */
void WWDG_SetWindowValue(uint32_t WindowValue)
{
  __IO uint32_t tmpreg = 0;

  /* Check the parameters */
  assert_param(IS_WWDG_WINDOW_VALUE(WindowValue));
  /* Clear W[6:0] bits */

  tmpreg = MDR_WWDG->CFR & (uint32_t) (~WIN_Mask);

  /* Set W[6:0] bits according to WindowValue value */
  tmpreg |= WindowValue & (uint32_t) WIN_Mask;

  /* Store the new value */
  MDR_WWDG->CFR = tmpreg;
}