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

C++ Assert_Param函数代码示例

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

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



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

示例1: USART_SendData

/*********************************************************************************************************//**
 * @brief USART SendData from Tx.
 * @param USARTx: where USARTx is USART to select the USART peripheral, x can be 0 or 1.
 * @param Data: the data to be transmitted.
 * @retval None
 ************************************************************************************************************/
void USART_SendData(USART_TypeDef* USARTx, u16 Data)
{
  /* Check the parameters */
  Assert_Param(IS_USART(USARTx));
  Assert_Param(IS_USART_DATA(Data));

  USARTx->RBR = Data;
}
开发者ID:CyanoBeta,项目名称:Holtek-Example,代码行数:14,代码来源:ht32f175x_275x_usart.c


示例2: USART_FIFOReset

/*********************************************************************************************************//**
 * @brief  Clear both the write and read point in Tx FIFO or Rx FIFO.
 * @param  USARTx: where USARTx is the selected USART from the USART peripheral, x can be 0 or 1.
 * @param  USART_FIFODirection: Determine TX FIFO or Rx FIFO that is to be reset.
 *   This parameter can be any combination of the following values:
 *     @arg USART_FIFO_TX   : Tx FIFO is to be reset
 *     @arg USART_FIFO_RX   : Rx FIFO is to be reset
 * @retval None
 ************************************************************************************************************/
void USART_FIFOReset(USART_TypeDef* USARTx, u32 USART_FIFODirection)
{
  /* Check the parameters */
  Assert_Param(IS_USART(USARTx));
  Assert_Param(IS_USART_FIFO_DIRECTION(USART_FIFODirection));

  USARTx->FCR |= USART_FIFODirection;
}
开发者ID:CyanoBeta,项目名称:Holtek-Example,代码行数:17,代码来源:ht32f175x_275x_usart.c


示例3: NVIC_SetVectorTable

/*********************************************************************************************************//**
  * @brief  Set the vector table location and Offset.
  * @param  NVIC_VectTable: Specify if the vector table is in FLASH or RAM.
  *   This parameter can be one of the following values:
  *     @arg NVIC_VECTTABLE_RAM
  *     @arg NVIC_VECTTABLE_FLASH
  * @param  NVIC_Offset: Vector Table base offset field.
  *   This value must be a multiple of 0x100.
  * @retval None
  ***********************************************************************************************************/
void NVIC_SetVectorTable(u32 NVIC_VectTable, u32 NVIC_Offset)
{
  /* Check the parameters                                                                                   */
  Assert_Param(IS_NVIC_VECTTABLE(NVIC_VectTable));
  Assert_Param(IS_NVIC_OFFSET(NVIC_Offset));

  SCB->VTOR = NVIC_VectTable | (NVIC_Offset & (u32)0x1FFFFF80);
}
开发者ID:SubaiDeng,项目名称:EmbeddedDevelopment,代码行数:18,代码来源:ht32_cm3_misc.c


示例4: USART_SetIrDAPrescaler

/*********************************************************************************************************//**
 * @brief Set the specified USART IrDA prescaler.
 * @param USARTx: where USARTx is USART to select the USART peripheral, x can be 0 or 1.
 * @param USART_IrDAPrescaler: Specify the USART IrDA prescaler.
 * @retval None
 ************************************************************************************************************/
void USART_SetIrDAPrescaler(USART_TypeDef* USARTx, u32 USART_IrDAPrescaler)
{
  /* Check the parameters */
  Assert_Param(IS_USART(USARTx));
  Assert_Param(IS_USART_IRDA_PRESCALER(USART_IrDAPrescaler));

  /* Set the USART IrDA prescaler */
  USARTx->ICR = (USARTx->ICR & RCR_ILPDVSR_Mask) | (USART_IrDAPrescaler << 0x08);
}
开发者ID:CyanoBeta,项目名称:Holtek-Example,代码行数:15,代码来源:ht32f175x_275x_usart.c


示例5: USART_SetGuardTime

/*********************************************************************************************************//**
 * @brief Set the specified USART guard time.
 * @param USARTx: where USARTx is USART to select the USART peripheral, x can be 0 or 1.
 * @param USART_GuardTime: Specify the guard time.
 * @retval None
 ************************************************************************************************************/
