當前位置: 首頁>>代碼示例>>C++>>正文


C++ CY_GET_REG8函數代碼示例

本文整理匯總了C++中CY_GET_REG8函數的典型用法代碼示例。如果您正苦於以下問題:C++ CY_GET_REG8函數的具體用法?C++ CY_GET_REG8怎麽用?C++ CY_GET_REG8使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了CY_GET_REG8函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: ServiceUSB


//.........這裏部分代碼省略.........
            USBFS_MIDI_IN_EP_Service();
        }
    }
    else
    {
        midiInWaitTimer = MIDI_IN_EP_WAIT_TIME;
    }
    #endif
        
    /* USBFS_IsConfigurationChanged() is a clear on read status update therefore, only one read of 
     * USBFS_IsConfigurationChanged() should ever exist in user code */
    if(USBFS_IsConfigurationChanged())
    {
        macPC_flag = IsMacPCConnected();
		#ifndef ENABLE_DIGITAL_AUDIO_IN_ONLY    
        
        /* Get Alternate setting */
        altSetting[AUDIO_OUT_INTERFACE_INDEX] = (macPC_flag? USBFS_GetInterfaceSetting(1):USBFS_GetInterfaceSetting(2)); 
        
        /* ByteSwap control register bit is set to 1 if alt setting 2 is selected so that  
         * Byte swap digital logic processes data as 16 bits. ByteSwap control register is set to 0 
         * if alt setting 1 is selected and byte swap processes data as 24 bits */
        if (altSetting[AUDIO_OUT_INTERFACE_INDEX]==ALT_SETTING_ACTIVE_24_BIT)
        {
            ByteSwap_Tx_CONTROL_REG = ByteSwap_Tx_CONTROL_REG & (~ByteSwap_Tx_RES_CTRL_16);  
        }
        else if (altSetting[AUDIO_OUT_INTERFACE_INDEX]==ALT_SETTING_ACTIVE_16_BIT)
        {
            ByteSwap_Tx_CONTROL_REG = ByteSwap_Tx_CONTROL_REG | ByteSwap_Tx_RES_CTRL_16;            
        }
        
        /* Arming the audio out EP if it is not zero bandwidth alt setting */
        if (altSetting[AUDIO_OUT_INTERFACE_INDEX]!= ALT_SETTING_ZERO_BANDWIDTH && 
            (CY_GET_REG8(USBFS_SIE_EP1_CR0_PTR + ((AUDIO_OUT_ENDPOINT - USBFS_EP1) << USBFS_EPX_CNTX_ADDR_SHIFT)) & USBFS_MODE_MASK) 
                                                                                    == USBFS_MODE_NAK_IN_OUT)
        {
            /* Init DMA configurations for audio OUT EP */
            USBFS_ReadOutEP(AUDIO_OUT_ENDPOINT, &outRam[0], OUT_AUDIOMAXPKT);
            USBFS_EnableOutEP(AUDIO_OUT_ENDPOINT);
        }
        #endif
        
        #ifndef ENABLE_DIGITAL_AUDIO_OUT_ONLY
            #ifndef ENABLE_DIGITAL_AUDIO_IN_ONLY 
            if(altSetting[AUDIO_IN_INTERFACE_INDEX] != (macPC_flag? USBFS_GetInterfaceSetting(2):USBFS_GetInterfaceSetting(3)))
        {
                  altSetting[AUDIO_IN_INTERFACE_INDEX] = (macPC_flag? USBFS_GetInterfaceSetting(2):USBFS_GetInterfaceSetting(3));
            #else
            if(altSetting[AUDIO_IN_INTERFACE_INDEX] != (macPC_flag? USBFS_GetInterfaceSetting(1):USBFS_GetInterfaceSetting(2)))
        {
                  altSetting[AUDIO_IN_INTERFACE_INDEX] = (macPC_flag? USBFS_GetInterfaceSetting(1):USBFS_GetInterfaceSetting(2));
            #endif
            
            /* Setting the ByteSwap control register bit to 0 regardless of alt setting is selected. Because audio in 
            *  interface both the alternate settings alt setting1 and alt setting 2 both use 3 byte subframe size. */            
            ByteSwap_Rx_CONTROL_REG = ByteSwap_Rx_CONTROL_REG & (~ByteSwap_Rx_RES_CTRL_16); 
            
            /* Arming the audio in EP if it is not zero bandwidth alt setting */
            if (altSetting[AUDIO_IN_INTERFACE_INDEX]!= ALT_SETTING_ZERO_BANDWIDTH &&
                (CY_GET_REG8(USBFS_SIE_EP1_CR0_PTR + ((AUDIO_IN_ENDPOINT - USBFS_EP1) << USBFS_EPX_CNTX_ADDR_SHIFT)) & USBFS_MODE_MASK) 
                                                                                        == USBFS_MODE_NAK_IN_OUT)
            {
                /* Init DMA configurations for audio IN EP */  
                inCnt = IN_AUDIOMAXPKT;
                USBFS_LoadInEP(AUDIO_IN_ENDPOINT, &inRam[0], inCnt);
                /* Pre-arm first audio IN request */
開發者ID:yourskp,項目名稱:USB_Audio,代碼行數:67,代碼來源:USBInterface.c

示例2: PWM_3_ReadStatusRegister

 /*******************************************************************************
 * Function Name: PWM_3_ReadStatusRegister
 ********************************************************************************
 *
 * Summary:
 *  This function returns the current state of the status register.
 *
 * Parameters:
 *  None
 *
 * Return:
 *  uint8 : Current status register value. The status register bits are:
 *  [7:6] : Unused(0)
 *  [5]   : Kill event output
 *  [4]   : FIFO not empty
 *  [3]   : FIFO full
 *  [2]   : Terminal count
 *  [1]   : Compare output 2
 *  [0]   : Compare output 1
 *
 *******************************************************************************/
 uint8 PWM_3_ReadStatusRegister(void) 
 {
     return (CY_GET_REG8(PWM_3_STATUS_PTR));
 }
開發者ID:CodingBeagle,項目名稱:IHA_3_Semester_Project,代碼行數:25,代碼來源:PWM_3.c

示例3: PWM_3_ReadCompare2

 /*******************************************************************************
 * Function Name: PWM_3_ReadCompare2
 ********************************************************************************
 *
 * Summary:
 *  Reads the compare value for the compare2 output.
 *
 * Parameters:
 *  None
 *
 * Return:
 *  uint8/uint16: Current compare value.
 *
 *******************************************************************************/
 uint8 PWM_3_ReadCompare2(void) 
 {
     return (CY_GET_REG8(PWM_3_COMPARE2_LSB_PTR));
 }
開發者ID:CodingBeagle,項目名稱:IHA_3_Semester_Project,代碼行數:18,代碼來源:PWM_3.c

示例4: PrISM_2_ReadSeed

/*******************************************************************************
* FUNCTION NAME:   PrISM_2_ReadSeed
********************************************************************************
*
* Summary:
*  Reads the PrISM Seed register.
*
* Parameters:
*  None.
*
* Return:
*  Current Period register value.
*
*******************************************************************************/
uint8 PrISM_2_ReadSeed(void) 
{
    return( CY_GET_REG8(PrISM_2_SEED_PTR) );
}
開發者ID:Burn2539,項目名稱:CoRo_PW_PSOC,代碼行數:18,代碼來源:PrISM_2.c

示例5: PrISM_2_ReadPulse1

/*******************************************************************************
* FUNCTION NAME:   PrISM_2_ReadPulse1
********************************************************************************
*
* Summary:
*  Reads the PrISM Pulse Density1 register.
*
* Parameters:
*  None.
*
* Return:
*  Pulse Density1 register value.
*
*******************************************************************************/
uint8 PrISM_2_ReadPulse1(void) 
{
    return( CY_GET_REG8(PrISM_2_DENSITY1_PTR) );
}
開發者ID:Burn2539,項目名稱:CoRo_PW_PSOC,代碼行數:18,代碼來源:PrISM_2.c

示例6: pwm_ReadKillTime

/*******************************************************************************
* Function Name: pwm_ReadKillTime
********************************************************************************
*
* Summary:
*  Reads the kill time value used by the hardware when the Kill Mode is set
*  to Minimum Time.
*
* Parameters:
*  None
*
* Return:
*  uint8: The current Minimum Time kill counts
*
*******************************************************************************/
uint8 pwm_ReadKillTime(void)
{
    return (CY_GET_REG8(pwm_KILLMODEMINTIME_PTR));
}
開發者ID:cypresssemiconductorco,項目名稱:bleapp,代碼行數:19,代碼來源:pwm.c

示例7: RedGreenPrISM_ReadPolynomial

/*******************************************************************************
* FUNCTION NAME:   RedGreenPrISM_ReadPolynomial
********************************************************************************
*
* Summary:
*  Reads the PrISM polynomial.
*
* Parameters:
*  None.
*
* Return:
*  PrISM polynomial.
*
*******************************************************************************/
uint8 RedGreenPrISM_ReadPolynomial(void)
{
    return( CY_GET_REG8(RedGreenPrISM_POLYNOM_PTR) );
}
開發者ID:danielpi,項目名稱:PSoC-4-BLE-Experiments,代碼行數:18,代碼來源:RedGreenPrISM.c

示例8: PWM_BC_ReadCompare1

    /*******************************************************************************
    * Function Name: PWM_BC_ReadCompare1
    ********************************************************************************
    * 
    * Summary:
    *  Reads the compare value for the compare1 output.
    *
    * Parameters:  
    *  None
    *
    * Return: 
    *  uint8/uint16: Current compare value.
    *
    *******************************************************************************/  
    uint8 PWM_BC_ReadCompare1(void) 
    {
		return (CY_GET_REG8(PWM_BC_COMPARE1_LSB_PTR));
    }
開發者ID:thurstonzhu,項目名稱:ELE302-Carlab,代碼行數:18,代碼來源:PWM_BC.c

示例9: MainTimer_SoftwareCapture

/*******************************************************************************
* Function Name: MainTimer_SoftwareCapture
********************************************************************************
*
* Summary:
*  This function forces a capture independent of the capture signal.
*
* Parameters:
*  void
*
* Return:
*  void
*
* Side Effects:
*  An existing hardware capture could be overwritten.
*
* Reentrant
*  Yes
*
*******************************************************************************/
void MainTimer_SoftwareCapture(void) 
{
    /* Generate a software capture by reading the counter register */
    CY_GET_REG8(MainTimer_COUNTER_LSB_PTR);
    /* Capture Data is now in the FIFO */
}
開發者ID:nadavofir,項目名稱:IGVC2013,代碼行數:26,代碼來源:MainTimer.c

示例10: hallTickCounter_ReadCompare

/*******************************************************************************
* Function Name: hallTickCounter_ReadCompare
********************************************************************************
* Summary:
* Returns the compare value.
*
* Parameters:  
*  void:
*
* Return: 
*  (uint8) Present compare value.
*
*******************************************************************************/
uint8 hallTickCounter_ReadCompare(void) 
{
    return (CY_GET_REG8(hallTickCounter_COMPARE_LSB_PTR));
}
開發者ID:cvb0rg,項目名稱:PSoC3_TutorialSeries_PIDcontrol,代碼行數:17,代碼來源:hallTickCounter.c

示例11: main


//.........這裏部分代碼省略.........
#ifdef SPECIAL_EDITION
    disp_str("Calibration Edition",19,(64-57),64-6,FONT6X6);
#else
    disp_str("Open Devices",12,(64-36),64-6,FONT6X6);
#endif
    FB_update();
    
    GPIO_Init();
    DummyLoad_Init();
    USBMux_Init();
    I2C_Init();
    PWM_Init();
    ADC_Init();
    
    uint16_t ctr=0;
    
    for(;;)
    {
        char buffah[22];
        uint8_t num;
        float vbatvolt,vbatcur,vbusvolt,vbuscur;
        
        I2C_Work();
        vbatvolt=(float)I2C_Get_VBAT_VoltAvg() * 0.001f;
        vbatcur=I2C_Get_VBAT_CurAvg();

        PWM_Work(I2C_Get_VBAT_Volt(),I2C_Get_VBAT_CurRaw());
        DummyLoad_Work(I2C_Get_VBAT_Volt());
        
        ADC_Work();
        uint8_t vrefok = ADC_VtargetValid();
        static uint8_t oldvrefok = 2;
        
        if( vrefok != oldvrefok ) {
            if( vrefok ) {
                CyPins_ClearPin(LED_Vref_0);
                GPIO_SetTXDrive( 1 );
            } else {
                CyPins_SetPin(LED_Vref_0);
                GPIO_SetTXDrive( 0 );
                SIORefGen_SetValue(62); // Default 1V ref
            }
            oldvrefok = vrefok;
        }

        if(ctr == 0) {
            vbusvolt=(float)I2C_Get_VBUS_Volt() * 0.001f;
            vbuscur=I2C_Get_VBUS_Cur();
            USBMux_UpdateMeasurements(vbusvolt,vbuscur);
            
            num = snprintf(buffah, sizeof(buffah), "VBAT %5.2fV %6.1fmA", vbatvolt,vbatcur);
            disp_str(buffah, num, 0, 8, FONT6X6);

            num = snprintf(buffah, sizeof(buffah), "VBUS %5.2fV %6.1fmA", vbusvolt,vbuscur);
            disp_str(buffah, num, 0, 8+6, FONT6X6);

            DummyLoad_ADCWork();
            float loadcur = DummyLoad_GetCur();
            float loadtemp = DummyLoad_GetTemp();
            num = snprintf(buffah, sizeof(buffah), "Load %5.1f` %6.1fmA", loadtemp,loadcur);
            disp_str(buffah, num, 0, 8+12, FONT6X6);

            float tmp = ADC_GetVoltage(VBATSENSE);
            num = snprintf(buffah, sizeof(buffah), "VBAT %5.2fV", tmp);
            disp_str(buffah, num, 0, 8+18, FONT6X6);

            tmp = ADC_GetVoltage(USB2SENSE);
            num = snprintf(buffah, sizeof(buffah), "USB2 %5.2fV", tmp);
            disp_str(buffah, num, 0, 8+24, FONT6X6);

            tmp = ADC_GetVoltage(USB3SENSE);
            num = snprintf(buffah, sizeof(buffah), "USB3 %5.2fV", tmp);
            disp_str(buffah, num, 0, 8+30, FONT6X6);

            tmp = ADC_GetVoltage(VTARGETSENSE);
            if( tmp > 4.5f ) { // Assume 5V, disable regulated output
                CY_SET_REG8(DTMS__SIO_CFG, (CY_GET_REG8(DTMS__SIO_CFG) & 0xcf) | 0x20);
                CY_SET_REG8(DTMS__SIO_DIFF, (CY_GET_REG8(DTMS__SIO_DIFF) & 0xcf) | 0x00);
                CY_SET_REG8(DTMS__SIO_HYST_EN, (CY_GET_REG8(DTMS__SIO_HYST_EN) & 0xcf) | 0x00);
            } else if( tmp > 0.89f ) {
                float val = tmp * 255.0f / 4.096f;
                if(val > 255.0f) val = 255.0f;
                SIORefGen_SetValue((uint8_t)val);
                CY_SET_REG8(DTMS__SIO_CFG, (CY_GET_REG8(DTMS__SIO_CFG) & 0xcf) | 0x30); // Regulated output buffer
                CY_SET_REG8(DTMS__SIO_DIFF, (CY_GET_REG8(DTMS__SIO_DIFF) & 0xcf) | 0x20);
                CY_SET_REG8(DTMS__SIO_HYST_EN, (CY_GET_REG8(DTMS__SIO_HYST_EN) & 0xcf) | 0x20);
            }
            num = snprintf(buffah, sizeof(buffah), "VTGT %5.2fV", tmp);
            disp_str(buffah, num, 0, 8+36, FONT6X6);

            FB_update();
            UpdateCtrl();
            ctr=256;
        } else {
            ctr--;
        }

        USB_Work();
    }
}
開發者ID:armae,項目名稱:CDB-Assist,代碼行數:101,代碼來源:main.c

示例12: LED1_ReadPulse1

/*******************************************************************************
* FUNCTION NAME:   LED1_ReadPulse1
********************************************************************************
*
* Summary:
*  Reads the PrISM Pulse Density1 register.
*
* Parameters:
*  None.
*
* Return:
*  Pulse Density1 register value.
*
*******************************************************************************/
uint8 LED1_ReadPulse1(void) 
{
    return( CY_GET_REG8(LED1_DENSITY1_PTR) );
}
開發者ID:e2forlife,項目名稱:PSoC-W5100-Driver,代碼行數:18,代碼來源:LED1.c

示例13: LED1_ReadPolynomial

/*******************************************************************************
* FUNCTION NAME:   LED1_ReadPolynomial
********************************************************************************
*
* Summary:
*  Reads the PrISM polynomial.
*
* Parameters:
*  None.
*
* Return:
*  PrISM polynomial.
*
*******************************************************************************/
uint8 LED1_ReadPolynomial(void) 
{
    return( CY_GET_REG8(LED1_POLYNOM_PTR) );
}
開發者ID:e2forlife,項目名稱:PSoC-W5100-Driver,代碼行數:18,代碼來源:LED1.c

示例14: LED1_ReadSeed

/*******************************************************************************
* FUNCTION NAME:   LED1_ReadSeed
********************************************************************************
*
* Summary:
*  Reads the PrISM Seed register.
*
* Parameters:
*  None.
*
* Return:
*  Current Period register value.
*
*******************************************************************************/
uint8 LED1_ReadSeed(void) 
{
    return( CY_GET_REG8(LED1_SEED_PTR) );
}
開發者ID:e2forlife,項目名稱:PSoC-W5100-Driver,代碼行數:18,代碼來源:LED1.c

示例15: pwm_ReadCapture

/*******************************************************************************
* Function Name: pwm_ReadCapture
********************************************************************************
*
* Summary:
*  Reads the capture value from the capture FIFO.
*
* Parameters:
*  None
*
* Return:
*  uint8/uint16: The current capture value
*
*******************************************************************************/
uint8 pwm_ReadCapture(void)
{
    return (CY_GET_REG8(pwm_CAPTURE_LSB_PTR));
}
開發者ID:cypresssemiconductorco,項目名稱:bleapp,代碼行數:18,代碼來源:pwm.c


注:本文中的CY_GET_REG8函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。