• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ IS_PWR_PVD_LEVEL函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中IS_PWR_PVD_LEVEL函数的典型用法代码示例。如果您正苦于以下问题:C++ IS_PWR_PVD_LEVEL函数的具体用法?C++ IS_PWR_PVD_LEVEL怎么用?C++ IS_PWR_PVD_LEVEL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了IS_PWR_PVD_LEVEL函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: HAL_PWR_PVDConfig

/**
  * @brief Configures the voltage threshold detected by the Power Voltage Detector(PVD).
  * @param sConfigPVD: pointer to an PWR_PVDTypeDef structure that contains the configuration
  *        information for the PVD.
  * @note Refer to the electrical characteristics of your device datasheet for
  *         more details about the voltage threshold corresponding to each
  *         detection level.
  * @retval None
  */
void HAL_PWR_PVDConfig(PWR_PVDTypeDef * sConfigPVD)
{
	/* Check the parameters */
	assert_param(IS_PWR_PVD_LEVEL(sConfigPVD->PVDLevel));
	assert_param(IS_PWR_PVD_MODE(sConfigPVD->Mode));

	/* Set PLS[7:5] bits according to PVDLevel value */
	MODIFY_REG(PWR->CR, PWR_CR_PLS, sConfigPVD->PVDLevel);

	/* Clear any previous config. Keep it clear if no event or IT mode is selected */
	__HAL_PWR_PVD_EXTI_DISABLE_EVENT();
	__HAL_PWR_PVD_EXTI_DISABLE_IT();
	__HAL_PWR_PVD_EXTI_CLEAR_EGDE_TRIGGER();

	/* Configure interrupt mode */
	if ((sConfigPVD->Mode & PVD_MODE_IT) == PVD_MODE_IT) {
		__HAL_PWR_PVD_EXTI_ENABLE_IT();
	}

	/* Configure event mode */
	if ((sConfigPVD->Mode & PVD_MODE_EVT) == PVD_MODE_EVT) {
		__HAL_PWR_PVD_EXTI_ENABLE_EVENT();
	}

	/* Configure the edge */
	if ((sConfigPVD->Mode & PVD_RISING_EDGE) == PVD_RISING_EDGE) {
		__HAL_PWR_PVD_EXTI_SET_RISING_EDGE_TRIGGER();
	}

	if ((sConfigPVD->Mode & PVD_FALLING_EDGE) == PVD_FALLING_EDGE) {
		__HAL_PWR_PVD_EXTI_SET_FALLING_EGDE_TRIGGER();
	}
}
开发者ID:nvdl,项目名称:pymite,代码行数:42,代码来源:stm32f0xx_hal_pwr_ex.c


示例2: HAL_PWR_PVDConfig

/**
  * @brief Configures the voltage threshold detected by the Power Voltage Detector(PVD).
  * @param sConfigPVD: pointer to an PWR_PVDTypeDef structure that contains the configuration
  *        information for the PVD.
  * @note Refer to the electrical characteristics of your device datasheet for
  *         more details about the voltage threshold corresponding to each
  *         detection level.
  * @retval None
  */
void HAL_PWR_PVDConfig(PWR_PVDTypeDef *sConfigPVD)
{
  /* Check the parameters */
  assert_param(IS_PWR_PVD_LEVEL(sConfigPVD->PVDLevel));
  assert_param(IS_PWR_PVD_MODE(sConfigPVD->Mode));

  /* Set PLS[7:5] bits according to PVDLevel value */
  MODIFY_REG(PWR->CR, PWR_CR_PLS, sConfigPVD->PVDLevel);

  /* Configure the EXTI 16 interrupt */
  if((sConfigPVD->Mode == PWR_MODE_IT_RISING_FALLING) ||\
     (sConfigPVD->Mode == PWR_MODE_IT_FALLING) ||\
     (sConfigPVD->Mode == PWR_MODE_IT_RISING))
  {
    __HAL_PVD_EXTI_ENABLE_IT(PWR_EXTI_LINE_PVD);
  }
  /* Configure the rising edge */
  if((sConfigPVD->Mode == PWR_MODE_IT_RISING_FALLING) ||\
     (sConfigPVD->Mode == PWR_MODE_IT_RISING))
  {
    EXTI->RTSR |= PWR_EXTI_LINE_PVD;
  }
  /* Configure the falling edge */
  if((sConfigPVD->Mode == PWR_MODE_IT_RISING_FALLING) ||\
     (sConfigPVD->Mode == PWR_MODE_IT_FALLING))
  {
    EXTI->FTSR |= PWR_EXTI_LINE_PVD;
  }
}
开发者ID:23chrischen,项目名称:mbed,代码行数:38,代码来源:stm32f3xx_hal_pwr_ex.c


示例3: PWR_PVDLevelConfig