void USART_SetGuardTime(USART_TypeDef* USARTx, u32 USART_GuardTime)
{
  /* Check the parameters */
  Assert_Param(IS_USART(USARTx));
  Assert_Param(IS_USART_GUARD_TIME(USART_GuardTime));

  /* Set the USART guard time */
  USARTx->TPR = (USARTx->TPR & TPR_TG_Mask) | (USART_GuardTime << 0x08);
}
开发者ID:CyanoBeta,项目名称:Holtek-Example,代码行数:15,代码来源:ht32f175x_275x_usart.c


示例6: USART_SetTimeOutValue

/*********************************************************************************************************//**
 * @brief Set the value of USART FIFO Time Out.
 * @param USARTx: where USARTx is USART to select the USART peripheral, x can be 0 or 1.
 * @param USART_TimeOut: Specify the value of Time Out.
 * @retval None
 ************************************************************************************************************/
void USART_SetTimeOutValue(USART_TypeDef* USARTx, u32 USART_TimeOut)
{
  /* Check the parameters */
  Assert_Param(IS_USART(USARTx));
  Assert_Param(IS_USART_TIMEOUT(USART_TimeOut));

  /* Set the USART time out */
  USARTx->TPR = (USARTx->TPR & TPR_RTOIC_Mask) | USART_TimeOut;
}
开发者ID:CyanoBeta,项目名称:Holtek-Example,代码行数:15,代码来源:ht32f175x_275x_usart.c


示例7: USART_SetAddressMatchValue

/*********************************************************************************************************//**
 * @brief Set the specified USART RS485 address match value.
 * @param USARTx: where USARTx is USART to select the USART peripheral, x can be 0 or 1.
 * @param USART_AddressMatchValue: specify the RS485 address match value.
 * @retval None
 ************************************************************************************************************/
void USART_SetAddressMatchValue(USART_TypeDef* USARTx, u32 USART_AddressMatchValue)
{
  /* Check the parameters */
  Assert_Param(IS_USART(USARTx));
  Assert_Param(IS_USART_ADDRESS_MATCH_VALUE(USART_AddressMatchValue));

  /* Set the USART guard time */
  USARTx->RCR = (USARTx->RCR & RS485CR_ADDM_Mask) | (u32)(USART_AddressMatchValue<<0x08);

}
开发者ID:CyanoBeta,项目名称:Holtek-Example,代码行数:16,代码来源:ht32f175x_275x_usart.c


示例8: PDMA_ClearFlag

/*********************************************************************************************************//**
  * @brief  Clear the specific PDMA channel interrupt flags
  * @param  PDMA_Ch: PDMA_CH0 ~ PDMACH7
  * @param  PDMA_Flag: PDMA_FLAG_GE, PDMA_FLAG_BE, PDMA_FLAG_HT, PDMA_FLAG_TC, PDMA_FLAG_TE
  * @retval None
  ***********************************************************************************************************/
void PDMA_ClearFlag(u32 PDMA_Ch, u32 PDMA_Flag)
{
  u32 *PdmaIntStatClrReg = (PDMA_Ch < 6) ? ((u32 *)(&HT_PDMA->ISCR0)) : ((u32 *)(&HT_PDMA->ISCR1));
  u32 BitShift = (PDMA_Ch < 6) ? (PDMA_Ch * 5) : ((PDMA_Ch - 6) * 5);

  /* Check the parameters                                                                                   */
  Assert_Param(IS_PDMA_CH(PDMA_Ch));
  Assert_Param(IS_PDMA_CLEAR_FLAG(PDMA_Flag));

  *PdmaIntStatClrReg |= (PDMA_Flag << BitShift);
}
开发者ID:SubaiDeng,项目名称:EmbeddedDevelopment,代码行数:17,代码来源:ht32f1655_56_pdma.c


示例9: USART_TFITLConfig

/*********************************************************************************************************//**
 * @brief Configure the Tx FIFO Interrupt Trigger Level.
 * @param USARTx: where USARTx is USART to select the USART peripheral, x can be 0 or 1.
 * @param USART_TFITL: Specify the USART Tx FIFO interrupt trigger level.
 *   This parameter can be one of the following values:
 *         @arg USART_TFITL_00
 *         @arg USART_TFITL_02
 *         @arg USART_TFITL_04
 *         @arg USART_TFITL_08
 * @retval None
 ************************************************************************************************************/
