本文整理汇总了C++中CY_SET_REG8函数的典型用法代码示例。如果您正苦于以下问题:C++ CY_SET_REG8函数的具体用法?C++ CY_SET_REG8怎么用?C++ CY_SET_REG8使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CY_SET_REG8函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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) */
}
示例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) */
}
示例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) */
}
示例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) */
}
示例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) */
}
示例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);
}
示例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) */
}
示例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) */
}
示例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);
}
示例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) */
}
示例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) */
}
示例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 */
}
示例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) */
}
示例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) */
}
示例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) */
}