/**
  * @brief  Configures the voltage threshold detected by the Power Voltage Detector(PVD).
  * @param  PWR_PVDLevel: specifies the PVD detection level
  *   This parameter can be one of the following values:
  *     @arg PWR_PVDLevel_2V2: PVD detection level set to 2.2V
  *     @arg PWR_PVDLevel_2V3: PVD detection level set to 2.3V
  *     @arg PWR_PVDLevel_2V4: PVD detection level set to 2.4V
  *     @arg PWR_PVDLevel_2V5: PVD detection level set to 2.5V
  *     @arg PWR_PVDLevel_2V6: PVD detection level set to 2.6V
  *     @arg PWR_PVDLevel_2V7: PVD detection level set to 2.7V
  *     @arg PWR_PVDLevel_2V8: PVD detection level set to 2.8V
  *     @arg PWR_PVDLevel_2V9: PVD detection level set to 2.9V
  * @retval None
  */
void PWR_PVDLevelConfig(uint32_t PWR_PVDLevel)
{
	
#ifdef	OS_UCOS
	OS_CPU_SR  cpu_sr;
#endif
	

  uint32_t tmpreg = 0;
	
#ifdef	OS_UCOS
	OS_ENTER_CRITICAL();
#endif
	 
  /* Check the parameters */
  assert_param(IS_PWR_PVD_LEVEL(PWR_PVDLevel));
  tmpreg = PWR->CR;
  /* Clear PLS[7:5] bits */
  tmpreg &= CR_PLS_MASK;
  /* Set PLS[7:5] bits according to PWR_PVDLevel value */
  tmpreg |= PWR_PVDLevel;
  /* Store the new value */
  PWR->CR = tmpreg;
	
#ifdef	OS_UCOS
	OS_EXIT_CRITICAL();
#endif
	
}
开发者ID:joyceandpig,项目名称:STM32_USB_MASS,代码行数:43,代码来源:stm32f10x_pwr.c


示例4: PWR_PVDLevelConfig

/**
  * @brief  Configures the voltage threshold detected by the Power Voltage Detector(PVD).
  * @param  PWR_PVDLevel: specifies the PVD detection level
  *          This parameter can be one of the following values:
  *            @arg PWR_PVDLevel_1V85: PVD detection level set to 1.85V
  *            @arg PWR_PVDLevel_2V05: PVD detection level set to 2.05V
  *            @arg PWR_PVDLevel_2V26: PVD detection level set to 2.26V
  *            @arg PWR_PVDLevel_2V45: PVD detection level set to 2.45V
  *            @arg PWR_PVDLevel_2V65: PVD detection level set to 2.65V
  *            @arg PWR_PVDLevel_2V85: PVD detection level set to 2.85V
  *            @arg PWR_PVDLevel_3V05: PVD detection level set to 3.05V
  *            @arg PWR_PVDLevel_PVDIn: External input analog voltage (Compare internally to VREFINT)
  * @retval None
  */
void PWR_PVDLevelConfig(PWR_PVDLevel_TypeDef PWR_PVDLevel)
{
  /* Check the parameters */
  assert_param(IS_PWR_PVD_LEVEL(PWR_PVDLevel));

  /* Clear the PVD level */
  PWR->CSR1 &= (uint8_t)(~PWR_CSR1_PLS);

  /* Configure the PVD level */
  PWR->CSR1 |= PWR_PVDLevel;

}
开发者ID:ChangXiaodong,项目名称:manhole,代码行数:26,代码来源:stm8l15x_pwr.c


示例5: PWR_PVDLevelConfig

/**
  * @brief  Configures the voltage threshold detected by the Power Voltage
  *   Detector(PVD).
  * @param PWR_PVDLevel: specifies the PVD detection level
  *   This parameter can be one of the following values:
  * @arg PWR_PVDLevel_2V2: PVD detection level set to 2.2V
  * @arg PWR_PVDLevel_2V3: PVD detection level set to 2.3V
  * @arg PWR_PVDLevel_2V4: PVD detection level set to 2.4V
  * @arg PWR_PVDLevel_2V5: PVD detection level set to 2.5V
  * @arg PWR_PVDLevel_2V6: PVD detection level set to 2.6V
  * @arg PWR_PVDLevel_2V7: PVD detection level set to 2.7V
  * @arg PWR_PVDLevel_2V8: PVD detection level set to 2.8V
  * @arg PWR_PVDLevel_2V9: PVD detection level set to 2.9V
  * @retval : None
  */
void PWR_PVDLevelConfig(uint32_t PWR_PVDLevel) {
	uint32_t tmpreg = 0;
	/* Check the parameters */
	assert_param(IS_PWR_PVD_LEVEL(PWR_PVDLevel));
	tmpreg = PWR->CR;
	/* Clear PLS[7:5] bits */
	tmpreg &= CR_PLS_Mask;
	/* Set PLS[7:5] bits according to PWR_PVDLevel value */
	tmpreg |= PWR_PVDLevel;
	/* Store the new value */
	PWR->CR = tmpreg;
}
开发者ID:dunhaiyang,项目名称:dw1000_firmware,代码行数:27,代码来源:stm32f10x_pwr.c