void USART_TFITLConfig(USART_TypeDef* USARTx, u32 USART_TFITL)
{
  u32 tmpreg = 0x00;

  /* Check the parameters */
  Assert_Param(IS_USART(USARTx));
  Assert_Param(IS_USART_TFITL(USART_TFITL));

  tmpreg = USARTx->FCR & FCR_TFITL_CLEAR_Mask;
  /* Set the USART TFITL */
  USARTx->FCR = tmpreg | USART_TFITL;
}
开发者ID:CyanoBeta,项目名称:Holtek-Example,代码行数:23,代码来源:ht32f175x_275x_usart.c


示例10: PDMA_TranSizeConfig

/*********************************************************************************************************//**
  * @brief  PDMA_TranSizeConfig
  * @param  PDMA_Ch: PDMA_CH0 ~ PDMACH7
  * @param  BlkCnt: Number of blocks for a transfer
  * @param  BlkLen: Number of data for a block
  * @retval None
  ***********************************************************************************************************/
void PDMA_TranSizeConfig(u32 PDMA_Ch, u32 BlkCnt, u32 BlkLen)
{
  HT_PDMACH_TypeDef *PDMACHx = (HT_PDMACH_TypeDef *)(HT_PDMA_BASE + PDMA_Ch * 6 * 4);

  /* Check the parameters                                                                                   */
  Assert_Param(IS_PDMA_CH(PDMA_Ch));
  Assert_Param(IS_PDMA_BLK_CNT(BlkCnt));
  Assert_Param(IS_PDMA_BLK_LEN(BlkLen));

  /* transfer size configuration                                                                            */
  PDMACHx->TSR = ((BlkCnt << 16) | BlkLen);
}
开发者ID:SubaiDeng,项目名称:EmbeddedDevelopment,代码行数:19,代码来源:ht32f1655_56_pdma.c


示例11: USART_IrDAConfig

/*********************************************************************************************************//**
 * @brief Configure the USART IrDA interface.
 * @param USARTx: where USARTx is USART to select the USART peripheral, x can be 0 or 1.
 * @param USART_IrDAMode: Specify the USART IrDA mode.
 *   This parameter can be one of the following values:
 *         @arg USART_IRDA_LOWPOWER
 *         @arg USART_IRDA_NORMAL
 * @retval None
 ************************************************************************************************************/
void USART_IrDAConfig(USART_TypeDef* USARTx, u32 USART_IrDAMode)
{
  /* Check the parameters */
  Assert_Param(IS_USART(USARTx));
  Assert_Param(IS_USART_IRDA_MODE(USART_IrDAMode));

  if (USART_IrDAMode != USART_IRDA_NORMAL)
  {
    USARTx->ICR |= USART_IRDA_LOWPOWER;
  }
  else
  {
    USARTx->ICR &= USART_IRDA_NORMAL;
  }
}
开发者ID:CyanoBeta,项目名称:Holtek-Example,代码行数:24,代码来源:ht32f175x_275x_usart.c


示例12: USART_RS485TxEnablePolarityConfig

/*********************************************************************************************************//**
 * @brief Configure the polarity of RS485 transmitter enable signal.
 * @param USARTx: where USARTx is USART to select the USART peripheral, x can be 0 or 1.
 * @param USART_RS485Polarity: Specify the polarity of USART RS485 Tx enable signal.
 *   This parameter can be one of the following values:
 *         @arg USART_RS485POL_LOW
 *         @arg USART_RS485POL_HIGH
 * @retval None
 ************************************************************************************************************/
void USART_RS485TxEnablePolarityConfig(USART_TypeDef* USARTx, u32 USART_RS485Polarity)
{
  /* Check the parameters */
  Assert_Param(IS_USART(USARTx));
  Assert_Param(IS_USART_RS485_POLARITY(USART_RS485Polarity));

  if (USART_RS485Polarity != USART_RS485POLARITY_HIGH)
  {
    USARTx->RCR |= USART_RS485POLARITY_LOW;
  }
  else
  {
    USARTx->RCR &= USART_RS485POLARITY_HIGH;
  }
}
开发者ID:CyanoBeta,项目名称:Holtek-Example,代码行数:24,代码来源:ht32f175x_275x_usart.c


