您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ CY_SET_REG8函数代码示例

51自学网 2021-06-01 20:08:35
  C++
这篇教程C++ CY_SET_REG8函数代码示例写得很实用,希望能帮到您。

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

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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


示例21: hallTickCounter_WriteCounter

/******************************************************************************** Function Name: hallTickCounter_WriteCounter********************************************************************************* Summary:*   This funtion is used to set the counter to a specific value** Parameters:  *  counter:  New counter value. ** Return: *  void ********************************************************************************/void hallTickCounter_WriteCounter(uint8 counter) /                                   {    #if(hallTickCounter_UsingFixedFunction)        /* assert if block is already enabled */        CYASSERT (0u == (hallTickCounter_GLOBAL_ENABLE & hallTickCounter_BLOCK_EN_MASK));        /* If block is disabled, enable it and then write the counter */        hallTickCounter_GLOBAL_ENABLE |= hallTickCounter_BLOCK_EN_MASK;        CY_SET_REG16(hallTickCounter_COUNTER_LSB_PTR, (uint16)counter);        hallTickCounter_GLOBAL_ENABLE &= ((uint8)(~hallTickCounter_BLOCK_EN_MASK));    #else        CY_SET_REG8(hallTickCounter_COUNTER_LSB_PTR, counter);    #endif /* (hallTickCounter_UsingFixedFunction) */}
开发者ID:cvb0rg,项目名称:PSoC3_TutorialSeries_PIDcontrol,代码行数:27,


示例22: QuadDecoder_Cnt8_WriteCounter

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


示例23: scsiPhyInit

void scsiPhyInit(){	scsiPhyInitDMA();	SCSI_RST_ISR_StartEx(scsiResetISR);	SCSI_SEL_ISR_StartEx(scsiSelectionISR);	// Disable the glitch filter for ACK to improve performance.	if (scsiDev.boardCfg.flags & CONFIG_DISABLE_GLITCH)	{		SCSI_Glitch_Ctl_Write(1);		CY_SET_REG8(scsiTarget_datapath__D0_REG, 0);	}}
开发者ID:fhgwright,项目名称:SCSI2SD,代码行数:15,


示例24: USB_Bootloader_NoDataControlStatusStage

/******************************************************************************** Function Name: USB_Bootloader_NoDataControlStatusStage********************************************************************************* Summary:*  Handle the Status Stage of a no data control transfer.**  SET_ADDRESS is special, since we need to receive the status stage with*  the old address.** Parameters:*  None.** Return:*  None.** Global variables:*  USB_Bootloader_transferState - set to TRANS_STATE_IDLE.*  USB_Bootloader_ep0Mode  - set to MODE_STALL_IN_OUT.*  USB_Bootloader_ep0Toggle - set to EP0_CNT_DATA_TOGGLE*  USB_Bootloader_deviceAddress - used to set new address and cleared** Reentrant:*  No.********************************************************************************/void USB_Bootloader_NoDataControlStatusStage(void) {    /* Change the USB address register if we got a SET_ADDRESS. */    if (USB_Bootloader_deviceAddress != 0u)    {        CY_SET_REG8(USB_Bootloader_CR0_PTR, USB_Bootloader_deviceAddress | USB_Bootloader_CR0_ENABLE);        USB_Bootloader_deviceAddress = 0u;    }    /* Go Idle */    USB_Bootloader_transferState = USB_Bootloader_TRANS_STATE_IDLE;    /* Update the completion block */    USB_Bootloader_UpdateStatusBlock(USB_Bootloader_XFER_STATUS_ACK);     /* We expect no more data, so stall INs and OUTs */    USB_Bootloader_ep0Mode = USB_Bootloader_MODE_STALL_IN_OUT;}
开发者ID:EmbeditElectronics,项目名称:PiSoC_Bootloader,代码行数:40,


示例25: uart1_putc

int uart1_putc(char c) {	if (c == '/n')		uart1_putc('/r');    while (CY_GET_REG8(CYDEV_ITM_BASE) == 0);    CY_SET_REG8(CYDEV_ITM_BASE,c);#ifndef MINIMALISTIC	// Copy to buffer if there's at least one byte available	// (write ptr is >= readptr or write ptr is < readptr-1)	if((log_ring_write>=log_ring_read) || ((log_ring_write<(log_ring_read-1)) && (log_ring_read!=0))) {		log_ring[log_ring_write]=c;		log_ring_write++;		if(log_ring_write==LOGRINGSIZE) log_ring_write=0;	}#endif	return 0;}
开发者ID:armae,项目名称:CDB-Assist,代码行数:16,


示例26: PWM_3_WriteDeadTime

    /*******************************************************************************    * Function Name: PWM_3_WriteDeadTime    ********************************************************************************    *    * Summary:    *  This function writes the dead-band counts to the corresponding register    *    * Parameters:    *  deadtime:  Number of counts for dead time    *    * Return:    *  None    *    *******************************************************************************/    void PWM_3_WriteDeadTime(uint8 deadtime)     {        /* If using the Dead Band 1-255 mode then just write the register */        #if(!PWM_3_DeadBand2_4)            CY_SET_REG8(PWM_3_DEADBAND_COUNT_PTR, deadtime);        #else            /* Otherwise the data has to be masked and offset */            /* Clear existing data */            PWM_3_DEADBAND_COUNT &= ((uint8)(~PWM_3_DEADBAND_COUNT_MASK));            /* Set new dead time */            #if(PWM_3_DEADBAND_COUNT_SHIFT)                PWM_3_DEADBAND_COUNT |= ((uint8)((uint8)deadtime << PWM_3_DEADBAND_COUNT_SHIFT)) &                                                    PWM_3_DEADBAND_COUNT_MASK;            #else                PWM_3_DEADBAND_COUNT |= deadtime & PWM_3_DEADBAND_COUNT_MASK;            #endif /* (PWM_3_DEADBAND_COUNT_SHIFT) */        #endif /* (!PWM_3_DeadBand2_4) */    }
开发者ID:CodingBeagle,项目名称:IHA_3_Semester_Project,代码行数:34,


示例27: USB_Bootloader_HandleSetup

/******************************************************************************** Function Name: USB_Bootloader_HandleSetup********************************************************************************** Summary:*  This Routine dispatches requests for the four USB request types** Parameters:*  None.** Return:*  None.** Reentrant:*  No.********************************************************************************/void USB_Bootloader_HandleSetup(void) {    uint8 requestHandled;    requestHandled = CY_GET_REG8(USB_Bootloader_EP0_CR_PTR);      /* unlock registers */    CY_SET_REG8(USB_Bootloader_EP0_CR_PTR, requestHandled);       /* clear setup bit */    requestHandled = CY_GET_REG8(USB_Bootloader_EP0_CR_PTR);      /* reread register */    if((requestHandled & USB_Bootloader_MODE_SETUP_RCVD) != 0u)    {        USB_Bootloader_ep0Mode = requestHandled;        /* if SETUP bit set -> exit without modifying the mode */    }    else    {        /* In case the previous transfer did not complete, close it out */        USB_Bootloader_UpdateStatusBlock(USB_Bootloader_XFER_PREMATURE);        switch (CY_GET_REG8(USB_Bootloader_bmRequestType) & USB_Bootloader_RQST_TYPE_MASK)        {            case USB_Bootloader_RQST_TYPE_STD:                requestHandled = USB_Bootloader_HandleStandardRqst();                break;            case USB_Bootloader_RQST_TYPE_CLS:                requestHandled = USB_Bootloader_DispatchClassRqst();                break;            case USB_Bootloader_RQST_TYPE_VND:                requestHandled = USB_Bootloader_HandleVendorRqst();                break;            default:                requestHandled = USB_Bootloader_FALSE;                break;        }        if (requestHandled == USB_Bootloader_FALSE)        {            USB_Bootloader_ep0Mode = USB_Bootloader_MODE_STALL_IN_OUT;        }    }}
开发者ID:EmbeditElectronics,项目名称:PiSoC_Bootloader,代码行数:54,


示例28: USB_Bootloader_LoadEP0

/******************************************************************************** Function Name: USB_Bootloader_LoadEP0********************************************************************************** Summary:*  This routine loads the EP0 data registers for OUT transfers.  It uses the*  currentTD (previously initialized by the _InitControlWrite function and*  updated for each OUT transfer, and the bLastPacketSize) to determine how*  many uint8s to transfer on the current OUT.**  If the number of uint8s remaining is zero and the last transfer was full,*  we need to send a zero length packet.  Otherwise we send the minimum*  of the control endpoint size (8) or remaining number of uint8s for the*  transaction.** Parameters:*  None.** Return:*  None.** Global variables:*  USB_Bootloader_transferByteCount - Update the transfer byte count from the*     last transaction.*  USB_Bootloader_ep0Count - counts the data loaded to the SIE memory in*     current packet.*  USB_Bootloader_lastPacketSize - remembers the USBFS_ep0Count value for the*     next packet.*  USB_Bootloader_transferByteCount - sum of the previous bytes transferred*     on previous packets(sum of USBFS_lastPacketSize)*  USB_Bootloader_ep0Toggle - inverted*  USB_Bootloader_ep0Mode  - prepare for mode register content.*  USB_Bootloader_transferState - set to TRANS_STATE_CONTROL_READ** Reentrant:*  No.********************************************************************************/void USB_Bootloader_LoadEP0(void) {    uint8 ep0Count = 0u;    /* Update the transfer byte count from the last transaction */    USB_Bootloader_transferByteCount += USB_Bootloader_lastPacketSize;    /* Now load the next transaction */    while ((USB_Bootloader_currentTD.count > 0u) && (ep0Count < 8u))    {        CY_SET_REG8((reg8 *)(USB_Bootloader_EP0_DR0_IND + ep0Count), *USB_Bootloader_currentTD.pData);        USB_Bootloader_currentTD.pData = &USB_Bootloader_currentTD.pData[1u];        ep0Count++;        USB_Bootloader_currentTD.count--;    }    /* Support zero-length packet*/    if( (USB_Bootloader_lastPacketSize == 8u) || (ep0Count > 0u) )    {        /* Update the data toggle */        USB_Bootloader_ep0Toggle ^= USB_Bootloader_EP0_CNT_DATA_TOGGLE;        /* Set the Mode Register  */        USB_Bootloader_ep0Mode = USB_Bootloader_MODE_ACK_IN_STATUS_OUT;        /* Update the state (or stay the same) */        USB_Bootloader_transferState = USB_Bootloader_TRANS_STATE_CONTROL_READ;    }    else    {        /* Expect Status Stage Out */        USB_Bootloader_ep0Mode = USB_Bootloader_MODE_STATUS_OUT_ONLY;        /* Update the state (or stay the same) */        USB_Bootloader_transferState = USB_Bootloader_TRANS_STATE_CONTROL_READ;    }    /* Save the packet size for next time */    USB_Bootloader_lastPacketSize = ep0Count;    USB_Bootloader_ep0Count = ep0Count;}
开发者ID:EmbeditElectronics,项目名称:PiSoC_Bootloader,代码行数:74,


示例29: PWM_3_WriteKillTime

 /******************************************************************************* * Function Name: PWM_3_WriteKillTime ******************************************************************************** * * Summary: *  Writes the kill time value used by the hardware when the Kill Mode *  is set to Minimum Time. * * Parameters: *  uint8: Minimum Time kill counts * * Return: *  None * *******************************************************************************/ void PWM_3_WriteKillTime(uint8 killtime)  {     CY_SET_REG8(PWM_3_KILLMODEMINTIME_PTR, killtime); }
开发者ID:CodingBeagle,项目名称:IHA_3_Semester_Project,代码行数:19,


示例30: PWM_3_WriteControlRegister

 /******************************************************************************* * Function Name: PWM_3_WriteControlRegister ******************************************************************************** * * Summary: *  Sets the bit field of the control register. This API is available only if *  the control register is not removed. * * Parameters: *  uint8 control: Control register bit field, The status register bits are: *  [7]   : PWM Enable *  [6]   : Reset *  [5:3] : Compare Mode2 *  [2:0] : Compare Mode2 * * Return: *  None * *******************************************************************************/ void PWM_3_WriteControlRegister(uint8 control)  {     CY_SET_REG8(PWM_3_CONTROL_PTR, control); }
开发者ID:CodingBeagle,项目名称:IHA_3_Semester_Project,代码行数:23,



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


C++ CY_SET_XTND_REG8函数代码示例
C++ CY_SET_REG32函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。