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

C++ PARAM_FUNCTIONALSTATE函数代码示例

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

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



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

示例1: UART_FIFOConfig

/*********************************************************************//**
 * @brief		Configure FIFO function on selected UART peripheral
 * @param[in]	UARTx	UART peripheral selected, should be UART0, UART1,
 * 						UART2 or UART3.
 * @param[in]	FIFOCfg	Pointer to a UART_FIFO_CFG_Type Structure that
 * 						contains specified information about FIFO configuration
 * @return 		none
 **********************************************************************/
void UART_FIFOConfig(UART_TypeDef *UARTx, UART_FIFO_CFG_Type *FIFOCfg)
{
	uint8_t tmp = 0;

	CHECK_PARAM(PARAM_UARTx(UARTx));
	CHECK_PARAM(PARAM_UART_FIFO_LEVEL(FIFOCfg->FIFO_Level));
	CHECK_PARAM(PARAM_FUNCTIONALSTATE(FIFOCfg->FIFO_DMAMode));
	CHECK_PARAM(PARAM_FUNCTIONALSTATE(FIFOCfg->FIFO_ResetRxBuf));
	CHECK_PARAM(PARAM_FUNCTIONALSTATE(FIFOCfg->FIFO_ResetTxBuf));

	tmp |= UART_FCR_FIFO_EN;
	switch (FIFOCfg->FIFO_Level){
	case UART_FIFO_TRGLEV0:
		tmp |= UART_FCR_TRG_LEV0;
		break;
	case UART_FIFO_TRGLEV1:
		tmp |= UART_FCR_TRG_LEV1;
		break;
	case UART_FIFO_TRGLEV2:
		tmp |= UART_FCR_TRG_LEV2;
		break;
	case UART_FIFO_TRGLEV3:
	default:
		tmp |= UART_FCR_TRG_LEV3;
		break;
	}

	if (FIFOCfg->FIFO_ResetTxBuf == ENABLE)
	{
		tmp |= UART_FCR_TX_RS;
	}
	if (FIFOCfg->FIFO_ResetRxBuf == ENABLE)
	{
		tmp |= UART_FCR_RX_RS;
	}
	if (FIFOCfg->FIFO_DMAMode == ENABLE)
	{
		tmp |= UART_FCR_DMAMODE_SEL;
	}


	//write to FIFO control register
	if (((UART1_TypeDef *)UARTx) == UART1)
	{
		((UART1_TypeDef *)UARTx)->/*IIFCR.*/FCR = tmp & UART_FCR_BITMASK;
	}
	else
	{
		UARTx->/*IIFCR.*/FCR = tmp & UART_FCR_BITMASK;
	}

}
开发者ID:BackupTheBerlios,项目名称:elua-svn,代码行数:60,代码来源:lpc17xx_uart.c


示例2: UART_TxCmd

/*********************************************************************//**
 * @brief		Enable/Disable transmission on UART TxD pin
 * @param[in]	UARTx	UART peripheral selected, should be:
 *   			- LPC_UART0: UART0 peripheral
 * 				- LPC_UART1: UART1 peripheral
 * 				- LPC_UART2: UART2 peripheral
 * 				- LPC_UART3: UART3 peripheral
 * @param[in]	NewState New State of Tx transmission function, should be:
 * 				- ENABLE: Enable this function
				- DISABLE: Disable this function
 * @return none
 **********************************************************************/
void UART_TxCmd(LPC_UART_TypeDef *UARTx, FunctionalState NewState)
{
	CHECK_PARAM(PARAM_UARTx(UARTx));
	CHECK_PARAM(PARAM_FUNCTIONALSTATE(NewState));

	if (NewState == ENABLE)
	{
		if (((LPC_UART1_TypeDef *)UARTx) == LPC_UART1)
		{
			((LPC_UART1_TypeDef *)UARTx)->TER |= UART_TER_TXEN;
		}
		else
		{
			UARTx->TER |= UART_TER_TXEN;
		}
	}
	else
	{
		if (((LPC_UART1_TypeDef *)UARTx) == LPC_UART1)
		{
			((LPC_UART1_TypeDef *)UARTx)->TER &= (~UART_TER_TXEN) & UART_TER_BITMASK;
		}
		else
		{
			UARTx->TER &= (~UART_TER_TXEN) & UART_TER_BITMASK;
		}
	}
}
开发者ID:thienhaiblue,项目名称:ampm_inverter_3kW,代码行数:40,代码来源:lpc17xx_uart.c


示例3: UART_FullModemConfigMode

