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

C++ IS_DAC_ALL_INSTANCE函数代码示例

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

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



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

示例1: HAL_DAC_DeInit

/**
  * @brief  Deinitializes the DAC peripheral registers to their default reset values.
  * @param  hdac: pointer to a DAC_HandleTypeDef structure that contains
  *         the configuration information for the specified DAC.
  * @retval HAL status
  */
HAL_StatusTypeDef HAL_DAC_DeInit(DAC_HandleTypeDef* hdac)
{
    /* Check DAC handle */
    if(hdac == NULL)
    {
        return HAL_ERROR;
    }

    /* Check the parameters */
    assert_param(IS_DAC_ALL_INSTANCE(hdac->Instance));

    /* Change DAC state */
    hdac->State = HAL_DAC_STATE_BUSY;

    /* DeInit the low level hardware */
    HAL_DAC_MspDeInit(hdac);

    /* Set DAC error code to none */
    hdac->ErrorCode = HAL_DAC_ERROR_NONE;

    /* Change DAC state */
    hdac->State = HAL_DAC_STATE_RESET;

    /* Release Lock */
    __HAL_UNLOCK(hdac);

    /* Return function status */
    return HAL_OK;
}
开发者ID:gerdb,项目名称:weldingmeter,代码行数:35,代码来源:stm32f7xx_hal_dac.c


示例2: HAL_DAC_Init

/**
  * @brief  Initializes the DAC peripheral according to the specified parameters
  *         in the DAC_InitStruct.
  * @param  hdac: pointer to a DAC_HandleTypeDef structure that contains
  *         the configuration information for the specified DAC.
  * @retval HAL status
  */
HAL_StatusTypeDef HAL_DAC_Init(DAC_HandleTypeDef* hdac)
{
    /* Check DAC handle */
    if(hdac == NULL)
    {
        return HAL_ERROR;
    }
    /* Check the parameters */
    assert_param(IS_DAC_ALL_INSTANCE(hdac->Instance));

    if(hdac->State == HAL_DAC_STATE_RESET)
    {
        /* Allocate lock resource and initialize it */
        hdac->Lock = HAL_UNLOCKED;
        /* Init the low level hardware */
        HAL_DAC_MspInit(hdac);
    }

    /* Initialize the DAC state*/
    hdac->State = HAL_DAC_STATE_BUSY;

    /* Set DAC error code to none */
    hdac->ErrorCode = HAL_DAC_ERROR_NONE;

    /* Initialize the DAC state*/
    hdac->State = HAL_DAC_STATE_READY;

    /* Return function status */
    return HAL_OK;
}
开发者ID:gerdb,项目名称:weldingmeter,代码行数:37,代码来源:stm32f7xx_hal_dac.c


示例3: LL_DAC_DeInit

/**
  * @brief  De-initialize registers of the selected DAC instance
  *         to their default reset values.
  * @param  DACx DAC instance
  * @retval An ErrorStatus enumeration value:
  *          - SUCCESS: DAC registers are de-initialized
  *          - ERROR: not applicable
  */
ErrorStatus LL_DAC_DeInit(DAC_TypeDef *DACx)
{
  /* Check the parameters */
  assert_param(IS_DAC_ALL_INSTANCE(DACx));
  
  if(DACx == DAC1)
  {
    /* Force reset of DAC clock */
    LL_APB1_GRP1_ForceReset(LL_APB1_GRP1_PERIPH_DAC1);
    
    /* Release reset of DAC clock */
    LL_APB1_GRP1_ReleaseReset(LL_APB1_GRP1_PERIPH_DAC1);
  }
#if defined(DAC2)
  else
  {
    /* Force reset of DAC clock */
    LL_APB1_GRP1_ForceReset(LL_APB1_GRP1_PERIPH_DAC2);
    
    /* Release reset of DAC clock */
    LL_APB1_GRP1_ReleaseReset(LL_APB1_GRP1_PERIPH_DAC2);
  }
#endif
  return SUCCESS;
}
开发者ID:Archcady,项目名称:mbed-os,代码行数:33,代码来源:stm32f3xx_ll_dac.c


示例4: LL_DAC_DeInit

/**
  * @brief  De-initialize registers of the selected DAC instance
  *         to their default reset values.
  * @param  DACx DAC instance
  * @retval An ErrorStatus enumeration value:
  *          - SUCCESS: DAC registers are de-initialized
  *          - ERROR: not applicable
  */