示例6: PWR_PVDLevelConfig

/*******************************************************************************
* 函数名称: PWR_PVDLevelConfig
* 功能描述: 配置由电源电压探测器探测的电压门限值(PVD).
* 输入参数: PWR_PVDLevel:PVD探测电平。
*                    这个参数可以取下面的值之一:
*                       - PWR_PVDLevel_2V2: PVD探测电平设置为 2.2V
*                       - PWR_PVDLevel_2V3: PVD探测电平设置为 2.3V
*                       - PWR_PVDLevel_2V4: PVD探测电平设置为 2.4V
*                       - PWR_PVDLevel_2V5: PVD探测电平设置为 2.5V
*                       - PWR_PVDLevel_2V6: PVD探测电平设置为 2.6V
*                       - PWR_PVDLevel_2V7: PVD探测电平设置为 2.7V
*                       - PWR_PVDLevel_2V8: PVD探测电平设置为 2.8V
*                       - PWR_PVDLevel_2V9: PVD探测电平设置为 2.9V
* 输出参数: 无
* 返回参数: 无
*******************************************************************************/
void PWR_PVDLevelConfig(u32 PWR_PVDLevel)
{
  u32 tmpreg = 0;

  /* Check the parameters [检查参数]*/
  assert_param(IS_PWR_PVD_LEVEL(PWR_PVDLevel));

  tmpreg = PWR->CR;

  /* Clear PLS[7:5] bits [清零PLS[7:5]位]*/
  tmpreg &= CR_PLS_Mask;

  /* Set PLS[7:5] bits according to PWR_PVDLevel value [依照PWR_PVDLevel的值置位PLS[7:5]]*/
  tmpreg |= PWR_PVDLevel;

  /* Store the new value [保存新的值]*/
  PWR->CR = tmpreg;
}
开发者ID:WrongChao,项目名称:lammbo-fly,代码行数:34,代码来源:stm32f10x_pwr.c


示例7: HAL_PWR_PVDConfig

/**
  * @brief Configures the voltage threshold detected by the Power Voltage Detector(PVD).
  * @param sConfigPVD: pointer to an PWR_PVDTypeDef structure that contains the configuration
  *        information for the PVD.
  * @note Refer to the electrical characteristics of your device datasheet for
  *         more details about the voltage threshold corresponding to each
  *         detection level.
  * @retval None
  */
void HAL_PWR_PVDConfig(PWR_PVDTypeDef *sConfigPVD)
{
 uint32_t tmpreg = 0;

  /* Check the parameters */
  assert_param(IS_PWR_PVD_LEVEL(sConfigPVD->PVDLevel));

  tmpreg = PWR->CR;

  /* Clear PLS[7:5] bits */
  tmpreg &= ~ (uint32_t)PWR_CR_PLS;

  /* Set PLS[7:5] bits according to PVDLevel value */
  tmpreg |= sConfigPVD->PVDLevel;

  /* Store the new value */
  PWR->CR = tmpreg;

  /* Configure the EXTI 16 interrupt */
  if((sConfigPVD->Mode == PWR_MODE_IT_RISING_FALLING) ||\
     (sConfigPVD->Mode == PWR_MODE_IT_FALLING) ||\
     (sConfigPVD->Mode == PWR_MODE_IT_RISING)) 
  {
    __HAL_PVD_EXTI_ENABLE_IT(PWR_EXTI_LINE_PVD);
  }
  
  /* Clear the edge trigger  for the EXTI Line 16 (PVD) */
  EXTI->RTSR &= ~EXTI_RTSR_TR16;
  EXTI->FTSR &= ~EXTI_FTSR_TR16;

  /* Configure the rising edge */
  if((sConfigPVD->Mode == PWR_MODE_IT_RISING_FALLING) ||\
     (sConfigPVD->Mode == PWR_MODE_IT_RISING))
  {
    EXTI->RTSR |= PWR_EXTI_LINE_PVD;
  }
  /* Configure the falling edge */
  if((sConfigPVD->Mode == PWR_MODE_IT_RISING_FALLING) ||\
     (sConfigPVD->Mode == PWR_MODE_IT_FALLING))
  {
    EXTI->FTSR |= PWR_EXTI_LINE_PVD;
  }
}
开发者ID:hammerfet,项目名称:HotBit,代码行数:52,代码来源:stm32l0xx_hal_pwr.c


示例8: HAL_PWR_ConfigPVD