/*********************************************************************//**
 * @brief		Configure Full Modem mode for UART peripheral
 * @param[in]	UARTx	LPC_UART1 (only)
 * @param[in]	Mode Full Modem mode, should be:
 * 				- UART1_MODEM_MODE_LOOPBACK: Loop back mode.
 * 				- UART1_MODEM_MODE_AUTO_RTS: Auto-RTS mode.
 * 				- UART1_MODEM_MODE_AUTO_CTS: Auto-CTS mode.
 * @param[in]	NewState New State of this mode, should be:
 * 				- ENABLE: Enable this mode.
				- DISABLE: Disable this mode.
 * @return none
 **********************************************************************/
void UART_FullModemConfigMode(LPC_UART1_TypeDef *UARTx, UART_MODEM_MODE_Type Mode, \
							FunctionalState NewState)
{
	uint8_t tmp;

	CHECK_PARAM(PARAM_UART1_MODEM(UARTx));
	CHECK_PARAM(PARAM_UART1_MODEM_MODE(Mode));
	CHECK_PARAM(PARAM_FUNCTIONALSTATE(NewState));

	switch(Mode){
	case UART1_MODEM_MODE_LOOPBACK:
		tmp = UART1_MCR_LOOPB_EN;
		break;
	case UART1_MODEM_MODE_AUTO_RTS:
		tmp = UART1_MCR_AUTO_RTS_EN;
		break;
	case UART1_MODEM_MODE_AUTO_CTS:
		tmp = UART1_MCR_AUTO_CTS_EN;
		break;
	default:
		break;
	}

	if (NewState == ENABLE)
	{
		UARTx->MCR |= tmp;
	}
	else
	{
		UARTx->MCR &= (~tmp) & UART1_MCR_BITMASK;
	}
}
开发者ID:thienhaiblue,项目名称:ampm_inverter_3kW,代码行数:44,代码来源:lpc17xx_uart.c


示例4: I2C_SetOwnSlaveAddr

/*********************************************************************//**
 * @brief		Set Own slave address in I2C peripheral corresponding to
 * 				parameter specified in OwnSlaveAddrConfigStruct.
 * @param[in]	I2Cx	I2C peripheral selected, should be
 *    			- LPC_I2C0
 * 				- LPC_I2C1
 * 				- LPC_I2C2
 * @param[in]	OwnSlaveAddrConfigStruct	Pointer to a I2C_OWNSLAVEADDR_CFG_Type
 * 				structure that contains the configuration information for the
*               specified I2C slave address.
 * @return 		None
 **********************************************************************/
void I2C_SetOwnSlaveAddr(LPC_I2C_TypeDef *I2Cx, I2C_OWNSLAVEADDR_CFG_Type *OwnSlaveAddrConfigStruct)
{
	uint32_t tmp;
	CHECK_PARAM(PARAM_I2Cx(I2Cx));
	CHECK_PARAM(PARAM_I2C_SLAVEADDR_CH(OwnSlaveAddrConfigStruct->SlaveAddrChannel));
	CHECK_PARAM(PARAM_FUNCTIONALSTATE(OwnSlaveAddrConfigStruct->GeneralCallState));

	tmp = (((uint32_t)(OwnSlaveAddrConfigStruct->SlaveAddr_7bit << 1)) \
			| ((OwnSlaveAddrConfigStruct->GeneralCallState == ENABLE) ? 0x01 : 0x00))& I2C_I2ADR_BITMASK;
	switch (OwnSlaveAddrConfigStruct->SlaveAddrChannel)
	{
	case 0:
		I2Cx->I2ADR0 = tmp;
		I2Cx->I2MASK0 = I2C_I2MASK_MASK((uint32_t) \
				(OwnSlaveAddrConfigStruct->SlaveAddrMaskValue));
		break;
	case 1:
		I2Cx->I2ADR1 = tmp;
		I2Cx->I2MASK1 = I2C_I2MASK_MASK((uint32_t) \
				(OwnSlaveAddrConfigStruct->SlaveAddrMaskValue));
		break;
	case 2:
		I2Cx->I2ADR2 = tmp;
		I2Cx->I2MASK2 = I2C_I2MASK_MASK((uint32_t) \
				(OwnSlaveAddrConfigStruct->SlaveAddrMaskValue));
		break;
	case 3:
		I2Cx->I2ADR3 = tmp;
		I2Cx->I2MASK3 = I2C_I2MASK_MASK((uint32_t) \
				(OwnSlaveAddrConfigStruct->SlaveAddrMaskValue));
		break;
	}
}
开发者ID:Martin-P,项目名称:lpc1768-control-bluetooth-dongle,代码行数:45,代码来源:lpc17xx_i2c.c


示例5: UART_ABCmd

