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

C++ CY_SET_REG16函数代码示例

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

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



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

示例1: ShiftReg_1_RestoreConfig

/*******************************************************************************
* Function Name: ShiftReg_1_RestoreConfig
********************************************************************************
*
* Summary:
*  Restores Shift Register configuration.
*
* Parameters:
*  None.
*
* Return:
*  None.
*
*******************************************************************************/
void ShiftReg_1_RestoreConfig(void) 
{
    /* Restore tha data, saved by SaveConfig()function */
    #if (CY_PSOC3_ES2 || CY_PSOC5_ES1)
        CY_SET_REG16(ShiftReg_1_SHIFT_REG_LSB_PTR, ShiftReg_1_backup.saveSrA0Reg);
            CY_SET_REG16(ShiftReg_1_SHIFT_REG_VALUE_LSB_PTR, ShiftReg_1_backup.saveSrA1Reg);
            ShiftReg_1_SR_STATUS_MASK = ShiftReg_1_backup.saveSrIntMask;
    #else
            CY_SET_REG16(ShiftReg_1_SHIFT_REG_LSB_PTR, ShiftReg_1_backup.saveSrA0Reg);
            CY_SET_REG16(ShiftReg_1_SHIFT_REG_VALUE_LSB_PTR, ShiftReg_1_backup.saveSrA1Reg);

    #endif /*(CY_PSOC3_ES2 || CY_PSOC5_ES1)*/
}
开发者ID:marcelocoelho,项目名称:Pulse-Firmware,代码行数:27,代码来源:ShiftReg_1_PM.c


示例2: Timer_3_WriteCounter

/*******************************************************************************
* Function Name: Timer_3_WriteCounter
********************************************************************************
*
* Summary:
*  This funtion is used to set the counter to a specific value
*
* Parameters:
*  counter:  New counter value.
*
* Return:
*  void
*
*******************************************************************************/
void Timer_3_WriteCounter(uint16 counter) \
                                   
{
   #if(Timer_3_UsingFixedFunction)
        /* This functionality is removed until a FixedFunction HW update to
         * allow this register to be written
         */
        CY_SET_REG16(Timer_3_COUNTER_LSB_PTR, (uint16)counter);
        
    #else
        CY_SET_REG16(Timer_3_COUNTER_LSB_PTR, counter);
    #endif /* Set Write Counter only for the UDB implementation (Write Counter not available in fixed function Timer */
}
开发者ID:proyectos1Insepet,项目名称:MUX,代码行数:27,代码来源:Timer_3.c


示例3: PWM_Counter_WriteCounter

/*******************************************************************************
* Function Name: PWM_Counter_WriteCounter
********************************************************************************
* Summary:
*   This funtion is used to set the counter to a specific value
*
* Parameters:  
*  counter:  New counter value. 
*
* Return: 
*  void 
*
*******************************************************************************/
void PWM_Counter_WriteCounter(uint16 counter) \
                                   
{
    #if(PWM_Counter_UsingFixedFunction)
        /* assert if block is already enabled */
        CYASSERT (!(PWM_Counter_GLOBAL_ENABLE & PWM_Counter_BLOCK_EN_MASK));
        /* If block is disabled, enable it and then write the counter */
        PWM_Counter_GLOBAL_ENABLE |= PWM_Counter_BLOCK_EN_MASK;
        CY_SET_REG16(PWM_Counter_COUNTER_LSB_PTR, (uint16)counter);
        PWM_Counter_GLOBAL_ENABLE &= ~PWM_Counter_BLOCK_EN_MASK;
    #else
        CY_SET_REG16(PWM_Counter_COUNTER_LSB_PTR, counter);
    #endif /* (PWM_Counter_UsingFixedFunction) */
}
开发者ID:kelime,项目名称:lab-of-cars,代码行数:27,代码来源:PWM_Counter.c


示例4: QuadDecoder_Cnt16_WriteCounter

/*******************************************************************************
* Function Name: QuadDecoder_Cnt16_WriteCounter
********************************************************************************
* Summary:
*   This funtion is used to set the counter to a specific value
*
* Parameters:  
*  counter:  New counter value. 
*
* Return: 
*  void 
*
*******************************************************************************/
void QuadDecoder_Cnt16_WriteCounter(uint16 counter) \
                                   
{
    #if(QuadDecoder_Cnt16_UsingFixedFunction)
        /* assert if block is already enabled */
        CYASSERT (0u == (QuadDecoder_Cnt16_GLOBAL_ENABLE & QuadDecoder_Cnt16_BLOCK_EN_MASK));
        /* If block is disabled, enable it and then write the counter */
        QuadDecoder_Cnt16_GLOBAL_ENABLE |= QuadDecoder_Cnt16_BLOCK_EN_MASK;
        CY_SET_REG16(QuadDecoder_Cnt16_COUNTER_LSB_PTR, (uint16)counter);
        QuadDecoder_Cnt16_GLOBAL_ENABLE &= ((uint8)(~QuadDecoder_Cnt16_BLOCK_EN_MASK));
    #else
        CY_SET_REG16(QuadDecoder_Cnt16_COUNTER_LSB_PTR, counter);
    #endif /* (QuadDecoder_Cnt16_UsingFixedFunction) */
}
开发者ID:Qmax,项目名称:PT6,代码行数:27,代码来源:QuadDecoder_Cnt16.c


