本文整理汇总了C++中CY_SET_REG8函数的典型用法代码示例。如果您正苦于以下问题:C++ CY_SET_REG8函数的具体用法?C++ CY_SET_REG8怎么用?C++ CY_SET_REG8使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CY_SET_REG8函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: ChargeDelay_WritePeriod
/*******************************************************************************
* Function Name: ChargeDelay_WritePeriod
********************************************************************************
*
* Summary:
* This function is used to change the period of the counter. The new period
* will be loaded the next time terminal count is detected.
*
* Parameters:
* period: Period value. May be between 1 and (2^Resolution)-1. A value of 0
* will result in the counter remaining at zero.
*
* Return:
* None
*
*******************************************************************************/
void ChargeDelay_WritePeriod(uint8 period)
{
#if(ChargeDelay_UsingFixedFunction)
CY_SET_REG16(ChargeDelay_PERIOD_LSB_PTR, (uint16)period);
#else
CY_SET_REG8(ChargeDelay_PERIOD_LSB_PTR, period);
#endif /* (ChargeDelay_UsingFixedFunction) */
}
开发者ID:dmaone,项目名称:CommonSense,代码行数:24,代码来源:ChargeDelay.c
示例2: ChargeDelay_WriteCompare
/*******************************************************************************
* Function Name: ChargeDelay_WriteCompare
********************************************************************************
*
* Summary:
* This funtion is used to change the compare1 value when the PWM is in Dither
* mode. The compare output will reflect the new value on the next UDB clock.
* The compare output will be driven high when the present counter value is
* compared to the compare value based on the compare mode defined in
* Dither Mode.
*
* Parameters:
* compare: New compare value.
*
* Return:
* None
*
* Side Effects:
* This function is only available if the PWM mode parameter is set to
* Dither Mode, Center Aligned Mode or One Output Mode
*
*******************************************************************************/
void ChargeDelay_WriteCompare(uint8 compare) \
{
#if(ChargeDelay_UsingFixedFunction)
CY_SET_REG16(ChargeDelay_COMPARE1_LSB_PTR, (uint16)compare);
#else
CY_SET_REG8(ChargeDelay_COMPARE1_LSB_PTR, compare);
#endif /* (ChargeDelay_UsingFixedFunction) */
#if (ChargeDelay_PWMMode == ChargeDelay__B_PWM__DITHER)
#if(ChargeDelay_UsingFixedFunction)
CY_SET_REG16(ChargeDelay_COMPARE2_LSB_PTR, (uint16)(compare + 1u));
#else
CY_SET_REG8(ChargeDelay_COMPARE2_LSB_PTR, (compare + 1u));
#endif /* (ChargeDelay_UsingFixedFunction) */
#endif /* (ChargeDelay_PWMMode == ChargeDelay__B_PWM__DITHER) */
}
开发者ID:dmaone,项目名称:CommonSense,代码行数:39,代码来源:ChargeDelay.c
示例3: QuadDecoder_Cnt8_WritePeriod
/*******************************************************************************
* Function Name: QuadDecoder_Cnt8_WritePeriod
********************************************************************************
* Summary:
* Changes the period of the counter. The new period
* will be loaded the next time terminal count is detected.
*
* Parameters:
* period: (uint8) A value of 0 will result in
* the counter remaining at zero.
*
* Return:
* void
*
*******************************************************************************/
void QuadDecoder_Cnt8_WritePeriod(uint8 period)
{
#if(QuadDecoder_Cnt8_UsingFixedFunction)
CY_SET_REG16(QuadDecoder_Cnt8_PERIOD_LSB_PTR,(uint16)period);
#else
CY_SET_REG8(QuadDecoder_Cnt8_PERIOD_LSB_PTR, period);
#endif /* (QuadDecoder_Cnt8_UsingFixedFunction) */
}
开发者ID:Qmax,项目名称:PT6,代码行数:23,代码来源:QuadDecoder_Cnt8.c
示例4: PWM_B_WriteCompare
/*******************************************************************************
* Function Name: PWM_B_WriteCompare
********************************************************************************
*
* Summary:
* This funtion is used to change the compare1 value when the PWM is in Dither
* mode. The compare output will reflect the new value on the next UDB clock.
* The compare output will be driven high when the present counter value is
* compared to the compare value based on the compare mode defined in
* Dither Mode.
*
* Parameters:
* compare: New compare value.
*
* Return:
* None
*
* Side Effects:
* This function is only available if the PWM mode parameter is set to
* Dither Mode, Center Aligned Mode or One Output Mode
*
*******************************************************************************/
void PWM_B_WriteCompare(uint8 compare) \
{
#if(PWM_B_UsingFixedFunction)
CY_SET_REG16(PWM_B_COMPARE1_LSB_PTR, (uint16)compare);
#else
CY_SET_REG8(PWM_B_COMPARE1_LSB_PTR, compare);
#endif /* (PWM_B_UsingFixedFunction) */
#if (PWM_B_PWMMode == PWM_B__B_PWM__DITHER)
#if(PWM_B_UsingFixedFunction)
CY_SET_REG16(PWM_B_COMPARE2_LSB_PTR, (uint16)(compare + 1u));
#else
CY_SET_REG8(PWM_B_COMPARE2_LSB_PTR, (compare + 1u));
#endif /* (PWM_B_UsingFixedFunction) */
#endif /* (PWM_B_PWMMode == PWM_B__B_PWM__DITHER) */
}
开发者ID:RobotClubKut,项目名称:omuni_base,代码行数:39,代码来源:PWM_B.c
示例5: PWM_WritePeriod
/*******************************************************************************
* Function Name: PWM_WritePeriod
********************************************************************************
*
* Summary:
* This function is used to change the period of the counter. The new period
* will be loaded the next time terminal count is detected.
*
* Parameters:
* period: Period value. May be between 1 and (2^Resolution)-1. A value of 0
* will result in the counter remaining at zero.
*
* Return:
* None
*
*******************************************************************************/
void PWM_WritePeriod(uint8 period)
{
#if(PWM_UsingFixedFunction)
CY_SET_REG16(PWM_PERIOD_LSB_PTR, (uint16)period);
#else
CY_SET_REG8(PWM_PERIOD_LSB_PTR, period);
#endif /* (PWM_UsingFixedFunction) */
}
开发者ID:GSejas,项目名称:Control,代码行数:24,代码来源:PWM.c
示例6: gpio_irq_set
void gpio_irq_set(gpio_irq_t *obj, gpio_irq_event event, uint32_t enable) {
if (!enable)
CY_SET_REG8(obj->inttypeReg, 0x0);
else if (event == IRQ_RISE)
CY_SET_REG8(obj->inttypeReg, 0x01);
else if (event == IRQ_FALL)
CY_SET_REG8(obj->inttypeReg, 0x02);
else if (event == (IRQ_FALL | IRQ_RISE))
CY_SET_REG8(obj->inttypeReg, 0x03);
else
debug("Did not set any interrupt handler type!\r\n");
obj->intTypeValue = CY_GET_REG8(obj->inttypeReg);
CyIntSetVector(obj->irqLine, handle_interrupt_in);
CyIntEnable(obj->irqLine);
}
开发者ID:getopenmono,项目名称:mbedComp,代码行数:17,代码来源:gpio_irq_api.c
示例7: QuadDecoder_Cnt8_WriteCompare
/*******************************************************************************
* Function Name: QuadDecoder_Cnt8_WriteCompare
********************************************************************************
* Summary:
* Changes the compare value. The compare output will
* reflect the new value on the next UDB clock. The compare output will be
* driven high when the present counter value compares true based on the
* configured compare mode setting.
*
* Parameters:
* Compare: New compare value.
*
* Return:
* void
*
*******************************************************************************/
void QuadDecoder_Cnt8_WriteCompare(uint8 compare) \
{
#if(QuadDecoder_Cnt8_UsingFixedFunction)
CY_SET_REG16(QuadDecoder_Cnt8_COMPARE_LSB_PTR, (uint16)compare);
#else
CY_SET_REG8(QuadDecoder_Cnt8_COMPARE_LSB_PTR, compare);
#endif /* (QuadDecoder_Cnt8_UsingFixedFunction) */
}
开发者ID:Qmax,项目名称:PT6,代码行数:25,代码来源:QuadDecoder_Cnt8.c
示例8: ChargeDelay_WriteCompare2
/*******************************************************************************
* Function Name: ChargeDelay_WriteCompare2
********************************************************************************
*
* Summary:
* This funtion is used to change the compare value, for compare1 output.
* The compare output will reflect the new value on the next UDB clock.
* The compare output will be driven high when the present counter value is
* less than or less than or equal to the compare register, depending on the
* mode.
*
* Parameters:
* compare: New compare value.
*
* Return:
* None
*
*******************************************************************************/
void ChargeDelay_WriteCompare2(uint8 compare) \
{
#if(ChargeDelay_UsingFixedFunction)
CY_SET_REG16(ChargeDelay_COMPARE2_LSB_PTR, compare);
#else
CY_SET_REG8(ChargeDelay_COMPARE2_LSB_PTR, compare);
#endif /* (ChargeDelay_UsingFixedFunction) */
}
开发者ID:dmaone,项目名称:CommonSense,代码行数:27,代码来源:ChargeDelay.c
示例9: USBFS_1_CheckActivity
/*******************************************************************************
* Function Name: USBFS_1_CheckActivity
********************************************************************************
*
* Summary:
* Returns the activity status of the bus. Clears the status hardware to
* provide fresh activity status on the next call of this routine.
*
* Parameters:
* None.
*
* Return:
* 1 - If bus activity was detected since the last call to this function
* 0 - If bus activity not was detected since the last call to this function
*
*******************************************************************************/
uint8 USBFS_1_CheckActivity(void)
{
uint8 r;
r = CY_GET_REG8(USBFS_1_CR1_PTR);
CY_SET_REG8(USBFS_1_CR1_PTR, (r & ((uint8)(~USBFS_1_CR1_BUS_ACTIVITY))));
return((r & USBFS_1_CR1_BUS_ACTIVITY) >> USBFS_1_CR1_BUS_ACTIVITY_SHIFT);
}
开发者ID:akashbad,项目名称:6.115,代码行数:25,代码来源:USBFS_1.c
示例10: LED_SEG_PWM_WriteCompare1
/*******************************************************************************
* Function Name: LED_SEG_PWM_WriteCompare1
********************************************************************************
*
* Summary:
* This funtion is used to change the compare1 value. The compare output will
* reflect the new value on the next UDB clock. The compare output will be
* driven high when the present counter value is less than or less than or
* equal to the compare register, depending on the mode.
*
* Parameters:
* compare: New compare value.
*
* Return:
* None
*
*******************************************************************************/
void LED_SEG_PWM_WriteCompare1(uint8 compare) \
{
#if(LED_SEG_PWM_UsingFixedFunction)
CY_SET_REG16(LED_SEG_PWM_COMPARE1_LSB_PTR, (uint16)compare);
#else
CY_SET_REG8(LED_SEG_PWM_COMPARE1_LSB_PTR, compare);
#endif /* (LED_SEG_PWM_UsingFixedFunction) */
}
开发者ID:remixvit,项目名称:Thermometr,代码行数:26,代码来源:LED_SEG_PWM.c
示例11: MotorPWM_WriteCompare2
/*******************************************************************************
* Function Name: MotorPWM_WriteCompare2
********************************************************************************
*
* Summary:
* This funtion is used to change the compare value, for compare1 output.
* The compare output will reflect the new value on the next UDB clock.
* The compare output will be driven high when the present counter value is
* less than or less than or equal to the compare register, depending on the
* mode.
*
* Parameters:
* compare: New compare value.
*
* Return:
* None
*
*******************************************************************************/
void MotorPWM_WriteCompare2(uint8 compare) \
{
#if(MotorPWM_UsingFixedFunction)
CY_SET_REG16(MotorPWM_COMPARE2_LSB_PTR, compare);
#else
CY_SET_REG8(MotorPWM_COMPARE2_LSB_PTR, compare);
#endif /* (MotorPWM_UsingFixedFunction) */
}
开发者ID:eamsuwan93,项目名称:PSoC-4-Compass-Sensor,代码行数:27,代码来源:MotorPWM.c
示例12: TIMER_ThreadTimer_WritePeriod
/*******************************************************************************
* Function Name: TIMER_ThreadTimer_WritePeriod
********************************************************************************
*
* Summary:
* This function is used to change the period of the counter. The new period
* will be loaded the next time terminal count is detected.
*
* Parameters:
* period: This value may be between 1 and (2^Resolution)-1. A value of 0 will
* result in the counter remaining at zero.
*
* Return:
* void
*
*******************************************************************************/
void TIMER_ThreadTimer_WritePeriod(uint8 period)
{
#if(TIMER_ThreadTimer_UsingFixedFunction)
uint16 period_temp = (uint16)period;
CY_SET_REG16(TIMER_ThreadTimer_PERIOD_LSB_PTR, period_temp);
#else
CY_SET_REG8(TIMER_ThreadTimer_PERIOD_LSB_PTR, period);
#endif /*Write Period value with appropriate resolution suffix depending on UDB or fixed function implementation */
}
开发者ID:ipeerbhai,项目名称:FollowMe,代码行数:25,代码来源:TIMER_ThreadTimer.c
示例13: Counter_reset_gen_WriteCompare
/*******************************************************************************
* Function Name: Counter_reset_gen_WriteCompare
********************************************************************************
* Summary:
* Changes the compare value. The compare output will
* reflect the new value on the next UDB clock. The compare output will be
* driven high when the present counter value compares true based on the
* configured compare mode setting.
*
* Parameters:
* Compare: New compare value.
*
* Return:
* void
*
*******************************************************************************/
void Counter_reset_gen_WriteCompare(uint8 compare) \
{
#if(Counter_reset_gen_UsingFixedFunction)
CY_SET_REG16(Counter_reset_gen_COMPARE_LSB_PTR, (uint16)compare);
#else
CY_SET_REG8(Counter_reset_gen_COMPARE_LSB_PTR, compare);
#endif /* (Counter_reset_gen_UsingFixedFunction) */
}
开发者ID:betaEncoder,项目名称:PSoC_WS2812Bdriver,代码行数:25,代码来源:Counter_reset_gen.c
示例14: PWM_3_WriteCompare2
/*******************************************************************************
* Function Name: PWM_3_WriteCompare2
********************************************************************************
*
* Summary:
* This funtion is used to change the compare value, for compare1 output.
* The compare output will reflect the new value on the next UDB clock.
* The compare output will be driven high when the present counter value is
* less than or less than or equal to the compare register, depending on the
* mode.
*
* Parameters:
* compare: New compare value.
*
* Return:
* None
*
*******************************************************************************/
void PWM_3_WriteCompare2(uint8 compare) \
{
#if(PWM_3_UsingFixedFunction)
CY_SET_REG16(PWM_3_COMPARE2_LSB_PTR, compare);
#else
CY_SET_REG8(PWM_3_COMPARE2_LSB_PTR, compare);
#endif /* (PWM_3_UsingFixedFunction) */
}
开发者ID:CodingBeagle,项目名称:IHA_3_Semester_Project,代码行数:27,代码来源:PWM_3.c
示例15: PWM_BC_WriteCompare1
/*******************************************************************************
* Function Name: PWM_BC_WriteCompare1
********************************************************************************
*
* Summary:
* This funtion is used to change the compare1 value. The compare output will
* reflect the new value on the next UDB clock. The compare output will be
* driven high when the present counter value is less than or less than or
* equal to the compare register, depending on the mode.
*
* Parameters:
* compare: New compare value.
*
* Return:
* None
*
*******************************************************************************/
void PWM_BC_WriteCompare1(uint8 compare) \
{
#if(PWM_BC_UsingFixedFunction)
CY_SET_REG16(PWM_BC_COMPARE1_LSB_PTR, (uint16)compare);
#else
CY_SET_REG8(PWM_BC_COMPARE1_LSB_PTR, compare);
#endif /* (PWM_BC_UsingFixedFunction) */
}
开发者ID:thurstonzhu,项目名称:ELE302-Carlab,代码行数:26,代码来源:PWM_BC.c
示例16: hallTickCounter_WriteCompare
/*******************************************************************************
* Function Name: hallTickCounter_WriteCompare
********************************************************************************
* Summary:
* Changes the compare value. The compare output will
* reflect the new value on the next UDB clock. The compare output will be
* driven high when the present counter value compares true based on the
* configured compare mode setting.
*
* Parameters:
* Compare: New compare value.
*
* Return:
* void
*
*******************************************************************************/
void hallTickCounter_WriteCompare(uint8 compare) \
{
#if(hallTickCounter_UsingFixedFunction)
CY_SET_REG16(hallTickCounter_COMPARE_LSB_PTR, (uint16)compare);
#else
CY_SET_REG8(hallTickCounter_COMPARE_LSB_PTR, compare);
#endif /* (hallTickCounter_UsingFixedFunction) */
}
开发者ID:cvb0rg,项目名称:PSoC3_TutorialSeries_PIDcontrol,代码行数:25,代码来源:hallTickCounter.c
示例17: pwm_WriteCompare2
/*******************************************************************************
* Function Name: pwm_WriteCompare2
********************************************************************************
*
* Summary:
* This funtion is used to change the compare value, for compare1 output.
* The compare output will reflect the new value on the next UDB clock.
* The compare output will be driven high when the present counter value is
* less than or less than or equal to the compare register, depending on the
* mode.
*
* Parameters:
* compare: New compare value.
*
* Return:
* None
*
*******************************************************************************/
void pwm_WriteCompare2(uint8 compare) \
{
#if(pwm_UsingFixedFunction)
CY_SET_REG16(pwm_COMPARE2_LSB_PTR, compare);
#else
CY_SET_REG8(pwm_COMPARE2_LSB_PTR, compare);
#endif /* (pwm_UsingFixedFunction) */
}
开发者ID:cypresssemiconductorco,项目名称:bleapp,代码行数:27,代码来源:pwm.c
示例18: Timer_2_WriteCounter
/*******************************************************************************
* Function Name: Timer_2_WriteCounter
********************************************************************************
*
* Summary:
* This funtion is used to set the counter to a specific value
*
* Parameters:
* counter: New counter value.
*
* Return:
* void
*
*******************************************************************************/
void Timer_2_WriteCounter(uint8 counter)
{
#if(Timer_2_UsingFixedFunction)
/* This functionality is removed until a FixedFunction HW update to
* allow this register to be written
*/
CY_SET_REG16(Timer_2_COUNTER_LSB_PTR, (uint16)counter);
#else
CY_SET_REG8(Timer_2_COUNTER_LSB_PTR, counter);
#endif /* Set Write Counter only for the UDB implementation (Write Counter not available in fixed function Timer */
}
开发者ID:Insepet,项目名称:GRP700U,代码行数:26,代码来源:Timer_2.c
示例19: pwm_right_WriteDeadTime
/*******************************************************************************
* Function Name: pwm_right_WriteDeadTime
********************************************************************************
*
* Summary:
* This function writes the dead-band counts to the corresponding register
*
* Parameters:
* deadtime: Number of counts for dead time
*
* Return:
* void
*
* Reentrant:
* Yes
*
*******************************************************************************/
void pwm_right_WriteDeadTime(uint8 deadtime)
{
/* If using the Dead Band 1-255 mode then just write the register */
#if(!pwm_right_DeadBand2_4)
CY_SET_REG8(pwm_right_DEADBAND_COUNT_PTR, deadtime);
#else
/* Otherwise the data has to be masked and offset */
/* Clear existing data */
pwm_right_DEADBAND_COUNT &= ~pwm_right_DEADBAND_COUNT_MASK;
/* Set new dead time */
pwm_right_DEADBAND_COUNT |= (deadtime << pwm_right_DEADBAND_COUNT_SHIFT) & pwm_right_DEADBAND_COUNT_MASK;
#endif
}
开发者ID:telemaqueolivier,项目名称:french_robotic_cup,代码行数:30,代码来源:pwm_right.c
示例20: Counter_reset_gen_WriteCounter
/*******************************************************************************
* Function Name: Counter_reset_gen_WriteCounter
********************************************************************************
* Summary:
* This funtion is used to set the counter to a specific value
*
* Parameters:
* counter: New counter value.
*
* Return:
* void
*
*******************************************************************************/
void Counter_reset_gen_WriteCounter(uint8 counter) \
{
#if(Counter_reset_gen_UsingFixedFunction)
/* assert if block is already enabled */
CYASSERT (0u == (Counter_reset_gen_GLOBAL_ENABLE & Counter_reset_gen_BLOCK_EN_MASK));
/* If block is disabled, enable it and then write the counter */
Counter_reset_gen_GLOBAL_ENABLE |= Counter_reset_gen_BLOCK_EN_MASK;
CY_SET_REG16(Counter_reset_gen_COUNTER_LSB_PTR, (uint16)counter);
Counter_reset_gen_GLOBAL_ENABLE &= ((uint8)(~Counter_reset_gen_BLOCK_EN_MASK));
#else
CY_SET_REG8(Counter_reset_gen_COUNTER_LSB_PTR, counter);
#endif /* (Counter_reset_gen_UsingFixedFunction) */
}
开发者ID:betaEncoder,项目名称:PSoC_WS2812Bdriver,代码行数:27,代码来源:Counter_reset_gen.c
注:本文中的CY_SET_REG8函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论