/*********************************************************************//**
 * @brief		Start/Stop Auto Baudrate activity
 * @param[in]	UARTx	UART peripheral selected, should be
 *   			- LPC_UART0: UART0 peripheral
 * 				- LPC_UART1: UART1 peripheral
 * 				- LPC_UART2: UART2 peripheral
 * 				- LPC_UART3: UART3 peripheral
 * @param[in]	ABConfigStruct	A pointer to UART_AB_CFG_Type structure that
 * 								contains specified information about UART
 * 								auto baudrate configuration
 * @param[in]	NewState New State of Auto baudrate activity, should be:
 * 				- ENABLE: Start this activity
 *				- DISABLE: Stop this activity
 * Note:		Auto-baudrate mode enable bit will be cleared once this mode
 * 				completed.
 * @return 		none
 **********************************************************************/
void UART_ABCmd(LPC_UART_TypeDef *UARTx, UART_AB_CFG_Type *ABConfigStruct, \
				FunctionalState NewState)
{
	uint32_t tmp;

	CHECK_PARAM(PARAM_UARTx(UARTx));
	CHECK_PARAM(PARAM_FUNCTIONALSTATE(NewState));

	tmp = 0;
	if (NewState == ENABLE) {
		if (ABConfigStruct->ABMode == UART_AUTOBAUD_MODE1){
			tmp |= UART_ACR_MODE;
		}
		if (ABConfigStruct->AutoRestart == ENABLE){
			tmp |= UART_ACR_AUTO_RESTART;
		}
	}

	if (((LPC_UART1_TypeDef *)UARTx) == LPC_UART1)
	{
		if (NewState == ENABLE)
		{
			// Clear DLL and DLM value
			((LPC_UART1_TypeDef *)UARTx)->LCR |= UART_LCR_DLAB_EN;
			((LPC_UART1_TypeDef *)UARTx)->DLL = 0;
			((LPC_UART1_TypeDef *)UARTx)->DLM = 0;
			((LPC_UART1_TypeDef *)UARTx)->LCR &= ~UART_LCR_DLAB_EN;
			// FDR value must be reset to default value
			((LPC_UART1_TypeDef *)UARTx)->FDR = 0x10;
			((LPC_UART1_TypeDef *)UARTx)->ACR = UART_ACR_START | tmp;
		}
		else
		{
			((LPC_UART1_TypeDef *)UARTx)->ACR = 0;
		}
	}
	else
	{
		if (NewState == ENABLE)
		{
			// Clear DLL and DLM value
			UARTx->LCR |= UART_LCR_DLAB_EN;
			UARTx->DLL = 0;
			UARTx->DLM = 0;
			UARTx->LCR &= ~UART_LCR_DLAB_EN;
			// FDR value must be reset to default value
			UARTx->FDR = 0x10;
			UARTx->ACR = UART_ACR_START | tmp;
		}
		else
		{
			UARTx->ACR = 0;
		}
	}
}
开发者ID:thienhaiblue,项目名称:ampm_inverter_3kW,代码行数:72,代码来源:lpc17xx_uart.c


示例6: SYSTICK_IntCmd

/*********************************************************************//**
 * @brief 		Enable/disable System Tick interrupt
 * @param[in]	NewState	System Tick interrupt status, should be:
 * 					- ENABLE
 * 					- DISABLE
 * @return 		None
 **********************************************************************/
void SYSTICK_IntCmd(FunctionalState NewState)
{
	CHECK_PARAM(PARAM_FUNCTIONALSTATE(NewState));

	if(NewState == ENABLE)
		//Enable System Tick counter
		SysTick->CTRL |= ST_CTRL_TICKINT;
	else
		//Disable System Tick counter
		SysTick->CTRL &= ~ST_CTRL_TICKINT;
}
开发者ID:DanMills,项目名称:j4cDAC,代码行数:18,代码来源:lpc17xx_systick.c


示例7: SSP_SlaveOutputCmd

/*********************************************************************//**
 * @brief		Enable or disable Slave Output function in SSP peripheral
 * @param[in]	SSPx	SSP peripheral selected, should be:
 * 				 	- LPC_SSP0	:SSP0 peripheral
 * 					- LPC_SSP1	:SSP1 peripheral
 * @param[in]	NewState	New State of Slave Output function, should be:
 * 					- ENABLE	:Slave Output in normal operation
 * 					- DISABLE	:Slave Output is disabled. This blocks
 * 					SSP controller from driving the transmit data line (MISO)
 * Note: 		This function is available when SSP peripheral in Slave mode
 * @return 		None
 **********************************************************************/
