本文整理匯總了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;
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}
}
示例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;
}
}
示例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);
}
}
示例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;
}
}
示例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;
}
}