示例5: Counter_1_WriteCounter

/*******************************************************************************
* Function Name: Counter_1_WriteCounter
********************************************************************************
* Summary:
*   This funtion is used to set the counter to a specific value
*
* Parameters:  
*  counter:  New counter value. 
*
* Return: 
*  void 
*
*******************************************************************************/
void Counter_1_WriteCounter(uint16 counter) \
                                   
{
    #if(Counter_1_UsingFixedFunction)
        /* assert if block is already enabled */
        CYASSERT (0u == (Counter_1_GLOBAL_ENABLE & Counter_1_BLOCK_EN_MASK));
        /* If block is disabled, enable it and then write the counter */
        Counter_1_GLOBAL_ENABLE |= Counter_1_BLOCK_EN_MASK;
        CY_SET_REG16(Counter_1_COUNTER_LSB_PTR, (uint16)counter);
        Counter_1_GLOBAL_ENABLE &= ((uint8)(~Counter_1_BLOCK_EN_MASK));
    #else
        CY_SET_REG16(Counter_1_COUNTER_LSB_PTR, counter);
    #endif /* (Counter_1_UsingFixedFunction) */
}
开发者ID:scarlso,项目名称:LED_controller,代码行数:27,代码来源:Counter_1.c


示例6: HeartbeatCounter_WritePeriod

/*******************************************************************************
* Function Name: HeartbeatCounter_WritePeriod
********************************************************************************
* Summary:
* Changes the period of the counter.  The new period 
* will be loaded the next time terminal count is detected.
*
* Parameters:  
*  period: (uint32) A value of 0 will result in
*         the counter remaining at zero.  
*
* Return: 
*  void
*
*******************************************************************************/
void HeartbeatCounter_WritePeriod(uint32 period) 
{
    #if(HeartbeatCounter_UsingFixedFunction)
        CY_SET_REG16(HeartbeatCounter_PERIOD_LSB_PTR,(uint16)period);
    #else
        CY_SET_REG32(HeartbeatCounter_PERIOD_LSB_PTR, period);
    #endif /* (HeartbeatCounter_UsingFixedFunction) */
}
开发者ID:ponioj,项目名称:embedded,代码行数:23,代码来源:HeartbeatCounter.c


示例7: 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


示例8: 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


示例9: hallTickCounter_WritePeriod

/*******************************************************************************
* Function Name: hallTickCounter_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 hallTickCounter_WritePeriod(uint8 period) 
{
    #if(hallTickCounter_UsingFixedFunction)
        CY_SET_REG16(hallTickCounter_PERIOD_LSB_PTR,(uint16)period);
    #else
        CY_SET_REG8(hallTickCounter_PERIOD_LSB_PTR, period);
    #endif /* (hallTickCounter_UsingFixedFunction) */
}
开发者ID:cvb0rg,项目名称:PSoC3_TutorialSeries_PIDcontrol,代码行数:23,代码来源:hallTickCounter.c


示例10: 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: 
*  void
*
* Reentrant:
*  Yes
*
*******************************************************************************/
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
}
开发者ID:thurstonzhu,项目名称:ELE302-Carlab,代码行数:29,代码来源:PWM.c


示例11: MotorPWM_WritePeriod

/*******************************************************************************
* Function Name: MotorPWM_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 MotorPWM_WritePeriod(uint8 period) 
{
    #if(MotorPWM_UsingFixedFunction)
        CY_SET_REG16(MotorPWM_PERIOD_LSB_PTR, (uint16)period);
    #else
        CY_SET_REG8(MotorPWM_PERIOD_LSB_PTR, period);
    #endif /* (MotorPWM_UsingFixedFunction) */
}
开发者ID:eamsuwan93,项目名称:PSoC-4-Compass-Sensor,代码行数:24,代码来源:MotorPWM.c


示例12: PWM_3_WritePeriod

/*******************************************************************************
* Function Name: PWM_3_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_3_WritePeriod(uint8 period) 
{
    #if(PWM_3_UsingFixedFunction)
        CY_SET_REG16(PWM_3_PERIOD_LSB_PTR, (uint16)period);
    #else
        CY_SET_REG8(PWM_3_PERIOD_LSB_PTR, period);
    #endif /* (PWM_3_UsingFixedFunction) */
}
开发者ID:CodingBeagle,项目名称:IHA_3_Semester_Project,代码行数:24,代码来源:PWM_3.c