void SSP_SlaveOutputCmd(LPC_SSPn_Type* SSPx, FunctionalState NewState)
{
    CHECK_PARAM(PARAM_SSPx(SSPx));
    CHECK_PARAM(PARAM_FUNCTIONALSTATE(NewState));

    if (NewState == ENABLE) {
        SSPx->CR1 &= (~SSP_CR1_SO_DISABLE) & SSP_CR1_BITMASK;
    } else {
        SSPx->CR1 |= SSP_CR1_SO_DISABLE;
    }
}
开发者ID:peterliu2,项目名称:FreeRTOS,代码行数:23,代码来源:lpc18xx_ssp.c


示例8: SSP_LoopBackCmd

/*********************************************************************//**
 * @brief		Enable or disable Loop Back mode function in SSP peripheral
 * @param[in]	SSPx	SSP peripheral selected, should be:
 * 				 	- LPC_SSP0	:SSP0 peripheral
 * 					- LPC_SSP1	:SSP1 peripheral
 * @param[in]	NewState	New State of Loop Back mode, should be:
 * 					- ENABLE
 * 					- DISABLE
 * @return 		None
 **********************************************************************/
void SSP_LoopBackCmd(LPC_SSPn_Type* SSPx, FunctionalState NewState)
{
    CHECK_PARAM(PARAM_SSPx(SSPx));
    CHECK_PARAM(PARAM_FUNCTIONALSTATE(NewState));

    if (NewState == ENABLE) {
        SSPx->CR1 |= SSP_CR1_LBM_EN;
    } else {
        SSPx->CR1 &= (~SSP_CR1_LBM_EN) & SSP_CR1_BITMASK;
    }
}
开发者ID:peterliu2,项目名称:FreeRTOS,代码行数:21,代码来源:lpc18xx_ssp.c


示例9: PWM_ConfigMatch

/*********************************************************************//**
 * @brief 		Configures match for PWM peripheral
 * @param[in]	PWMx	PWM peripheral selected, should be LPC_PWM1
 * @param[in]   PWM_MatchConfigStruct	Pointer to a PWM_MATCHCFG_Type structure
*                    that contains the configuration information for the
*                    specified PWM match function.
 * @return 		None
 **********************************************************************/
void PWM_ConfigMatch(LPC_PWM_TypeDef *PWMx, PWM_MATCHCFG_Type *PWM_MatchConfigStruct)
{
	CHECK_PARAM(PARAM_PWMx(PWMx));
	CHECK_PARAM(PARAM_PWM1_MATCH_CHANNEL(PWM_MatchConfigStruct->MatchChannel));
	CHECK_PARAM(PARAM_FUNCTIONALSTATE(PWM_MatchConfigStruct->IntOnMatch));
	CHECK_PARAM(PARAM_FUNCTIONALSTATE(PWM_MatchConfigStruct->ResetOnMatch));
	CHECK_PARAM(PARAM_FUNCTIONALSTATE(PWM_MatchConfigStruct->StopOnMatch));

	//interrupt on MRn
	if (PWM_MatchConfigStruct->IntOnMatch == ENABLE)
	{
		PWMx->MCR |= PWM_MCR_INT_ON_MATCH(PWM_MatchConfigStruct->MatchChannel);
	}
	else
	{
		PWMx->MCR &= (~PWM_MCR_INT_ON_MATCH(PWM_MatchConfigStruct->MatchChannel)) \
					& PWM_MCR_BITMASK;
	}

	//reset on MRn
	if (PWM_MatchConfigStruct->ResetOnMatch == ENABLE)
	{
		PWMx->MCR |= PWM_MCR_RESET_ON_MATCH(PWM_MatchConfigStruct->MatchChannel);
	}
	else
	{
		PWMx->MCR &= (~PWM_MCR_RESET_ON_MATCH(PWM_MatchConfigStruct->MatchChannel)) \
					& PWM_MCR_BITMASK;
	}

	//stop on MRn
	if (PWM_MatchConfigStruct->StopOnMatch == ENABLE)
	{
		PWMx->MCR |= PWM_MCR_STOP_ON_MATCH(PWM_MatchConfigStruct->MatchChannel);
	}
	else
	{
		PWMx->MCR &= (~PWM_MCR_STOP_ON_MATCH(PWM_MatchConfigStruct->MatchChannel)) \
					& PWM_MCR_BITMASK;
	}
}
开发者ID:leoarcu,项目名称:Electroestimulador,代码行数:49,代码来源:lpc17xx_pwm.c


示例10: QEI_IntCmd