ErrorStatus LL_DAC_DeInit(DAC_TypeDef *DACx)
{
  /* Prevent unused argument(s) compilation warning */
  UNUSED(DACx);

  /* Check the parameters */
  assert_param(IS_DAC_ALL_INSTANCE(DACx));
  
  /* Force reset of DAC1 clock */
  LL_APB1_GRP1_ForceReset(LL_APB1_GRP1_PERIPH_DAC1);
  
  /* Release reset of DAC1 clock */
  LL_APB1_GRP1_ReleaseReset(LL_APB1_GRP1_PERIPH_DAC1);
  return SUCCESS;
}
开发者ID:amassou2017,项目名称:Arduino_Core_STM32,代码行数:23,代码来源:stm32f2xx_ll_dac.c


示例5: LL_DAC_Init

/**
  * @brief  Initialize some features of DAC instance.
  * @note   The setting of these parameters by function @ref LL_DAC_Init()
  *         is conditioned to DAC state:
  *         DAC instance must be disabled.
  * @param  DACx DAC instance
  * @param  DAC_Channel This parameter can be one of the following values:
  *         @arg @ref LL_DAC_CHANNEL_1
  *         @arg @ref LL_DAC_CHANNEL_2 (1)
  *         
  *         (1) On this STM32 serie, parameter not available on all devices.
  *             Refer to device datasheet for channels availability.
  * @param  DAC_InitStruct Pointer to a @ref LL_DAC_InitTypeDef structure
  * @retval An ErrorStatus enumeration value:
  *          - SUCCESS: DAC registers are initialized
  *          - ERROR: DAC registers are not initialized
  */
ErrorStatus LL_DAC_Init(DAC_TypeDef *DACx, uint32_t DAC_Channel, LL_DAC_InitTypeDef *DAC_InitStruct)
{
  ErrorStatus status = SUCCESS;
  
  /* Check the parameters */
  assert_param(IS_DAC_ALL_INSTANCE(DACx));
  assert_param(IS_LL_DAC_CHANNEL(DACx, DAC_Channel));
  assert_param(IS_LL_DAC_TRIGGER_SOURCE(DAC_InitStruct->TriggerSource));
  assert_param(IS_LL_DAC_OUTPUT_BUFFER(DAC_InitStruct->OutputBuffer));
#if defined(DAC_CR_WAVE1)
  assert_param(IS_LL_DAC_WAVE_AUTO_GENER_MODE(DAC_InitStruct->WaveAutoGeneration));
  if (DAC_InitStruct->WaveAutoGeneration != LL_DAC_WAVE_AUTO_GENERATION_NONE)
  {
    assert_param(IS_LL_DAC_WAVE_AUTO_GENER_CONFIG(DAC_InitStruct->WaveAutoGenerationConfig));
  }
#endif
  
  /* Note: Hardware constraint (refer to description of this function)        */
  /*       DAC instance must be disabled.                                     */
  if(LL_DAC_IsEnabled(DACx, DAC_Channel) == 0U)
  {
    /* Configuration of DAC channel:                                          */
    /*  - TriggerSource                                                       */
#if defined(DAC_CR_WAVE1)
    /*  - WaveAutoGeneration                                                  */
#endif
    /*  - OutputBuffer                                                        */
#if defined(DAC_CR_WAVE1)
    if (DAC_InitStruct->WaveAutoGeneration != LL_DAC_WAVE_AUTO_GENERATION_NONE)
    {
      MODIFY_REG(DACx->CR,
                 (  DAC_CR_TSEL1
                  | DAC_CR_WAVE1
                  | DAC_CR_MAMP1
                  | DAC_CR_BOFF1
                 ) << (DAC_Channel & DAC_CR_CHX_BITOFFSET_MASK)
                ,
                 (  DAC_InitStruct->TriggerSource
                  | DAC_InitStruct->WaveAutoGeneration
                  | DAC_InitStruct->WaveAutoGenerationConfig
                  | DAC_InitStruct->OutputBuffer
                 ) << (DAC_Channel & DAC_CR_CHX_BITOFFSET_MASK)
                );
    }
    else
    {
      MODIFY_REG(DACx->CR,
                 (  DAC_CR_TSEL1
                  | DAC_CR_WAVE1
                  | DAC_CR_BOFF1
                 ) << (DAC_Channel & DAC_CR_CHX_BITOFFSET_MASK)
                ,
                 (  DAC_InitStruct->TriggerSource
                  | LL_DAC_WAVE_AUTO_GENERATION_NONE
                  | DAC_InitStruct->OutputBuffer
                 ) << (DAC_Channel & DAC_CR_CHX_BITOFFSET_MASK)
                );
    }
#endif
  }
  else
  {
    /* Initialization error: DAC instance is not disabled.                    */
    status = ERROR;
  }
  return status;
}
开发者ID:DexterLB,项目名称:builders,代码行数:84,代码来源:stm32f0xx_ll_dac.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ IS_DAC_CHANNEL函数代码示例发布时间:2022-05-30
下一篇:
C++ IS_DAC_ALIGN函数代码示例发布时间: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