亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? tlv320aic23b.c

?? 基于TI公司Cortex-M3的uart超級通信開發
?? C
?? 第 1 頁 / 共 2 頁
字號:
    //
    // Continue the transfer.
    //
    I2CMasterControl(DAC_I2C_MASTER_BASE, I2C_MASTER_CMD_BURST_SEND_START);

    //
    // Wait until the current byte has been transferred.
    //
    while(I2CMasterIntStatus(DAC_I2C_MASTER_BASE, false) == 0)
    {
    }

    if(I2CMasterErr(DAC_I2C_MASTER_BASE) != I2C_MASTER_ERR_NONE)
    {
        I2CMasterIntClear(DAC_I2C_MASTER_BASE);
        return(false);
    }

    //
    // Wait until the current byte has been transferred.
    //
    while(I2CMasterIntStatus(DAC_I2C_MASTER_BASE, false))
    {
        I2CMasterIntClear(DAC_I2C_MASTER_BASE);
    }

    //
    // Write the next byte to the controller.
    //
    I2CMasterDataPut(DAC_I2C_MASTER_BASE, ulData);

    //
    // End the transfer.
    //
    I2CMasterControl(DAC_I2C_MASTER_BASE, I2C_MASTER_CMD_BURST_SEND_FINISH);

    //
    // Wait until the current byte has been transferred.
    //
    while(I2CMasterIntStatus(DAC_I2C_MASTER_BASE, false) == 0)
    {
    }

    if(I2CMasterErr(DAC_I2C_MASTER_BASE) != I2C_MASTER_ERR_NONE)
    {
        return(false);
    }

    while(I2CMasterIntStatus(DAC_I2C_MASTER_BASE, false))
    {
        I2CMasterIntClear(DAC_I2C_MASTER_BASE);
    }

    return(true);
}

//*****************************************************************************
//
//! Initialize the TLV320AIC23B DAC.
//!
//! This function initializes the I2C interface and the TLV320AIC23B DAC.
//!
//! \return Returns \b true on success of \b false if the I2S daughter board
//! is not present.
//
//*****************************************************************************
tBoolean
TLV320AIC23BInit(void)
{
    tBoolean bRetcode;

    //
    // Enable the GPIO port containing the I2C pins and set the SDA pin as a
    // GPIO input for now and engage a weak pull-down.  If the daughter board
    // is present, the pull-up on the board should easily overwhelm
    // the pull-down and we should read the line state as high.
    //
    SysCtlPeripheralEnable(DAC_I2CSCL_GPIO_PERIPH);
    GPIOPinTypeGPIOInput(DAC_I2CSCL_GPIO_PORT, DAC_I2CSDA_PIN);
    GPIOPadConfigSet(DAC_I2CSCL_GPIO_PORT, DAC_I2CSDA_PIN, GPIO_STRENGTH_2MA,
                     GPIO_PIN_TYPE_STD_WPD);

    //
    // Enable the I2C peripheral.
    //
    SysCtlPeripheralEnable(DAC_I2C_PERIPH);

    //
    // Delay a while to ensure that we read a stable value from the SDA
    // GPIO pin.  If we read too quickly, the result is unpredictable.
    // This delay is around 2mS.
    //
    SysCtlDelay(SysCtlClockGet() / (3 * 500));

    //
    // Read the current state of the I2C1SDA line.  If it is low, the
    // daughter board must not be present since it should be pulled high.
    //
    if(!(GPIOPinRead(DAC_I2CSCL_GPIO_PORT, DAC_I2CSDA_PIN) & DAC_I2CSDA_PIN))
    {
        return(false);
    }

    //
    // Configure the I2C SCL and SDA pins for I2C operation.
    //
    GPIOPinTypeI2C(DAC_I2CSCL_GPIO_PORT, DAC_I2CSCL_PIN | DAC_I2CSDA_PIN);

    //
    // Initialize the I2C master.
    //
    I2CMasterInitExpClk(DAC_I2C_MASTER_BASE, SysCtlClockGet(), 0);

    //
    // Allow the rest of the public APIs to make hardware changes.
    //
    g_ucEnabled = 1;

    //
    // Reset the DAC.  Check the return code on this call since we use it to
    // indicate whether or not the DAC is present.  If the register write
    // fails, we assume the I2S daughter board and DAC are not present and
    // return false.
    //
    bRetcode = TLV320AIC23BWriteRegister(TI_RESET, 0);
    if(!bRetcode)
    {
        return(bRetcode);
    }

    //
    // Power up the device and the DAC.
    //
    TLV320AIC23BWriteRegister(TI_POWER_DOWN, TI_POWER_DOWN_CLK |
                                             TI_POWER_DOWN_OSC);

    //
    // Set the sample rate.
    //
    TLV320AIC23BWriteRegister(TI_SRC, TI_SRC_SR_48000);

    //
    // Unmute the DAC.
    //
    TLV320AIC23BWriteRegister(TI_DIGITAL_AP, TI_DIGITAL_AP_DEEMP_48K |
                              TI_DIGITAL_AP_ADCHP);

    //
    // Enable the DAC path and insure the Mic input stays muted.
    //
    TLV320AIC23BWriteRegister(TI_ANALOG_AP, TI_ANALOG_AP_DAC |
                                            TI_ANALOG_AP_MICM);

    //
    // 16 bit I2S slave mode.
    //
    TLV320AIC23BWriteRegister(TI_DIGITAL_AI, TI_DIGITAL_AI_IWL_16 |
                              TI_DIGITAL_AI_FOR_I2S | TI_DIGITAL_AI_SLAVE);

    //
    // Set the Headphone volume.
    //
    TLV320AIC23BHeadPhoneVolumeSet(100);

    //
    // Unmute the Line input to the ADC.
    //
    TLV320AIC23BLineInVolumeSet(TLV_LINEIN_VC_0DB);

    //
    // Turn on the digital interface.
    //
    TLV320AIC23BWriteRegister(TI_DIGITAL_ACTIVATE, TI_DIGITAL_ACTIVATE_EN);

    return(true);
}