/*********************************************************************//**
 * @brief		Enable/Disable specified interrupt in QEI peripheral
 * @param[in]	QEIx			QEI peripheral, should be LPC_QEI
 * @param[in]	ulIntType		Interrupt Flag Status type, should be:
 * 								- QEI_INTFLAG_INX_Int: index pulse was detected interrupt
 *								- QEI_INTFLAG_TIM_Int: Velocity timer over flow interrupt
 *								- QEI_INTFLAG_VELC_Int: Capture velocity is less than compare interrupt
 * 								- QEI_INTFLAG_DIR_Int: Change of direction interrupt
 *  							- QEI_INTFLAG_ERR_Int: An encoder phase error interrupt
 * 								- QEI_INTFLAG_ENCLK_Int: An encoder clock pulse was detected interrupt
 *								- QEI_INTFLAG_POS0_Int: position 0 compare value is equal to the
 *														current position interrupt
 *								- QEI_INTFLAG_POS1_Int: position 1 compare value is equal to the
 *														current position interrupt
 *								- QEI_INTFLAG_POS2_Int: position 2 compare value is equal to the
 *														current position interrupt
 *								- QEI_INTFLAG_REV_Int: Index compare value is equal to the current
 *														index count interrupt
 *								- QEI_INTFLAG_POS0REV_Int: Combined position 0 and revolution count interrupt
 *								- QEI_INTFLAG_POS1REV_Int: Combined position 1 and revolution count interrupt
 *								- QEI_INTFLAG_POS2REV_Int: Combined position 2 and revolution count interrupt
 * @param[in]	NewState		New function state, should be:
 *								- DISABLE
 *								- ENABLE
 * @return		None
 **********************************************************************/
void QEI_IntCmd(LPC_QEI_TypeDef *QEIx, uint32_t ulIntType, FunctionalState NewState)
{
	CHECK_PARAM(PARAM_QEIx(QEIx));
	CHECK_PARAM(PARAM_QEI_INTFLAG(ulIntType));
	CHECK_PARAM(PARAM_FUNCTIONALSTATE(NewState));

	if (NewState == ENABLE) {
		QEIx->QEIIES = ulIntType;
	} else {
		QEIx->QEIIEC = ulIntType;
	}
}
开发者ID:Avikit,项目名称:LPC17xx-DFU-Bootloader,代码行数:38,代码来源:lpc17xx_qei.c


示例11: SSP_DMACmd

/*********************************************************************//**
 * @brief		Enable/Disable DMA function for SSP peripheral
 * @param[in]	SSPx	SSP peripheral selected, should be:
 * 				 	- LPC_SSP0	:SSP0 peripheral
 * 					- LPC_SSP1	:SSP1 peripheral
 * @param[in]	DMAMode	Type of DMA, should be:
 * 					- SSP_DMA_TX	:DMA for the transmit FIFO
 * 					- SSP_DMA_RX	:DMA for the Receive FIFO
 * @param[in]	NewState	New State of DMA function on SSP peripheral,
 * 						should be:
 * 					- ENALBE	:Enable this function
 * 					- DISABLE	:Disable this function
 * @return		None
 **********************************************************************/
void SSP_DMACmd(LPC_SSPn_Type *SSPx, uint32_t DMAMode, FunctionalState NewState)
{
    CHECK_PARAM(PARAM_SSPx(SSPx));
    CHECK_PARAM(PARAM_SSP_DMA(DMAMode));
    CHECK_PARAM(PARAM_FUNCTIONALSTATE(NewState));

    if (NewState == ENABLE) {
        SSPx->DMACR |= DMAMode;
    } else {
        SSPx->DMACR &= (~DMAMode) & SSP_DMA_BITMASK;
    }
}
开发者ID:peterliu2,项目名称:FreeRTOS,代码行数:26,代码来源:lpc18xx_ssp.c


示例12: RTC_CntIncrIntConfig

/*********************************************************************//**
 * @brief 		Enable/Disable Counter increment interrupt for each time type
 * 				in RTC peripheral
 * @param[in]	RTCx	RTC peripheral selected, should be LPC_RTC
 * @param[in]	CntIncrIntType: Counter Increment Interrupt type,
 * 				an increment of this type value below will generates
 * 				an interrupt, should be:
 * 					- RTC_TIMETYPE_SECOND
 * 					- RTC_TIMETYPE_MINUTE
 * 					- RTC_TIMETYPE_HOUR
 * 					- RTC_TIMETYPE_DAYOFWEEK
 * 					- RTC_TIMETYPE_DAYOFMONTH
 * 					- RTC_TIMETYPE_DAYOFYEAR
 * 					- RTC_TIMETYPE_MONTH
 * 					- RTC_TIMETYPE_YEAR
 * @param[in]	NewState New State of this function, should be:
 * 					- ENABLE: Counter Increment interrupt for this time type are enabled
 * 					- DISABLE: Counter Increment interrupt for this time type are disabled
 * @return 		None
 **********************************************************************/
