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

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? cx25871.cpp

?? EP931X系列的WinCE顯示器驅(qū)動(dòng)源代碼
?? CPP
字號(hào):
//**********************************************************************
//                                                                      
// Filename: CX25871.cpp
//                                                                      
// Description: Routines to Initialize the CX25871 NTSC encoder.
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Use of this source code is subject to the terms of the Cirrus end-user
// license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
// If you did not accept the terms of the EULA, you are not authorized to 
// use this source code. For a copy of the EULA, please see the 
// EULA.RTF on your install media.
//
// Copyright(c) Cirrus Logic Corporation 2003, All Rights Reserved                       
//                                                                      
//**********************************************************************
#include <windows.h>
#include "cx25871.h"
#include "hwdefs.h"


//
// A good clock rate for EE is 10KHz.  That's a period of 10 uSec.
// So we have our EE_DELAY that times half a clock period set to 5 uSec.
// Note that for Kittyhawk 100Khz is to fast.
#define EE_DELAY_USEC       100

//
// The number of time we should read the two wire device before giving
// up.
//
#define EE_READ_TIMEOUT     100

static BOOL WriteCX25871Reg(UCHAR ucRegAddr, UCHAR ucRegValue);

//****************************************************************************
// InitializeCX25871640x480
//****************************************************************************
// Initialize the CX25871 for 640x480 NTSC output.
// 
//
void InitializeCX25871For640x480NTSC(void)
{
    //
    // Perform auto-configuration
    //
    WriteCX25871Reg(0xB8, 0);
    // VS_Print( DEST_CONSOLE, "\nAuto-configuration complete for mode 0.\n");
    Sleep(1);

    //                
    // After auto-configuration, setup pseudo-master mode BUT with EN_BLANKO bit cleared
    //
    WriteCX25871Reg(0xBA, CX25871_REGxBA_SLAVER | CX25871_REGxBA_DACOFF);
    WriteCX25871Reg(0xC6, (CX25871_REGxC6_INMODE_MASK & 0x3));
    WriteCX25871Reg(0xC4, CX25871_REGxC4_EN_OUT);
    WriteCX25871Reg(0x32, 0);
    WriteCX25871Reg(0xBA, CX25871_REGxBA_SLAVER );
}



//****************************************************************************
// DelayuS
//****************************************************************************
// Delays a certian number of microseconds.
// 
//
void DelayuS(ULONG ulMicroSec)
{
    LARGE_INTEGER liStart, liCurrent;
    BOOL b;
    b = QueryPerformanceCounter(&liStart);
    //ASSERT(b);
    
    do
    {
        // Sleep(0);
        b = QueryPerformanceCounter(&liCurrent);
        //ASSERT(b);
    } while((liStart.QuadPart + (LONGLONG)ulMicroSec) >=liCurrent.QuadPart);
}


//****************************************************************************
// WriteCX25871Reg
//****************************************************************************
// ucRegAddr    - CS4228 Register Address.
// usRegValue   - CS4228 Register Value.
//
// Return     0 - Success
//            1 - Failure
//

