当前位置: 首页>>代码示例>>C++>>正文


C++ IS_WWDG_COUNTER函数代码示例

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


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

示例1: HAL_WWDG_Init

/**
  * @brief  Initialize the WWDG according to the specified.
  *         parameters in the WWDG_InitTypeDef of  associated handle.
  * @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_Init(WWDG_HandleTypeDef *hwwdg)
{
  /* Check the WWDG handle allocation */
  if(hwwdg == NULL)
  {
    return HAL_ERROR;
  }

  /* Check the parameters */
  assert_param(IS_WWDG_ALL_INSTANCE(hwwdg->Instance));
  assert_param(IS_WWDG_PRESCALER(hwwdg->Init.Prescaler));
  assert_param(IS_WWDG_WINDOW(hwwdg->Init.Window));
  assert_param(IS_WWDG_COUNTER(hwwdg->Init.Counter));
  assert_param(IS_WWDG_EWI_MODE(hwwdg->Init.EWIMode));

  /* Init the low level hardware */
  HAL_WWDG_MspInit(hwwdg);

  /* Set WWDG Counter */
  WRITE_REG(hwwdg->Instance->CR, (WWDG_CR_WDGA | hwwdg->Init.Counter));

  /* Set WWDG Prescaler and Window */
  WRITE_REG(hwwdg->Instance->CFR, (hwwdg->Init.EWIMode | hwwdg->Init.Prescaler | hwwdg->Init.Window));

  /* Return function status */
  return HAL_OK;
}
开发者ID:DjFix,项目名称:jog-dial-ui,代码行数:34,代码来源:stm32f7xx_hal_wwdg.c

示例2: HAL_WWDG_Init

/**
  * @brief  Initializes the WWDG according to the specified
  *         parameters in the WWDG_InitTypeDef and creates the associated handle.
  * @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_Init(WWDG_HandleTypeDef *hwwdg)
{
  /* Check the WWDG handle allocation */
  if(hwwdg == HAL_NULL)
  {
    return HAL_ERROR;
  }
  
  /* Check the parameters */
  assert_param(IS_WWDG_ALL_INSTANCE(hwwdg->Instance));
  assert_param(IS_WWDG_PRESCALER(hwwdg->Init.Prescaler));
  assert_param(IS_WWDG_WINDOW(hwwdg->Init.Window)); 
  assert_param(IS_WWDG_COUNTER(hwwdg->Init.Counter)); 
  
  if(hwwdg->State == HAL_WWDG_STATE_RESET)
  {
    /* Init the low level hardware */
    HAL_WWDG_MspInit(hwwdg);
  }
  
  /* Change WWDG peripheral state */
  hwwdg->State = HAL_WWDG_STATE_BUSY;

  /* Set WWDG Prescaler and Window */
  MODIFY_REG(hwwdg->Instance->CFR, (WWDG_CFR_WDGTB | WWDG_CFR_W), (hwwdg->Init.Prescaler | hwwdg->Init.Window));

  /* Set WWDG Counter */
  MODIFY_REG(hwwdg->Instance->CR, WWDG_CR_T, hwwdg->Init.Counter);
   
  /* Change WWDG peripheral state */
  hwwdg->State = HAL_WWDG_STATE_READY;
  
  /* Return function status */
  return HAL_OK;
}
开发者ID:1deus,项目名称:tmk_keyboard,代码行数:42,代码来源:stm32l1xx_hal_wwdg.c

示例3: WWDG_SetCounter

/**
  * @简述  设置 WWDG 计数器值.
  * @参数  Counter: 指定看门狗计数器值.
  *                 该参数取值必须在0x40与0x7F之间.
  * @返回  没有
  */
void WWDG_SetCounter(uint8_t Counter)
{
  /* 检查参数 */
  assert_param(IS_WWDG_COUNTER(Counter));
  /* 为配置计数器的值写 T[6:0]位,除了写0到WDG A位没有意义 */
  WWDG->CR = Counter & BIT_Mask;
}
开发者ID:ljqhack,项目名称:seuOS,代码行数:13,代码来源:stm32f10x_wwdg.c

示例4: WWDG_Enable