void RTC_CntIncrIntConfig (LPC_RTC_Type *RTCx, uint32_t CntIncrIntType, \
								FunctionalState NewState)
{
	uint32_t tem;

	CHECK_PARAM(PARAM_RTCx(RTCx));
	CHECK_PARAM(PARAM_FUNCTIONALSTATE(NewState));
	CHECK_PARAM(PARAM_RTC_TIMETYPE(CntIncrIntType));

	switch (CntIncrIntType)
	{
	case RTC_TIMETYPE_SECOND:
		tem = RTC_CIIR_IMSEC;
		break;
	case RTC_TIMETYPE_MINUTE:
		tem = RTC_CIIR_IMMIN;
		break;
	case RTC_TIMETYPE_HOUR:
		tem = RTC_CIIR_IMHOUR;
		break;
	case RTC_TIMETYPE_DAYOFWEEK:
		tem = RTC_CIIR_IMDOW;
		break;
	case RTC_TIMETYPE_DAYOFMONTH:
		tem = RTC_CIIR_IMDOM;
		break;
	case RTC_TIMETYPE_DAYOFYEAR:
		tem = RTC_CIIR_IMDOY;
		break;
	case RTC_TIMETYPE_MONTH:
		tem = RTC_CIIR_IMMON;
		break;
	case RTC_TIMETYPE_YEAR:
		tem = RTC_CIIR_IMYEAR;
		break;
	}
	if (NewState ==  ENABLE)
	{
		//do
		{
			RTCx->CIIR |= tem;
		}
		//while((RTCx->CIIR & tem)== 0);
	}
	else
	{
		//do
		{
			RTCx->CIIR &= (~tem) & RTC_CIIR_BITMASK;
		}
		//while(RTCx->CIIR & tem);
	}
}
开发者ID:AlexShiLucky,项目名称:freertos,代码行数:73,代码来源:lpc18xx_rtc.c


示例13: RTC_AlarmIntConfig

/*********************************************************************//**
 * @brief 		Enable/Disable Alarm interrupt for each time type
 * 				in RTC peripheral
 * @param[in]	RTCx	RTC peripheral selected, should be LPC_RTC
 * @param[in]	AlarmTimeType: Alarm Time Interrupt type,
 * 				an matching of this type value below with current time
 * 				in RTC will generates an interrupt, should be:
 * 					- RTC_TIMETYPE_SECOND
 * 					- RTC_TIMETYPE_MINUTE
 * 					- RTC_TIMETYPE_HOUR
 * 					- RTC_TIMETYPE_DAYOFWEEK
 * 					- RTC_TIMETYPE_DAYOFMONTH
 * 					- RTC_TIMETYPE_DAYOFYEAR
 * 					- RTC_TIMETYPE_MONTH
 * 					- RTC_TIMETYPE_YEAR
 * @param[in]	NewState New State of this function, should be:
 * 					- ENABLE: Alarm interrupt for this time type are enabled
 * 					- DISABLE: Alarm interrupt for this time type are disabled
 * @return 		None
 **********************************************************************/
void RTC_AlarmIntConfig (LPC_RTC_Type *RTCx, uint32_t AlarmTimeType, \
								FunctionalState NewState)
{
	uint32_t tem;

	CHECK_PARAM(PARAM_RTCx(RTCx));
	CHECK_PARAM(PARAM_FUNCTIONALSTATE(NewState));
	CHECK_PARAM(PARAM_RTC_TIMETYPE(AlarmTimeType));

	switch (AlarmTimeType)
	{
	case RTC_TIMETYPE_SECOND:
		tem = (RTC_AMR_AMRSEC);
		break;
	case RTC_TIMETYPE_MINUTE:
		tem = (RTC_AMR_AMRMIN);
		break;
	case RTC_TIMETYPE_HOUR:
		tem = (RTC_AMR_AMRHOUR);
		break;
	case RTC_TIMETYPE_DAYOFWEEK:
		tem = (RTC_AMR_AMRDOW);
		break;
	case RTC_TIMETYPE_DAYOFMONTH:
		tem = (RTC_AMR_AMRDOM);
		break;
	case RTC_TIMETYPE_DAYOFYEAR:
		tem = (RTC_AMR_AMRDOY);
		break;
	case RTC_TIMETYPE_MONTH:
		tem = (RTC_AMR_AMRMON);
		break;
	case RTC_TIMETYPE_YEAR:
		tem = (RTC_AMR_AMRYEAR);
		break;
	}
	if (NewState == ENABLE)
	{
		//do
		{
			RTCx->AMR &= (~tem) & RTC_AMR_BITMASK;
		}
		//while(RTCx->AMR & tem);
	}
	else
	{
		//do
		{
			RTCx->AMR |= (tem);
		}
		//while((RTCx->AMR & tem)== 0);
	}
}
开发者ID:AlexShiLucky,项目名称:freertos,代码行数:73,代码来源:lpc18xx_rtc.c