示例13: NVIC_LowPowerConfig

/*********************************************************************************************************//**
  * @brief  Select which low power mode to execute to the system.
  * @param  NVIC_LowPowerMode:  Specify the new low power mode to execute to the system.
  *   This parameter can be one of the following values:
  *     @arg NVIC_LOWPOWER_SEVONPEND
  *     @arg NVIC_LOWPOWER_SLEEPDEEP
  *     @arg NVIC_LOWPOWER_SLEEPONEXIT
  * @param  NewState: new state of low power condition.
  *   This parameter can be: ENABLE or DISABLE.
  * @retval None
  ***********************************************************************************************************/
void NVIC_LowPowerConfig(u8 NVIC_LowPowerMode,  ControlStatus NewState)
{
  /* Check the parameters                                                                                   */
  Assert_Param(IS_NVIC_LOWPOWER(NVIC_LowPowerMode));
  Assert_Param(IS_CONTROL_STATUS(NewState));

  if (NewState != DISABLE)
  {
    SCB->SCR |= NVIC_LowPowerMode;
  }
  else
  {
    SCB->SCR &= (u32)(~(u32)NVIC_LowPowerMode);
  }
}
开发者ID:SubaiDeng,项目名称:EmbeddedDevelopment,代码行数:26,代码来源:ht32_cm3_misc.c


示例14: USART_IrDAInvtInputCmd

/*********************************************************************************************************//**
 * @brief Enable or Disable inverting serial input function of IrDA on the specified USART.
 * @param USARTx: where USARTx is USART to select the USART peripheral, x can be 0 or 1.
 * @param NewState: new state of the inverting serial input.
 *   This parameter can be: ENABLE or DISABLE.
 * @retval None
 ************************************************************************************************************/
void USART_IrDAInvtInputCmd(USART_TypeDef* USARTx, ControlStatus NewState)
{
  /* Check the parameters */
  Assert_Param(IS_USART(USARTx));
  Assert_Param(IS_CONTROL_STATUS(NewState));

  if (NewState != DISABLE)
  {
    USARTx->ICR |= USART_RXINV_ON;
  }
  else
  {
    USARTx->ICR &= USART_RXINV_OFF;
  }
}
开发者ID:CyanoBeta,项目名称:Holtek-Example,代码行数:22,代码来源:ht32f175x_275x_usart.c


示例15: USART_StickParityCmd

/*********************************************************************************************************//**
 * @brief  Enable or Disable the USART stick parity function.
 * @param  USARTx: where USARTx is the selected USART from the USART peripheral, x can be 0 or 1.
 * @param  NewState: new state of the stick parity.
 *   This parameter can be: ENABLE or DISABLE
 * @retval None
 ************************************************************************************************************/
void USART_StickParityCmd(USART_TypeDef* USARTx, ControlStatus NewState)
{
  /* Check the parameters */
  Assert_Param(IS_USART(USARTx));
  Assert_Param(IS_CONTROL_STATUS(NewState));

  if (NewState != DISABLE)
  {
    USARTx->LCR |= USART_SPE_ON;
  }
  else
  {
    USARTx->LCR &= USART_SPE_OFF;
  }
}
开发者ID:CyanoBeta,项目名称:Holtek-Example,代码行数:22,代码来源:ht32f175x_275x_usart.c


示例16: USART_StickParityConfig

/*********************************************************************************************************//**
 * @brief  Configure stick parity value of the USART.
 * @param  USARTx: where USARTx is the selected USART from the USART peripheral, x can be 0 or 1.
 * @param  USART_StickParity: Specify stick parity of the USART.
 *   This parameter can be one of the following values
 *         @arg USART_STICK_LOW
 *         @arg USART_STICK_HIGH
 * @retval None
 ************************************************************************************************************/
void USART_StickParityConfig(USART_TypeDef * USARTx, u32 USART_StickParity)
{
  /* Check the parameters */
  Assert_Param(IS_USART(USARTx));
  Assert_Param(IS_USART_STICK_PARITY(USART_StickParity));

  if (USART_StickParity != USART_STICK_HIGH)
  {
    USARTx->LCR |= USART_STICK_LOW;
  }
  else
  {
    USARTx->LCR &= USART_STICK_HIGH;
  }
}
开发者ID:CyanoBeta,项目名称:Holtek-Example,代码行数:24,代码来源:ht32f175x_275x_usart.c