//*****************************************************************************
//
//! Sets the Line In volume.
//!
//! \param ucVolume is the volume to set for the line input.
//!
//! This function adjusts the audio output up by the specified percentage.  The
//! TI_LEFT_LINEIN_* values should be used for the \e ucVolume parameter.
//!
//! \return None
//
//*****************************************************************************
void
TLV320AIC23BLineInVolumeSet(unsigned char ucVolume)
{
    //
    // Unmute the line inputs and set the mixer to 0db.
    //
    TLV320AIC23BWriteRegister(TI_LEFT_LINEIN_VC, ucVolume);
    TLV320AIC23BWriteRegister(TI_RIGHT_LINEIN_VC, ucVolume);
}

//*****************************************************************************
//
//! Sets the Headphone volume on the DAC.
//!
//! \param ulVolume is the volume to set, specified as a percentage between 0%
//! (silence) and 100% (full volume), inclusive.
//!
//! This function adjusts the audio output up by the specified percentage.  The
//! adjusted volume will not go above 100% (full volume).
//!
//! \return None
//
//*****************************************************************************
void
TLV320AIC23BHeadPhoneVolumeSet(unsigned long ulVolume)
{
    g_ucHPVolume = (unsigned char)ulVolume;

    //
    // Cap the volume at 100%
    //
    if(g_ucHPVolume >= 100)
    {
        g_ucHPVolume = 100;
    }

    if(g_ucEnabled == 1)
    {
        //
        // Set the left and right volumes with zero cross detect.
        //
        TLV320AIC23BWriteRegister(TI_LEFT_HP_VC,
                                  (TI_LEFT_HP_VC_LZC |
                                   pucVolumeTable[ulVolume >> 3]));
        TLV320AIC23BWriteRegister(TI_RIGHT_HP_VC,
                                  (TI_LEFT_HP_VC_LZC |
                                   pucVolumeTable[ulVolume >> 3]));
    }
}