示例14: PWM_CounterCmd

/*********************************************************************//**
 * @brief 		Enable/Disable Counter in PWM peripheral
 * @param[in]	PWMx	PWM peripheral selected, should be LPC_PWM1
 * @param[in]	NewState New State of this function, should be:
 * 							- ENABLE: Enable Counter in PWM peripheral
 * 							- DISABLE: Disable Counter in PWM peripheral
 * @return 		None
 **********************************************************************/
void PWM_CounterCmd(LPC_PWM_TypeDef *PWMx, FunctionalState NewState)
{
	CHECK_PARAM(PARAM_PWMx(PWMx));
	CHECK_PARAM(PARAM_FUNCTIONALSTATE(NewState));
	if (NewState == ENABLE)
	{
		PWMx->TCR	|=  PWM_TCR_COUNTER_ENABLE;
	}
	else
	{
		PWMx->TCR &= (~PWM_TCR_COUNTER_ENABLE) & PWM_TCR_BITMASK;
	}
}
开发者ID:leoarcu,项目名称:Electroestimulador,代码行数:21,代码来源:lpc17xx_pwm.c


示例15: PWM_ConfigCapture

/*********************************************************************//**
 * @brief 		Configures capture input for PWM peripheral
 * @param[in]	PWMx	PWM peripheral selected, should be LPC_PWM1
 * @param[in]   PWM_CaptureConfigStruct	Pointer to a PWM_CAPTURECFG_Type structure
*                    that contains the configuration information for the
*                    specified PWM capture input function.
 * @return 		None
 **********************************************************************/
void PWM_ConfigCapture(LPC_PWM_TypeDef *PWMx, PWM_CAPTURECFG_Type *PWM_CaptureConfigStruct)
{
	CHECK_PARAM(PARAM_PWMx(PWMx));
	CHECK_PARAM(PARAM_PWM1_CAPTURE_CHANNEL(PWM_CaptureConfigStruct->CaptureChannel));
	CHECK_PARAM(PARAM_FUNCTIONALSTATE(PWM_CaptureConfigStruct->FallingEdge));
	CHECK_PARAM(PARAM_FUNCTIONALSTATE(PWM_CaptureConfigStruct->IntOnCaption));
	CHECK_PARAM(PARAM_FUNCTIONALSTATE(PWM_CaptureConfigStruct->RisingEdge));

	if (PWM_CaptureConfigStruct->RisingEdge == ENABLE)
	{
		PWMx->CCR |= PWM_CCR_CAP_RISING(PWM_CaptureConfigStruct->CaptureChannel);
	}
	else
	{
		PWMx->CCR &= (~PWM_CCR_CAP_RISING(PWM_CaptureConfigStruct->CaptureChannel)) \
					& PWM_CCR_BITMASK;
	}

	if (PWM_CaptureConfigStruct->FallingEdge == ENABLE)
	{
		PWMx->CCR |= PWM_CCR_CAP_FALLING(PWM_CaptureConfigStruct->CaptureChannel);
	}
	else
	{
		PWMx->CCR &= (~PWM_CCR_CAP_FALLING(PWM_CaptureConfigStruct->CaptureChannel)) \
					& PWM_CCR_BITMASK;
	}

	if (PWM_CaptureConfigStruct->IntOnCaption == ENABLE)
	{
		PWMx->CCR |= PWM_CCR_INT_ON_CAP(PWM_CaptureConfigStruct->CaptureChannel);
	}
	else
	{
		PWMx->CCR &= (~PWM_CCR_INT_ON_CAP(PWM_CaptureConfigStruct->CaptureChannel)) \
					& PWM_CCR_BITMASK;
	}
}
开发者ID:leoarcu,项目名称:Electroestimulador,代码行数:46,代码来源:lpc17xx_pwm.c


示例16: UART_IrDAInvtInputCmd

/*********************************************************************//**
 * @brief		Enable or disable inverting serial input function of IrDA
 * 				on UART peripheral.
 * @param[in]	UARTx UART peripheral selected, should be UART3 (only)
 * @param[in]	NewState New state of inverting serial input, should be:
 * 				- ENABLE: Enable this function.
 * 				- DISABLE: Disable this function.
 * @return none
 **********************************************************************/