static BOOL WriteCX25871Reg(UCHAR ucRegAddr, UCHAR ucRegValue)
{

    ULONG uiVal, uiDDR;
    unsigned char ucData, ucIdx, ucBit;
    ULONG ulTimeout;

    //FUNC_I2S
    //(
    //    (
    //        L"WriteCX25871Reg: Reg = 0x%02x, Value = 0x%02x\n", 
    //        ucRegAddr, 
    //        ucRegValue
    //    )
    //);

    //
    // Read the current value of the GPIO data and data direction registers.
    //
    uiVal = *GPIO_PGDR;
    uiDDR = *GPIO_PGDDR;

    //
    // If the GPIO pins have not been configured since reset, the data 
    // and clock lines will be set as inputs and with data value of 0.
    // External pullup resisters are pulling them high.
    // Set them both high before configuring them as outputs.
    //
    uiVal |= (GPIOG_EEDAT | GPIOG_EECLK);
    *GPIO_PGDR = uiVal;

    //
    // Delay to meet the EE Interface timing specification.
    //
    DelayuS( EE_DELAY_USEC );

    //
    // Configure the EE data and clock lines as outputs.
    //
    uiDDR |= (GPIOG_EEDAT | GPIOG_EECLK);
    *GPIO_PGDDR = uiDDR;

    //
    // Delay to meet the EE Interface timing specification.
    //
    DelayuS( EE_DELAY_USEC );

    //
    // Drive the EE data line low.  Since the EE clock line is currently
    // high, this is the start condition.
    //
    uiVal &= ~GPIOG_EEDAT;
    *GPIO_PGDR = uiVal;

    //
    // Delay to meet the EE Interface timing specification.
    //
    DelayuS( EE_DELAY_USEC );

    //
    // Drive the EE clock line low.
    //
    uiVal &= ~GPIOG_EECLK;
    *GPIO_PGDR = uiVal;

    //
    // Delay to meet the EE Interface timing specification.
    //
    DelayuS( EE_DELAY_USEC );

    //
    // Loop through the three bytes which we will send.
    //
    for(ucIdx = 0; ucIdx < 3; ucIdx++)
    {
        //
        // Get the appropriate byte based on the current loop iteration.
        //
        if(ucIdx == 0)
        {
            //
            // Since this is a write operation, we set d0 of the address
            // which is the r/w bit.
            //
            ucData = (UCHAR)CX25871_DEV_ADDRESS;
        }
        else if(ucIdx == 1)
        {
            ucData = ucRegAddr;
        }
        else
        {
            ucData = ucRegValue;
        }

        //
        // Loop through the 8 bits in this byte.
        //
        for(ucBit = 0; ucBit < 8; ucBit++)
        {
            //
            // Set the EE data line to correspond to the most significant bit
            // of the data byte.
            // 
            if(ucData & 0x80)
            {
                uiVal |= GPIOG_EEDAT;
            }
            else
            {
                uiVal &= ~GPIOG_EEDAT;
            }
            *GPIO_PGDR = uiVal;

            //
            // Delay to meet the EE Interface timing specification.
            //
            DelayuS( EE_DELAY_USEC );

            //
            // Drive the EE clock line high.
            //
            *GPIO_PGDR = uiVal | GPIOG_EECLK;

            //
            // Delay to meet the EE Interface timing specification.
            //
            DelayuS( EE_DELAY_USEC );

            //
            // Drive the EE clock line low.
            //
            *GPIO_PGDR = uiVal;

            //
            // Delay to meet the EE Interface timing specification.
            //
            DelayuS( EE_DELAY_USEC );

            //
            // Shift the data byte to the left by one bit.
            //
            ucData <<= 1;
        }

        //
        // We've sent the eight bits in this data byte, so we need to wait for
        // the acknowledge from the target.  Reconfigure the EE data line as
        // an input so we can read the acknowledge from the device.
        //
        uiDDR &= ~GPIOG_EEDAT;
        *GPIO_PGDDR = uiDDR;

        //
        // Delay to meet the EE Interface timing specification.
        //
        DelayuS( EE_DELAY_USEC );
    
        //
        // Drive the EE clock line high.
        //
        *GPIO_PGDR = uiVal | GPIOG_EECLK;

        //
        // Delay to meet the EE Interface timing specification.
        //
        DelayuS( EE_DELAY_USEC );

        //
        // Wait until the EE data line is pulled low by the target device.
        //
        ulTimeout = 0;        
        while(*GPIO_PGDR & GPIOG_EEDAT)
        {
            DelayuS( EE_DELAY_USEC );
            ulTimeout++;
            if(ulTimeout > EE_READ_TIMEOUT )
            {
                //ERRMSG
                //((
                //   L"I2SCodec::WriteCodecReg Write timeout on register 0x%02x\r\n",  
                //    (ULONG)ucRegAddr 
                //));
                return 1;
            }
        }

        //
        // Drive the EE clock line low.
        //
        *GPIO_PGDR = uiVal;

        //
        // Delay to meet the EE Interface timing specification.
        //
        DelayuS( EE_DELAY_USEC );
    
        //
        // Reconfigure the EE data line as an output.
        //
        uiDDR |= GPIOG_EEDAT;
        *GPIO_PGDDR = uiDDR;

        //
        // Delay to meet the EE Interface timing specification.
        //
        DelayuS( EE_DELAY_USEC );
    }

    //
    // Drive the EE data line low.
    //
    uiVal &= ~GPIOG_EEDAT;
    *GPIO_PGDR = uiVal;

    //
    // Delay to meet the EE Interface timing specification.
    //
    DelayuS( EE_DELAY_USEC );

    //
    // Drive the EE clock line high.
    //
    uiVal |= GPIOG_EECLK;
    *GPIO_PGDR = uiVal;

    //
    // Delay to meet the EE Interface timing specification.
    //
    DelayuS( EE_DELAY_USEC );

    //
    // Drive the EE data line high.  Since the EE clock line is currently
    // high, this is the stop condition.
    //
    uiVal |= GPIOG_EEDAT;
    *GPIO_PGDR = uiVal;

    //
    // Delay to meet the EE Interface timing specification.
    //
    DelayuS( EE_DELAY_USEC );

    return 0;
}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91免费看片在线观看| 在线观看日韩国产| 亚洲成人综合视频| 国产日本欧美一区二区| 欧美系列一区二区| www.在线欧美| 国产一区二区剧情av在线| 亚洲午夜影视影院在线观看| 久久精品视频一区| 在线观看91av| 欧洲亚洲精品在线| av在线不卡网| 国产一区二区电影| 久久精品国产精品亚洲精品| 亚洲图片欧美视频| 亚洲精品成人a在线观看| 国产午夜精品福利| 精品国产伦一区二区三区观看方式 | 欧美午夜精品电影| 成人精品一区二区三区四区| 国产精品一区一区| 久久精品国产亚洲aⅴ| 国产欧美一区二区精品性色| 日韩美女天天操| 日韩片之四级片| 欧美一区二区视频观看视频| 欧美亚洲综合久久| 欧美色图片你懂的| 91久久精品国产91性色tv| 成人精品视频网站| 不卡的电影网站| 丁香激情综合国产| 成人美女视频在线观看| 国产精品888| 国产成人精品亚洲午夜麻豆| 国产专区综合网| 国产精品18久久久久| 狠狠色2019综合网| 国产剧情一区二区| 国产电影精品久久禁18| 丁香六月综合激情| 99久久精品免费看国产| 91麻豆免费看| 在线观看免费亚洲| 7777精品伊人久久久大香线蕉| 欧美日韩在线三级| 8x8x8国产精品| 欧美电视剧免费观看| 日韩精品自拍偷拍| 国产日产欧美一区| 中文字幕五月欧美| 亚洲欧美日韩国产手机在线 | 欧美mv日韩mv亚洲| 国产午夜精品福利| 亚洲免费av网站| 亚洲一区二区三区影院| 视频一区二区中文字幕| 另类小说视频一区二区| 国产伦精品一区二区三区免费迷| 国产精品乡下勾搭老头1| 9i在线看片成人免费| 欧美网站一区二区| 欧美成人精品高清在线播放| 久久午夜老司机| 亚洲乱码国产乱码精品精的特点 | 另类的小说在线视频另类成人小视频在线 | 亚洲国产日韩a在线播放| 日韩中文字幕不卡| 国产高清成人在线| 在线亚洲欧美专区二区| 日韩欧美一区中文| 国产精品网站在线| 亚洲成年人影院| 国产一区二区三区在线观看免费 | 看电视剧不卡顿的网站| 国产ts人妖一区二区| 色妹子一区二区| 日韩视频不卡中文| 亚洲欧美在线视频观看| 日韩 欧美一区二区三区| 国产成a人亚洲精| 欧美日韩色综合| 国产视频一区在线观看 | 国产99精品视频| 欧美亚洲国产怡红院影院| 精品sm在线观看| 亚洲一区二区四区蜜桃| 国产一区二区三区日韩| 欧美日本国产一区| 国产精品视频一二| 免费成人在线观看视频| 91丨国产丨九色丨pron| 日韩欧美二区三区| 亚洲成人在线免费| 成人av免费观看| 欧美一二三区在线| 玉米视频成人免费看| 国产伦理精品不卡| 日韩亚洲欧美成人一区| 一区二区三区在线观看视频| 国产精品一品二品| 日韩欧美电影在线| 亚洲国产综合人成综合网站| kk眼镜猥琐国模调教系列一区二区 | 亚洲一区二区三区中文字幕在线| 国产精品白丝jk黑袜喷水| 51精品国自产在线| 亚洲免费观看高清在线观看| 国产精品一二三四五| 欧美电影免费观看高清完整版在 | 国产欧美日韩不卡| 久久精品国产一区二区三| 欧美日韩在线免费视频| 一区二区三区在线免费视频| 成人免费av资源| 国产喷白浆一区二区三区| 久久国内精品自在自线400部| 欧美日韩久久不卡| 一区二区三区四区不卡在线| 91在线视频网址| 国产精品久久久久婷婷二区次 | 色哟哟欧美精品| 1区2区3区欧美| 成人av在线网| 国产日韩欧美综合一区| 国产九色sp调教91| 久久精品人人做人人爽97| 九色porny丨国产精品| 91精品国产综合久久久久久| 天天做天天摸天天爽国产一区 | 激情五月婷婷综合网| 日韩视频一区二区三区在线播放| 免费在线看成人av| 日韩一区二区在线观看视频 | 久久久久久久久久久黄色| 精品亚洲porn| 精品国产乱码久久久久久久久| 日韩成人一级片| 日韩亚洲国产中文字幕欧美| 麻豆精品国产传媒mv男同| 精品久久久久久久久久久久包黑料| 美女www一区二区| 精品电影一区二区| 国产精品亚洲第一| 国产精品传媒在线| 一本大道久久a久久综合| 亚洲精品国产无天堂网2021| 在线免费视频一区二区| 亚洲mv在线观看| 日韩欧美国产一区二区三区| 国产美女在线观看一区| 欧美国产一区二区| 色综合久久99| 视频一区视频二区在线观看| 日韩精品中文字幕一区| 国产成人免费视频网站 | 777午夜精品免费视频| 久久www免费人成看片高清| 欧美精品一区二区三区在线播放| 国产美女精品人人做人人爽| 国产精品视频免费看| 欧美日韩久久久久久| 韩日欧美一区二区三区| 国产亚洲欧美色| 91国偷自产一区二区三区观看| 首页国产欧美日韩丝袜| 国产无一区二区| 欧美午夜片在线观看| 国产美女视频一区| 亚洲自拍偷拍网站| 日韩精品一区二区三区视频在线观看| 国产mv日韩mv欧美| 天涯成人国产亚洲精品一区av| 久久久久久一二三区| 91久久精品国产91性色tv | 成人av高清在线| 日韩高清在线观看| 国产精品每日更新| 69堂成人精品免费视频| 成人网在线免费视频| 日韩不卡一区二区三区| 中文字幕日韩欧美一区二区三区| 欧美精选一区二区| 成人黄色免费短视频| 丝袜脚交一区二区| 国产精品久久777777| 日韩欧美色综合网站| 一本大道久久精品懂色aⅴ | 97se亚洲国产综合自在线观| 美女一区二区久久| 亚洲黄色录像片| 欧美激情一区二区三区| 91精品国产综合久久精品app| 99在线精品免费| 韩国女主播一区| 天堂一区二区在线| 亚洲嫩草精品久久| 国产目拍亚洲精品99久久精品| 91精品免费在线| 欧美亚洲国产一区在线观看网站|