//*****************************************************************************
//
//! Returns the Headphone volume on the DAC.
//!
//! This function returns the current volume, specified as a percentage between
//! 0% (silence) and 100% (full volume), inclusive.
//!
//! \return Returns the current volume.
//
//*****************************************************************************
unsigned long
TLV320AIC23BHeadPhoneVolumeGet(void)
{
    return(g_ucHPVolume);
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩一区二区三区视频在线观看| 乱一区二区av| 亚洲精品在线观| 日韩视频国产视频| 日韩视频国产视频| 欧美电影免费观看完整版| 欧美丰满少妇xxxbbb| 日韩三级视频在线观看| 欧美一区二区三区婷婷月色| 日韩午夜电影av| 欧美电影免费观看高清完整版在 | 日韩美女啊v在线免费观看| 久久无码av三级| 久久综合资源网| 欧美国产精品久久| 国产精品不卡在线观看| 亚洲综合av网| 日本美女一区二区| 国产精品中文欧美| 91免费视频网| 777午夜精品免费视频| 精品国产污污免费网站入口| 久久色.com| 亚洲人妖av一区二区| 亚洲成人av资源| 日本美女一区二区| 波多野洁衣一区| 欧美亚洲国产一区二区三区va | 中文字幕一区二区在线播放| 亚洲免费av在线| 免费在线观看一区二区三区| 国产成人免费在线| 8x8x8国产精品| 国产精品久久久久久久久晋中 | 蜜臀av一区二区三区| 高清成人在线观看| 欧美日韩久久久| 国产日韩精品一区二区浪潮av | 国产成人在线视频免费播放| 一本大道综合伊人精品热热| 26uuu亚洲婷婷狠狠天堂| 亚洲欧洲成人精品av97| 免费在线一区观看| 色天天综合久久久久综合片| 精品国产3级a| 日韩精品一二三四| 成人开心网精品视频| 制服丝袜中文字幕亚洲| 亚洲人123区| 国产精品99精品久久免费| 欧美卡1卡2卡| 一区二区三区欧美日| 国产不卡视频在线观看| 日韩欧美一区二区免费| 亚洲一二三四久久| 99re热视频这里只精品| 国产性色一区二区| 免费一级欧美片在线观看| 色久优优欧美色久优优| 国产女人18毛片水真多成人如厕| 日本va欧美va精品发布| 欧美影院精品一区| 一区二区三区在线不卡| av电影在线观看一区| 欧美国产综合一区二区| 国产一区二区不卡老阿姨| 91精品国产91热久久久做人人| 一区二区不卡在线播放| 色中色一区二区| 亚洲欧美日韩国产中文在线| 成人av网址在线观看| 国产亚洲一区二区三区| 国产毛片精品一区| 国产午夜精品美女毛片视频| 国产不卡免费视频| 欧美激情一区二区三区不卡| 国产成人小视频| 国产精品久久久久永久免费观看 | 欧美精品三级在线观看| 亚洲精品午夜久久久| 在线视频综合导航| 亚洲一线二线三线久久久| 欧美日韩另类国产亚洲欧美一级| 亚洲综合色噜噜狠狠| 欧美视频在线播放| 日韩黄色在线观看| 26uuu色噜噜精品一区二区| 国产精品一区二区三区四区| 国产亚洲精品精华液| 成人精品在线视频观看| 亚洲欧美另类小说视频| 在线一区二区三区四区| 日韩精品一区第一页| 久久综合久久综合久久| 成人av免费在线观看| 中文字幕中文乱码欧美一区二区| 色天天综合久久久久综合片| 天天色天天操综合| 国产日韩欧美电影| 欧洲精品一区二区| 久久99久久99小草精品免视看| 国产日韩一级二级三级| 99精品久久只有精品| 五月天国产精品| 国产无一区二区| 欧美日韩一本到| 国产精品小仙女| 一区二区成人在线视频| 欧美不卡123| 91老师片黄在线观看| 久久精品国产澳门| 亚洲人午夜精品天堂一二香蕉| 在线综合+亚洲+欧美中文字幕| 国产91在线|亚洲| 亚洲成人黄色影院| 国产午夜精品一区二区三区四区| 在线观看日韩毛片| 国产91精品久久久久久久网曝门| 亚洲一区中文日韩| 中文字幕国产一区| 日韩精品中文字幕在线不卡尤物| 成人毛片老司机大片| 麻豆精品视频在线观看| 亚洲人成精品久久久久久| 精品欧美一区二区三区精品久久| 91麻豆视频网站| 国产高清视频一区| 青青草97国产精品免费观看无弹窗版| 国产精品色哟哟| 欧美mv和日韩mv的网站| 欧美丝袜丝交足nylons| 成人激情av网| 国产一区二区三区综合| 亚洲免费观看高清完整版在线观看熊| 日韩精品最新网址| 欧美剧在线免费观看网站| 在线观看欧美黄色| av激情成人网| 在线影院国内精品| 国产精品一区二区久久不卡| 婷婷久久综合九色国产成人| 国产精品福利电影一区二区三区四区| 精品久久久久一区二区国产| 欧美一区午夜视频在线观看| 欧美日韩亚洲综合一区二区三区| 色一情一乱一乱一91av| 99国产精品一区| 91丨九色丨蝌蚪丨老版| 97久久人人超碰| 99久久久精品| 91社区在线播放| 99热这里都是精品| 色综合久久久网| 在线观看欧美日本| 欧美午夜在线观看| 欧美日本免费一区二区三区| 欧美剧情电影在线观看完整版免费励志电影 | 精品免费一区二区三区| 日韩视频不卡中文| 久久久久亚洲蜜桃| 国产日产欧美一区二区视频| 26uuu亚洲| 国产精品私人影院| 亚洲欧美精品午睡沙发| 一区二区三区四区五区视频在线观看 | 国模冰冰炮一区二区| 狠狠久久亚洲欧美| 成人开心网精品视频| 91看片淫黄大片一级| 欧美日韩日日摸| 欧美大度的电影原声| 国产午夜精品一区二区| 国产精品福利一区| 一区二区三区在线看| 日本91福利区| 成人亚洲一区二区一| 91丨九色porny丨蝌蚪| 91精品国产色综合久久不卡电影 | 日韩毛片视频在线看| 午夜视频一区在线观看| 精品亚洲成a人| 成人丝袜高跟foot| 欧美日韩精品一区二区| 日韩视频免费观看高清在线视频| 欧美激情在线看| 香蕉加勒比综合久久 | 中文字幕一区在线观看| 亚洲一区影音先锋| 国产呦萝稀缺另类资源| 色综合久久中文综合久久牛| 91.xcao| 亚洲三级在线免费观看| 经典一区二区三区| 欧美性受极品xxxx喷水| 国产片一区二区| 三级影片在线观看欧美日韩一区二区 | 成人性生交大片免费| 欧美精品一卡两卡| 专区另类欧美日韩| 国产一区二区三区久久久|