예제 #1
0
/**
  * @brief  Clears the specified RST flag.
  * @param   RST_Flag : specify the reset flag to check.
  *          This parameter can be one of the following values:
  *            @arg RST_FLAG_PORF: POR reset flag
  *            @arg RST_FLAG_SWIMF: SWIM reset flag
  *            @arg RST_FLAG_ILLOPF: Illegal opcode reset flag
  *            @arg RST_FLAG_IWDGF: Independent watchdog reset flag 
  *            @arg RST_FLAG_WWDGF: Window watchdog reset flag
  *            @arg RST_FLAG_BORF: BOR reset flag
  * @retval None
  */
void RST_ClearFlag(RST_FLAG_TypeDef RST_Flag)
{
  /* Check the parameters */
  assert_param(IS_RST_FLAG(RST_Flag));

  RST->SR = (uint8_t)RST_Flag;
}
예제 #2
0
/**
  * @brief   Checks whether the specified RST flag is set or not.
  * @param   RST_Flag : specify the reset flag to check.
  *          This parameter can be one of the following values:
  *            @arg RST_FLAG_PORF: POR reset flag
  *            @arg RST_FLAG_SWIMF: SWIM reset flag
  *            @arg RST_FLAG_ILLOPF: Illegal opcode reset flag
  *            @arg RST_FLAG_IWDGF: Independent watchdog reset flag 
  *            @arg RST_FLAG_WWDGF: Window watchdog reset flag
  *            @arg RST_FLAG_BORF: BOR reset flag
  * @retval The new state of RST_Flag (SET or RESET).
  */
FlagStatus RST_GetFlagStatus(RST_FLAG_TypeDef RST_Flag)
{
  /* Check the parameters */
  assert_param(IS_RST_FLAG(RST_Flag));

  /* Get flag status */

  return ((FlagStatus)((uint8_t)RST->SR & (uint8_t)RST_Flag));
}
예제 #3
0
/**
  * @brief   Checks whether the specified RST flag is set or not.
  * @param   RST_Flag : specify the reset flag to check.
  *          This parameter can be one of the following values:
  *            @arg RST_FLAG_POR_PDR: POR reset flag
  *            @arg RST_FLAG_SWIMF: SWIM reset flag
  *            @arg RST_FLAG_ILLOPF: Illegal opcode reset flag
  *            @arg RST_FLAG_IWDGF: Independent watchdog reset flag 
  *            @arg RST_FLAG_BORF: BOR reset flag
  * @retval  The new state of RST_Flag (SET or RESET).
  */
FlagStatus RST_GetFlagStatus(RST_Flag_TypeDef RST_Flag)
{
  /* Check the parameters */
  assert_param(IS_RST_FLAG(RST_Flag));

  /* Get flag status */

  return((FlagStatus)(((uint8_t)(RST->SR & RST_Flag) == (uint8_t)0x00) ? RESET : SET));
}