void UART_IrDAInvtInputCmd(UART_TypeDef* UARTx, FunctionalState NewState)
{
	CHECK_PARAM(PARAM_UART_IrDA(UARTx));
	CHECK_PARAM(PARAM_FUNCTIONALSTATE(NewState));

	if (NewState == ENABLE)
	{
		UARTx->ICR |= UART_ICR_IRDAINV;
	}
	else if (NewState == DISABLE)
	{
		UARTx->ICR &= (~UART_ICR_IRDAINV) & UART_ICR_BITMASK;
	}
}
开发者ID:BackupTheBerlios,项目名称:elua-svn,代码行数:23,代码来源:lpc17xx_uart.c


示例17: COMP_VolLadderCmd

/**
  * @brief  Enables or disables the voltage ladder.
  *  
  * @param  NewState: new state of the voltage ladder. 
  *         This parameter can be: ENABLE or DISABLE.
  * @retval None 
  */
void COMP_VolLadderCmd (FunctionalState NewState)
{
    /* Check the parameters */
    CHECK_PARAM(PARAM_FUNCTIONALSTATE(NewState));
    
    if (NewState == ENABLE)
    {
        LPC_COMP->VLAD |= VLAD_ENABLE;   /* Enalbes voltage ladder */
    }
    else
    {
        LPC_COMP->VLAD &= VLAD_DISABLE;  /* Disables voltage ladder */
    }
}
开发者ID:Mars-Wu,项目名称:djyos,代码行数:21,代码来源:lpc12xx_comp.c


示例18: I2C_Cmd

/*********************************************************************//**
 * @brief		Enable or disable I2C peripheral's operation
 * @param[in]	I2Cx I2C peripheral selected, should be
 *  			- LPC_I2C0
 * 				- LPC_I2C1
 * 				- LPC_I2C2
 * @param[in]	NewState New State of I2Cx peripheral's operation
 * @return 		none
 **********************************************************************/
void I2C_Cmd(LPC_I2C_TypeDef* I2Cx, FunctionalState NewState)
{
	CHECK_PARAM(PARAM_FUNCTIONALSTATE(NewState));
	CHECK_PARAM(PARAM_I2Cx(I2Cx));

	if (NewState == ENABLE)
	{
		I2Cx->I2CONSET = I2C_I2CONSET_I2EN;
	}
	else
	{
		I2Cx->I2CONCLR = I2C_I2CONCLR_I2ENC;
	}
}
开发者ID:Martin-P,项目名称:lpc1768-control-bluetooth-dongle,代码行数:23,代码来源:lpc17xx_i2c.c


示例19: I2C_MonitorModeCmd

/*********************************************************************//**
 * @brief		Enable/Disable I2C monitor mode
 * @param[in]	I2Cx	I2C peripheral selected, should be I2C0, I2C1 or I2C2
 * @param[in]	NewState New State of this function, should be:
 * 				- ENABLE: Enable monitor mode.
 * 				- DISABLE: Disable monitor mode.
 * @return		None
 **********************************************************************/
void I2C_MonitorModeCmd(LPC_I2C_TypeDef *I2Cx, FunctionalState NewState)
{
	CHECK_PARAM(PARAM_I2Cx(I2Cx));
	CHECK_PARAM(PARAM_FUNCTIONALSTATE(NewState));

	if (NewState == ENABLE)
	{
		I2Cx->MMCTRL |= I2C_I2MMCTRL_MM_ENA;
	}
	else
	{
		I2Cx->MMCTRL &= (~I2C_I2MMCTRL_MM_ENA) & I2C_I2MMCTRL_BITMASK;
	}
}
开发者ID:RHChiou,项目名称:HP203B,代码行数:22,代码来源:lpc17xx_i2c.c


示例20: UART_IrDACmd

/*********************************************************************//**
 * @brief		Enable or disable IrDA function on UART peripheral.
 * @param[in]	UARTx UART peripheral selected, should be LPC_UART3 (only)
 * @param[in]	NewState New state of IrDA function, should be:
 * 				- ENABLE: Enable this function.
 * 				- DISABLE: Disable this function.
 * @return none
 **********************************************************************/
void UART_IrDACmd(LPC_UART_TypeDef* UARTx, FunctionalState NewState)
{
	CHECK_PARAM(PARAM_UART_IrDA(UARTx));
	CHECK_PARAM(PARAM_FUNCTIONALSTATE(NewState));

	if (NewState == ENABLE)
	{
		UARTx->ICR |= UART_ICR_IRDAEN;
	}
	else
	{
		UARTx->ICR &= (~UART_ICR_IRDAEN) & UART_ICR_BITMASK;
	}
}
开发者ID:thienhaiblue,项目名称:ampm_inverter_3kW,代码行数:22,代码来源:lpc17xx_uart.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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