/*******************************************************************************
* Function Name  : WWDG_Enable
* Description    : Enables WWDG and load the counter value.
*                  - Counter: specifies the watchdog counter value.
*                    This parameter must be a number between 0x40 and 0x7F.
* Input          : None
* Output         : None
* Return         : None
*******************************************************************************/
void WWDG_Enable(u8 Counter)
{
  /* Check the parameters */
  assert(IS_WWDG_COUNTER(Counter));

  WWDG->CR = CR_WDGA_Set | Counter;
}
开发者ID:bjzhang,项目名称:stm32f10x,代码行数:16,代码来源:stm32f10x_wwdg.c

示例5: WWDG_SetCounter

/**
  * @brief  Sets the WWDG counter value.
  * @param Counter: specifies the watchdog counter value.
  *   This parameter must be a number between 0x40 and 0x7F.
  * @retval : None
  */
void WWDG_SetCounter (uint8_t Counter)
{
    /* Check the parameters */
    assert_param (IS_WWDG_COUNTER (Counter));
    /* Write to T[6:0] bits to configure the counter value, no need to do a read-modify-write; writing a 0 to WDGA bit does nothing */
    WWDG->CR = Counter & BIT_Mask;
}
开发者ID:MaVo159,项目名称:nitrokey-pro-firmware,代码行数:13,代码来源:stm32f10x_wwdg.c

示例6: HAL_WWDG_Init

/**
  * @brief  Initializes the WWDG according to the specified
  *         parameters in the WWDG_InitTypeDef and creates the associated handle.
  * @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_Init(WWDG_HandleTypeDef *hwwdg)
{
    uint32_t tmp = 0;

    /* Check the WWDG handle allocation */
    if(hwwdg == NULL)
    {
        return HAL_ERROR;
    }

    /* Check the parameters */
    assert_param(IS_WWDG_ALL_INSTANCE(hwwdg->Instance));
    assert_param(IS_WWDG_PRESCALER(hwwdg->Init.Prescaler));
    assert_param(IS_WWDG_WINDOW(hwwdg->Init.Window));
    assert_param(IS_WWDG_COUNTER(hwwdg->Init.Counter));

    if(hwwdg->State == HAL_WWDG_STATE_RESET)
    {
        /* Init the low level hardware */
        HAL_WWDG_MspInit(hwwdg);
    }

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

    /* Set WWDG Prescaler and Window */
    /* Get the CFR register value */
    tmp = hwwdg->Instance->CFR;

    /* Clear WDGTB[1:0] and W[6:0] bits */
    tmp &= ((uint32_t)~(WWDG_CFR_WDGTB | WWDG_CFR_W));

    /* Prepare the WWDG Prescaler and Window parameters */
    tmp |= hwwdg->Init.Prescaler | hwwdg->Init.Window;

    /* Write to WWDG CFR */
    hwwdg->Instance->CFR = tmp;

    /* Set WWDG Counter */
    /* Get the CR register value */
    tmp = hwwdg->Instance->CR;

    /* Clear T[6:0] bits */
    tmp &= (uint32_t)~((uint32_t)WWDG_CR_T);

    /* Prepare the WWDG Counter parameter */
    tmp |= (hwwdg->Init.Counter);

    /* Write to WWDG CR */
    hwwdg->Instance->CR = tmp;

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

    /* Return function status */
    return HAL_OK;
}
开发者ID:Ribster,项目名称:Labview,代码行数:64,代码来源:stm32l0xx_hal_wwdg.c

示例7: HAL_WWDG_Refresh

/**
  * @brief  Refreshes the WWDG.
  * @param  hwwdg : pointer to a WWDG_HandleTypeDef structure that contains
  *              the configuration information for the specified WWDG module.
  * @param  Counter: value of counter to put in WWDG counter
  * @retval HAL status
  */
HAL_StatusTypeDef HAL_WWDG_Refresh(WWDG_HandleTypeDef *hwwdg, uint32_t Counter)
{

  /* Check the parameters */
  assert_param(IS_WWDG_COUNTER(Counter));

  /* Write to WWDG CR the WWDG Counter value to refresh with */
  MODIFY_REG(hwwdg->Instance->CR, (uint32_t)WWDG_CR_T, Counter);
  
  /* Return function status */
  return HAL_OK;
}
开发者ID:AnselZhangGit,项目名称:LoRaMac-node,代码行数:19,代码来源:stm32l0xx_hal_wwdg.c

示例8: HAL_WWDG_Init