示例13: CsBtns_PWM_WriteCompare

    /*******************************************************************************
    * Function Name: CsBtns_PWM_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 CsBtns_PWM_WriteCompare(uint16 compare) \
                                       
    {
        #if(CsBtns_PWM_UsingFixedFunction)
            CY_SET_REG16(CsBtns_PWM_COMPARE1_LSB_PTR, (uint16)compare);
        #else
            CY_SET_REG16(CsBtns_PWM_COMPARE1_LSB_PTR, compare);
        #endif /* (CsBtns_PWM_UsingFixedFunction) */

        #if (CsBtns_PWM_PWMMode == CsBtns_PWM__B_PWM__DITHER)
            #if(CsBtns_PWM_UsingFixedFunction)
                CY_SET_REG16(CsBtns_PWM_COMPARE2_LSB_PTR, (uint16)(compare + 1u));
            #else
                CY_SET_REG16(CsBtns_PWM_COMPARE2_LSB_PTR, (compare + 1u));
            #endif /* (CsBtns_PWM_UsingFixedFunction) */
        #endif /* (CsBtns_PWM_PWMMode == CsBtns_PWM__B_PWM__DITHER) */
    }
开发者ID:jh247247,项目名称:ECE3091-chickybot,代码行数:39,代码来源:CsBtns_PWM.c


示例14: Phase_Counter_WritePeriod

/*******************************************************************************
* Function Name: Phase_Counter_WritePeriod
********************************************************************************
* Summary:
* Changes the period of the counter.  The new period 
* will be loaded the next time terminal count is detected.
*
* Parameters:  
*  period: (uint32) A value of 0 will result in
*         the counter remaining at zero.  
*
* Return: 
*  void
*
*******************************************************************************/
void Phase_Counter_WritePeriod(uint32 period) 
{
    #if(Phase_Counter_UsingFixedFunction)
        CY_SET_REG16(Phase_Counter_PERIOD_LSB_PTR,(uint16)period);
    #else
        CY_SET_REG32(Phase_Counter_PERIOD_LSB_PTR, period);
    #endif /* (Phase_Counter_UsingFixedFunction) */
}
开发者ID:tslator,项目名称:DualBoard-043,代码行数:23,代码来源:Phase_Counter.c


示例15: 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:cypresssemiconductorco,项目名称:bleapp,代码行数:24,代码来源:pwm.c


示例16: PWM_3_WriteCompare

    /*******************************************************************************
    * Function Name: PWM_3_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_3_WriteCompare(uint8 compare) \
                                       
    {
        #if(PWM_3_UsingFixedFunction)
            CY_SET_REG16(PWM_3_COMPARE1_LSB_PTR, (uint16)compare);
        #else
            CY_SET_REG8(PWM_3_COMPARE1_LSB_PTR, compare);
        #endif /* (PWM_3_UsingFixedFunction) */

        #if (PWM_3_PWMMode == PWM_3__B_PWM__DITHER)
            #if(PWM_3_UsingFixedFunction)
                CY_SET_REG16(PWM_3_COMPARE2_LSB_PTR, (uint16)(compare + 1u));
            #else
                CY_SET_REG8(PWM_3_COMPARE2_LSB_PTR, (compare + 1u));
            #endif /* (PWM_3_UsingFixedFunction) */
        #endif /* (PWM_3_PWMMode == PWM_3__B_PWM__DITHER) */
    }
开发者ID:CodingBeagle,项目名称:IHA_3_Semester_Project,代码行数:39,代码来源:PWM_3.c


示例17: Counter_reset_gen_WritePeriod

/*******************************************************************************
* Function Name: Counter_reset_gen_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 Counter_reset_gen_WritePeriod(uint8 period) 
{
    #if(Counter_reset_gen_UsingFixedFunction)
        CY_SET_REG16(Counter_reset_gen_PERIOD_LSB_PTR,(uint16)period);
    #else
        CY_SET_REG8(Counter_reset_gen_PERIOD_LSB_PTR, period);
    #endif /* (Counter_reset_gen_UsingFixedFunction) */
}
开发者ID:betaEncoder,项目名称:PSoC_WS2812Bdriver,代码行数:23,代码来源:Counter_reset_gen.c


示例18: 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


示例19: PWM_WriteCounter

/*******************************************************************************
* Function Name: PWM_WriteCounter
********************************************************************************
* 
* Summary:
*  This function is used to change the counter value.
*
* Parameters:  
*  counter:  This value may be between 1 and (2^Resolution)-1.   
*
* Return: 
*  void
*
* Reentrant:
*  Yes
*
*******************************************************************************/
void PWM_WriteCounter(uint8 counter) 
{
    #if(PWM_UsingFixedFunction)
        CY_SET_REG16(PWM_COUNTER_LSB_PTR, (uint16)counter);
    #else
        CY_SET_REG8(PWM_COUNTER_LSB_PTR, counter);
    #endif
}
开发者ID:thurstonzhu,项目名称:ELE302-Carlab,代码行数:25,代码来源:PWM.c


示例20: Phase_Counter_WriteCompare

/*******************************************************************************
* Function Name: Phase_Counter_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 Phase_Counter_WriteCompare(uint32 compare) \
                                   
{
    #if(Phase_Counter_UsingFixedFunction)
        CY_SET_REG16(Phase_Counter_COMPARE_LSB_PTR, (uint16)compare);
    #else
        CY_SET_REG32(Phase_Counter_COMPARE_LSB_PTR, compare);
    #endif /* (Phase_Counter_UsingFixedFunction) */
}
开发者ID:tslator,项目名称:DualBoard-043,代码行数:25,代码来源:Phase_Counter.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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