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

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

?? cx25871.cpp

?? EP9315 BSP for WinCE 源代碼
?? CPP
字號:
//**********************************************************************
//                                                                      
// 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;
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
免费精品视频在线| 国产精品九色蝌蚪自拍| 成人sese在线| 首页综合国产亚洲丝袜| 欧美激情一区三区| 精品国产免费视频| 欧美日韩国产一二三| 成人动漫精品一区二区| 精品一区二区三区久久| 婷婷一区二区三区| 亚洲欧美精品午睡沙发| 久久精品亚洲精品国产欧美kt∨| 欧美精品tushy高清| 色综合一个色综合亚洲| 国产jizzjizz一区二区| 狠狠色丁香婷婷综合| 日韩高清不卡一区二区| 亚洲自拍偷拍欧美| 中文字幕一区免费在线观看| 久久久一区二区| 欧美大片一区二区三区| 在线不卡中文字幕| 欧美在线免费视屏| 日本高清免费不卡视频| 91在线看国产| 91在线看国产| 本田岬高潮一区二区三区| 国产盗摄精品一区二区三区在线| 精品亚洲成a人| 久久精品久久综合| 日韩不卡一区二区三区| 婷婷久久综合九色综合绿巨人| 亚洲一区二区三区四区不卡| 亚洲欧洲av在线| 欧美激情在线看| 欧美国产日韩一二三区| 久久久三级国产网站| 精品成人免费观看| 精品久久一区二区| 日韩免费成人网| 精品久久久久久久久久久久久久久| 日韩免费高清av| 日韩欧美综合在线| 精品日韩一区二区三区免费视频| 欧美一区二区三区四区视频| 日韩亚洲国产中文字幕欧美| 精品国产免费一区二区三区四区| 久久婷婷久久一区二区三区| 国产午夜精品久久久久久久| 中文字幕一区免费在线观看| 亚洲精品美国一| 亚洲精品久久久久久国产精华液| 亚洲黄网站在线观看| 亚洲福利一区二区| 免费看欧美女人艹b| 国产一区美女在线| 成人v精品蜜桃久久一区| 99久久久国产精品| 色婷婷综合中文久久一本| 欧美伊人久久大香线蕉综合69 | 欧洲视频一区二区| 欧美在线制服丝袜| 欧美精品在欧美一区二区少妇| 91精品国产91热久久久做人人| 精品国产精品一区二区夜夜嗨| 久久综合九色综合97_久久久 | 亚洲成人黄色小说| 精品一区二区三区欧美| 成人av免费观看| 欧美伊人久久大香线蕉综合69 | 久久激情五月婷婷| 国产a级毛片一区| 欧洲另类一二三四区| 精品久久久久久久久久久久包黑料| 国产亚洲婷婷免费| 亚洲国产综合人成综合网站| 蜜桃精品在线观看| 成av人片一区二区| 欧美一级二级三级蜜桃| 日本一区二区三区dvd视频在线| 一二三四社区欧美黄| 蜜臀av性久久久久蜜臀aⅴ四虎 | 欧美高清视频不卡网| 国产午夜亚洲精品理论片色戒 | 国产精品久久久久久久久免费桃花| 亚洲国产wwwccc36天堂| 国产一区三区三区| 欧美视频一区在线观看| 国产丝袜美腿一区二区三区| 亚洲一区二区三区中文字幕在线| 国产精品一区二区在线看| 欧美在线一二三| 国产精品私人影院| 日本不卡一二三| 91蝌蚪国产九色| 国产婷婷色一区二区三区四区| 午夜天堂影视香蕉久久| 99久久99久久久精品齐齐| 日韩免费成人网| 亚洲国产综合在线| 97精品电影院| 久久男人中文字幕资源站| 亚洲专区一二三| 不卡视频在线看| 精品国产乱码久久| 免费在线观看成人| 欧美揉bbbbb揉bbbbb| 中文字幕五月欧美| 国产成人啪免费观看软件| 日韩亚洲欧美高清| 日日噜噜夜夜狠狠视频欧美人 | 国产成人精品在线看| 欧美一卡二卡在线| 亚洲图片一区二区| 色悠悠久久综合| 国产精品国产三级国产普通话蜜臀| 看电视剧不卡顿的网站| 777午夜精品免费视频| 亚洲一二三级电影| 色偷偷久久人人79超碰人人澡| 亚洲国产精品国自产拍av| 激情小说欧美图片| 日韩欧美色综合| 日本aⅴ免费视频一区二区三区 | 国产婷婷一区二区| 国产成人综合网| 久久嫩草精品久久久精品| 久久丁香综合五月国产三级网站| 欧美美女视频在线观看| 亚洲成人激情av| 欧美日韩一区在线观看| 亚洲成a人片在线不卡一二三区| 欧美色综合影院| 天天做天天摸天天爽国产一区| 欧美一a一片一级一片| 亚洲一区二区av电影| 欧美日韩一区二区在线视频| 亚洲成人动漫精品| 欧美日韩成人激情| 日韩av一级片| 日韩精品影音先锋| 国产在线麻豆精品观看| 久久久影院官网| 国产成人精品免费一区二区| 国产色产综合色产在线视频| 国产成人精品影视| 亚洲欧洲制服丝袜| 欧美综合视频在线观看| 石原莉奈在线亚洲二区| 日韩一二三区视频| 国产精品综合一区二区三区| 国产精品美日韩| 欧美性高清videossexo| 亚洲高清免费视频| 日韩欧美一二区| 国产一区欧美日韩| 国产精品久久久久久久裸模| 欧洲一区二区三区在线| 日韩av一区二区三区| 久久精品亚洲国产奇米99| 99热国产精品| 一区二区三区欧美在线观看| 91精品国产综合久久精品app| 精品一区二区国语对白| 国产精品久久久一区麻豆最新章节| 色老综合老女人久久久| 蜜臀久久久99精品久久久久久| 久久精品水蜜桃av综合天堂| 日本高清免费不卡视频| 男女性色大片免费观看一区二区 | 亚洲线精品一区二区三区| 欧美成人女星排名| 91视频精品在这里| 日韩国产成人精品| 国产精品午夜在线| 欧美精品乱码久久久久久| 国产精品一区二区无线| 亚洲综合无码一区二区| 精品嫩草影院久久| 色成年激情久久综合| 久久99久久久久| 一区二区在线观看视频| 精品欧美久久久| 欧洲生活片亚洲生活在线观看| 国内精品久久久久影院色| 亚洲乱码国产乱码精品精小说| 日韩欧美aaaaaa| 欧美午夜一区二区三区| 国产精品综合在线视频| 五月天网站亚洲| 国产精品美女久久久久久久久久久| 9191久久久久久久久久久| 成人av资源站| 久久99国产精品久久99| 亚洲国产精品一区二区久久恐怖片| 久久伊人蜜桃av一区二区| 欧美日韩精品福利| 91一区一区三区| 高清不卡一二三区| 免费一级欧美片在线观看|