/**
  * @brief  Initializes the WWDG according to the specified
  *         parameters in the WWDG_InitTypeDef and creates the associated handle.
  * @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_Init(WWDG_HandleTypeDef *hwwdg)
{

  /* Check the WWDG handle allocation */
  if(hwwdg == NULL)
  {
    return HAL_ERROR;
  }

  /* Check the parameters */
  assert_param(IS_WWDG_ALL_INSTANCE(hwwdg->Instance));
  assert_param(IS_WWDG_PRESCALER(hwwdg->Init.Prescaler));
  assert_param(IS_WWDG_WINDOW(hwwdg->Init.Window));
  assert_param(IS_WWDG_COUNTER(hwwdg->Init.Counter));
  
  if(hwwdg->State == HAL_WWDG_STATE_RESET)
  {
    /* Allocate lock resource and initialize it */
    hwwdg->Lock = HAL_UNLOCKED;

    /* Init the low level hardware */
    HAL_WWDG_MspInit(hwwdg);
  }

  /* Take lock  and change peripheral state */
   __HAL_LOCK(hwwdg);
  hwwdg->State = HAL_WWDG_STATE_BUSY;

   /* Set WWDG Prescaler and Window  and Counter*/
  MODIFY_REG(hwwdg->Instance->CFR, (WWDG_CFR_WDGTB | WWDG_CFR_W), (hwwdg->Init.Prescaler | hwwdg->Init.Window));
  MODIFY_REG(hwwdg->Instance->CR, WWDG_CR_T, hwwdg->Init.Counter);

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

  /* Return function status */
  return HAL_OK;
}
开发者ID:AnselZhangGit,项目名称:LoRaMac-node,代码行数:46,代码来源:stm32l0xx_hal_wwdg.c

示例9: HAL_WWDG_Refresh

/**
  * @brief  Refreshes the WWDG.
  * @param  hwwdg: pointer to a WWDG_HandleTypeDef structure that contains
  *              the configuration information for the specified WWDG module.
  * @param  Counter: value of counter to put in WWDG counter
  * @retval HAL status
  */
HAL_StatusTypeDef HAL_WWDG_Refresh(WWDG_HandleTypeDef *hwwdg, uint32_t Counter)
{
    /* Process Locked */
    __HAL_LOCK(hwwdg);

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

    /* Check the parameters */
    assert_param(IS_WWDG_COUNTER(Counter));

    /* Write to WWDG CR the WWDG Counter value to refresh with */
    MODIFY_REG(hwwdg->Instance->CR, (uint32_t)WWDG_CR_T, Counter);

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

    /* Process Unlocked */
    __HAL_UNLOCK(hwwdg);

    /* Return function status */
    return HAL_OK;
}
开发者ID:Ribster,项目名称:Labview,代码行数:30,代码来源:stm32l0xx_hal_wwdg.c

示例10: WWDG_Enable

/**
  * @brief  Enables WWDG and load the counter value.                  
  * @param  Counter: specifies the watchdog counter value.
  *          This parameter must be a number between 0x40 and 0x7F (to prevent 
  *          generating an immediate reset).
  * @retval None
  */
void WWDG_Enable(uint8_t Counter)
{
  /* Check the parameters */
  assert_param(IS_WWDG_COUNTER(Counter));
  WWDG->CR = WWDG_CR_WDGA | Counter;
}
开发者ID:Ilydan,项目名称:ROwen,代码行数:13,代码来源:stm32f0xx_wwdg.c

示例11: WWDG_Enable

/**
  * @简述  使能 WWDG 和载入计数器的值.                  
  * @参数  Counter: 指定看门狗载入计数器的值.
  *                 这个参数必须是0x40到0x7F之间的一个数.
  * @返回  没有
  */
void WWDG_Enable(uint8_t Counter)
{
  /* 检查参数 */
  assert_param(IS_WWDG_COUNTER(Counter));
  WWDG->CR = CR_WDGA_Set | Counter;
}
开发者ID:ljqhack,项目名称:seuOS,代码行数:12,代码来源:stm32f10x_wwdg.c

示例12: WWDG_Enable

/**
  * @brief  WWDG_Enable - Enables WWDG and load the counter value.
  * @param  Counter: specifies the watchdog counter value.
  *   This parameter must be a number between 0x00 and 0x7F.
  * @retval None
  */
void WWDG_Enable(uint32_t Counter)
{
  /* Check the parameters */
  assert_param(IS_WWDG_COUNTER(Counter));
  MDR_WWDG->CR = WDGA_Mask | Counter;
}
开发者ID:PeterBeklemishev,项目名称:mila,代码行数:12,代码来源:MDR32F9Qx_wwdg.c


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