/** * @brief Checks whether the specified PWR flag is set or not. * @param PWR_FLAG: specifies the flag to check. * This parameter can be one of the following values: * @arg PWR_FLAG_WU: Wake Up flag * @arg PWR_FLAG_SB: StandBy flag * @arg PWR_FLAG_PVDO: PVD Output * @retval : The new state of PWR_FLAG (SET or RESET). */ FlagStatus PWR_GetFlagStatus(uint32_t PWR_FLAG) { FlagStatus bitstatus = RESET; /* Check the parameters */ assert_param(IS_PWR_GET_FLAG(PWR_FLAG)); if((PWR->CSR & PWR_FLAG) != (uint32_t)RESET) { bitstatus = SET; } else { bitstatus = RESET; } /* Return the flag status */ return bitstatus; }
/******************************************************************************* * 函数名称: PWR_GetFlagStatus * 功能描述: 检查指定的PWR标志位设置与否. * 输入参数: PWR_FLAG:要检查的标志。 * 这个参数可以是下面的值之一: * - PWR_FLAG_WU: Wake Up 标志 * - PWR_FLAG_SB: StandBy 标志 * - PWR_FLAG_PVDO: PVD 输出 * 输出参数: 无 * 返回参数: PWR_FLAG的新状态(SET或RESET). *******************************************************************************/ FlagStatus PWR_GetFlagStatus(u32 PWR_FLAG) { FlagStatus bitstatus = RESET; /* Check the parameters [检查参数]*/ assert_param(IS_PWR_GET_FLAG(PWR_FLAG)); if ((PWR->CSR & PWR_FLAG) != (u32)RESET) { bitstatus = SET; } else { bitstatus = RESET; } /* Return the flag status [返回状态标志]*/ return bitstatus; }