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


C++ Assert_Param函数代码示例

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


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


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