示例17: USART_IntConfig

/*********************************************************************************************************//**
 * @brief Enable or Disable the USART interrupts.
 * @param USARTx: where USARTx is USART to select the USART peripheral, x can be 0 or 1.
 * @param USART_IER: Specify if the USART interrupt source to be enabled or disabled.
 *   This parameter can be one of the following values:
 *         @arg USART_IER_MSIE
 *         @arg USART_IER_RLSIE
 *         @arg USART_IER_THREIE
 *         @arg USART_IER_RDAIE
 *         @arg USART_IER_ENON
 * @param NewState: new state of the USART interrupts.
 *   This parameter can be: ENABLE or DISABLE.
 * @retval None
 ************************************************************************************************************/
void USART_IntConfig(USART_TypeDef* USARTx, u32 USART_IER, ControlStatus NewState)
{
  /* Check the parameters */
  Assert_Param(IS_USART(USARTx));
  Assert_Param(IS_CONTROL_STATUS(NewState));

  if (NewState != DISABLE)
  {
    USARTx->IER |= USART_IER;
  }
  else
  {
    USARTx->IER &= ~USART_IER;
  }
}
开发者ID:CyanoBeta,项目名称:Holtek-Example,代码行数:29,代码来源:ht32f175x_275x_usart.c


示例18: USART_IrDADirectionConfig

/*********************************************************************************************************//**
 * @brief Enable the IrDA transmitter or receiver.
 * @param USARTx: where USARTx is USART to select the USART peripheral, x can be 0 or 1.
 * @param USART_IrDADirection: Specify the USART IrDA direction select.
 *   This parameter can be one of the following values:
 *         @arg USART_IRDA_TX
 *         @arg USART_IRDA_RX
 * @retval None
 ************************************************************************************************************/
void USART_IrDADirectionConfig(USART_TypeDef* USARTx, u32 USART_IrDADirection)
{
  /* Check the parameters */
  Assert_Param(IS_USART(USARTx));
  Assert_Param(IS_USART_IRDA_DIRECTION(USART_IrDADirection));

  if (USART_IrDADirection != USART_IRDA_RX)
  {
    USARTx->ICR |= USART_IRDA_TX;
  }
  else
  {
    USARTx->ICR &= USART_IRDA_RX;
  }
}
开发者ID:CyanoBeta,项目名称:Holtek-Example,代码行数:24,代码来源:ht32f175x_275x_usart.c


示例19: USART_TimeOutIntConfig

/*********************************************************************************************************//**
 * @brief Enable or Disable time out interrupt of the USART.
 * @param USARTx: where USARTx is USART to select the USART peripheral, x can be 0 or 1.
 * @param NewState: new state of the time out interrupt.
 *   This parameter can be: ENABLE or DISABLE.
 * @retval None
 ************************************************************************************************************/
void USART_TimeOutIntConfig(USART_TypeDef* USARTx, ControlStatus NewState)
{
  /* Check the parameters */
  Assert_Param(IS_USART(USARTx));
  Assert_Param(IS_CONTROL_STATUS(NewState));

  if (NewState != DISABLE)
  {
    USARTx->TPR |= USART_TIMEOUT_ON;
  }
  else
  {
    USARTx->TPR &= USART_TIMEOUT_OFF;
  }
}
开发者ID:CyanoBeta,项目名称:Holtek-Example,代码行数:22,代码来源:ht32f175x_275x_usart.c


示例20: USART_DeInit

/*********************************************************************************************************//**
 * @brief Deinitialize registers of the USART peripheral by resetting USART.
 * @param USARTx: where USARTx is USART to select the USART peripheral.
 * @retval None
 ************************************************************************************************************/
void USART_DeInit(USART_TypeDef* USARTx)
{
  /* Check the parameters */
  Assert_Param(IS_USART(USARTx));

  RSTCU_APBPerip0Reset(RSTCU_APBRST0_USART, ENABLE);
}
开发者ID:afxstar,项目名称:Mplib,代码行数:12,代码来源:ht32f125x_usart.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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