/**
  * @brief Configure the voltage threshold detected by the Power Voltage Detector (PVD).
  * @param sConfigPVD: pointer to a PWR_PVDTypeDef structure that contains the PVD 
  *        configuration information.
  * @note Refer to the electrical characteristics of your device datasheet for
  *         more details about the voltage thresholds corresponding to each
  *         detection level.
  * @retval None
  */
HAL_StatusTypeDef HAL_PWR_ConfigPVD(PWR_PVDTypeDef *sConfigPVD)
{
  /* Check the parameters */
  assert_param(IS_PWR_PVD_LEVEL(sConfigPVD->PVDLevel));
  assert_param(IS_PWR_PVD_MODE(sConfigPVD->Mode));

  /* Set PLS bits according to PVDLevel value */
  MODIFY_REG(PWR->CR2, PWR_CR2_PLS, sConfigPVD->PVDLevel);
  
  /* Clear any previous config. Keep it clear if no event or IT mode is selected */
  __HAL_PWR_PVD_EXTI_DISABLE_EVENT();
  __HAL_PWR_PVD_EXTI_DISABLE_IT();
  __HAL_PWR_PVD_EXTI_DISABLE_FALLING_EDGE(); 
  __HAL_PWR_PVD_EXTI_DISABLE_RISING_EDGE();

  /* Configure interrupt mode */
  if((sConfigPVD->Mode & PVD_MODE_IT) == PVD_MODE_IT)
  {
    __HAL_PWR_PVD_EXTI_ENABLE_IT();
  }
  
  /* Configure event mode */
  if((sConfigPVD->Mode & PVD_MODE_EVT) == PVD_MODE_EVT)
  {
    __HAL_PWR_PVD_EXTI_ENABLE_EVENT();
  }
  
  /* Configure the edge */
  if((sConfigPVD->Mode & PVD_RISING_EDGE) == PVD_RISING_EDGE)
  {
    __HAL_PWR_PVD_EXTI_ENABLE_RISING_EDGE();
  }
  
  if((sConfigPVD->Mode & PVD_FALLING_EDGE) == PVD_FALLING_EDGE)
  {
    __HAL_PWR_PVD_EXTI_ENABLE_FALLING_EDGE();
  }
  
  return HAL_OK;
}
开发者ID:asebak,项目名称:IMU,代码行数:49,代码来源:stm32l4xx_hal_pwr.c


示例9: HAL_PWR_ConfigPVD

/**
  * @brief  Configure the voltage threshold detected by the Power Voltage Detector(PVD).
  * @param  sConfigPVD: pointer to an PWR_PVDTypeDef structure that contains the configuration
  *         information for the PVD.
  * @note   Refer to the electrical characteristics of your device datasheet for
  *         more details about the voltage threshold corresponding to each
  *         detection level.
  * @retval None
  */
void HAL_PWR_ConfigPVD(PWR_PVDTypeDef *sConfigPVD)
{
  /* Check the parameters */
  assert_param(IS_PWR_PVD_LEVEL(sConfigPVD->PVDLevel));
  assert_param(IS_PWR_PVD_MODE(sConfigPVD->Mode));

  /* Set PLS[7:5] bits according to PVDLevel value */
  MODIFY_REG(PWR->CR1, PWR_CR1_PLS, sConfigPVD->PVDLevel);

  /* Clear any previous config */
  __HAL_PWR_PVD_EXTI_DISABLE_EVENT();
  __HAL_PWR_PVD_EXTI_DISABLE_IT();
  __HAL_PWR_PVD_EXTI_DISABLE_RISING_EDGE();
  __HAL_PWR_PVD_EXTI_DISABLE_FALLING_EDGE();

  /* Configure interrupt mode */
  if((sConfigPVD->Mode & PVD_MODE_IT) == PVD_MODE_IT)
  {
    __HAL_PWR_PVD_EXTI_ENABLE_IT();
  }
  
  /* Configure event mode */
  if((sConfigPVD->Mode & PVD_MODE_EVT) == PVD_MODE_EVT)
  {
    __HAL_PWR_PVD_EXTI_ENABLE_EVENT();
  }
  
  /* Configure the edge */
  if((sConfigPVD->Mode & PVD_RISING_EDGE) == PVD_RISING_EDGE)
  {
    __HAL_PWR_PVD_EXTI_ENABLE_RISING_EDGE();
  }

  if((sConfigPVD->Mode & PVD_FALLING_EDGE) == PVD_FALLING_EDGE)
  {
    __HAL_PWR_PVD_EXTI_ENABLE_FALLING_EDGE();
  }
}
开发者ID:pichenettes,项目名称:stmlib,代码行数:47,代码来源:stm32h7xx_hal_pwr.c



注:本文中的IS_PWR_PVD_LEVEL函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ IS_PWR_REGULATOR函数代码示例发布时间:2022-05-30
下一篇:
C++ IS_PRINTABLE函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap