/**
  * @brief  Starts the WWDG.
  * @param  hwwdg : pointer to a WWDG_HandleTypeDef structure that contains
  *              the configuration information for the specified WWDG module.
  * @retval HAL status
  */
HAL_StatusTypeDef HAL_WWDG_Start(WWDG_HandleTypeDef *hwwdg)
{
  /* Take lock and change peripheral state */
  __HAL_LOCK(hwwdg); 
  hwwdg->State = HAL_WWDG_STATE_BUSY;

  /* Enable the peripheral */
  __HAL_WWDG_ENABLE(hwwdg);

  /* Change peripheral state and release lock*/
  hwwdg->State = HAL_WWDG_STATE_READY;
  __HAL_UNLOCK(hwwdg);

  /* Return function status */
  return HAL_OK;
}
Exemplo n.º 2
0
/**
  * @brief  Starts the WWDG with interrupt enabled.
  * @param  hwwdg: pointer to a WWDG_HandleTypeDef structure that contains
  *              the configuration information for the specified WWDG module.
  * @retval HAL status
  */
HAL_StatusTypeDef HAL_WWDG_Start_IT(WWDG_HandleTypeDef *hwwdg)
{
    /* Process Locked */
    __HAL_LOCK(hwwdg);

    /* Change WWDG peripheral state */
    hwwdg->State = HAL_WWDG_STATE_BUSY;

    /* Enable the Early Wakeup Interrupt */
    __HAL_WWDG_ENABLE_IT(WWDG_IT_EWI);

    /* Enable the peripheral */
    __HAL_WWDG_ENABLE(hwwdg);

    /* Return function status */
    return HAL_OK;
}
Exemplo n.º 3
0
/**
  * @brief  Starts the WWDG.
  * @param  hwwdg: pointer to a WWDG_HandleTypeDef structure that contains
  *              the configuration information for the specified WWDG module.
  * @retval HAL status
  */
HAL_StatusTypeDef HAL_WWDG_Start(WWDG_HandleTypeDef *hwwdg)
{
    /* Process Locked */
    __HAL_LOCK(hwwdg);

    /* Change WWDG peripheral state */
    hwwdg->State = HAL_WWDG_STATE_BUSY;

    /* Enable the peripheral */
    __HAL_WWDG_ENABLE(hwwdg);

    /* Change WWDG peripheral state */
    hwwdg->State = HAL_WWDG_STATE_READY;

    /* Process Unlocked */
    __HAL_UNLOCK(hwwdg);

    /* Return function status */
    return HAL_OK;
}