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

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

?? touchscr.c

?? Cirrus Logic EP7312處理器部分控制程序。
?? C
字號:
//****************************************************************************
//
// TOUCHSCR.C - Uses the SPI ADC to sample the value of the touch screen on
// the EP7312 evaluation board.
//
// Copyright (c) 1998-1999 Cirrus Logic, Inc.
//
//****************************************************************************
#include "lib7312.h"
#include "touchscr.h"

//****************************************************************************
//
// The following arrays contain the value of the samples taken at the four
// corners of the touch screen.  They are used for converting the touch
// screen coordinates to LCD screen coordinates.
//
//****************************************************************************
unsigned long ulCornerX[4], ulCornerY[4];

//****************************************************************************
//
// ReadSample reads the X/Y coordinate pair from the touch screen.
//
//****************************************************************************
void
ReadSample(unsigned long *pulX, unsigned long *pulY)
{
    unsigned long ulADS7846ctl;

    // 
    // Create the control byte for x channel, differential
    //
    ulADS7846ctl = ADS7846E_S | 
    (ADS7846E_ADD_DFR_X << ADS7846E_ADD_SHIFT) |
    (ADS7846E_PD_LPWR << ADS7846E_PD_SHIFT);

    //
    // Get the x position using differential mode.
    // The lower 4 bits are padding.
    //
    *pulX = (ADCGetData(ulADS7846ctl) >> 4);	

    //
    // Create the control byte for y channel
    ulADS7846ctl = ADS7846E_S | 
    (ADS7846E_ADD_DFR_Y << ADS7846E_ADD_SHIFT) |
    (ADS7846E_PD_LPWR << ADS7846E_PD_SHIFT);
    
    //
    // Get the Y position using differential mode.
    // The lower 4 bits are padding.
    //
    *pulY = (ADCGetData(ulADS7846ctl) >> 4);
}


//****************************************************************************
//
// This program draws circles on the LCD panel at the returned touch location 
// from the Burr Brown ADC, ADS7846E, on the EP7312 evaluation board
//
//****************************************************************************
void
entry(void)
{
    unsigned long ulXPos, ulYPos;
    long lIter;
    long lPosX[4] = {0, 312, 312, 0}, lPosY[4] = {0, 0, 232, 232};
    CPixel sColor;
    char cButtons[6];
    int i;

    //
    // Enable the LCD controller, clear the frame buffer, and turn on the LCD
    // panel.
    //
    LCDColorEnable();
    LCDColorCls();
    LCDColorOn();
    LCDColorBacklightOn();
    LCDColorContrastEnable();

    // 
    // Initialze the ADC
    //
    ADCEnable();

    //
    // Set the pixel color to white.
    //
    sColor.r = 15;
    sColor.g = 15;
    sColor.b = 15;

    // 
    // Set the entire screen to white
    //
    for(ulYPos = 0; ulYPos < 240; ulYPos++)
    {
        for(ulXPos = 0; ulXPos < 320; ulXPos++)
	  {
   	      LCDColorSetPixel(ulXPos, ulYPos, sColor);
	  }
    }
    
    //
    // Set the pixel color to green.
    //
    sColor.r = 0;
    sColor.g = 0;
    sColor.b = 15;


    //
    // Tell the user what to do.
    //
    LCDColorPrintStringX2("Touch the screen", 20, 85, sColor);
    LCDColorPrintStringX2("in each box.", 20, 105, sColor);
    LCDColorPrintString("This calibrates the touch screen to", 20, 132, sColor);
    LCDColorPrintString("the LCD coordinates", 20, 142, sColor);

    //
    // Read screen touches from the four corners of the screen.  This is used 
    // to calibrate the touch screen to the LCD screen coordinate transformation.
    //
    for(lIter = 0; lIter < 4; lIter++)
    {
        //
        // Set the pixel color to red.
        //
        sColor.r = 15;
        sColor.g = 0;
        sColor.b = 0;
            
        //
        // Draw a box in the appropriate corner of the screen
        //
        LCDColorLine(lPosX[lIter] + 0, lPosY[lIter] + 0,
                lPosX[lIter] + 7, lPosY[lIter] + 0, sColor);
         LCDColorLine(lPosX[lIter] + 7, lPosY[lIter] + 0,
                lPosX[lIter] + 7, lPosY[lIter] + 7, sColor);
         LCDColorLine(lPosX[lIter] + 7, lPosY[lIter] + 7,
                lPosX[lIter] + 0, lPosY[lIter] + 7, sColor);
         LCDColorLine(lPosX[lIter] + 0, lPosY[lIter] + 7,
                lPosX[lIter] + 0, lPosY[lIter] + 0, sColor);

         //
         // Wait until the touch screen has been touched.
         //
         while(1)
         {
            //
            // Sample the touch screen
            //
            ReadSample(&ulXPos, &ulYPos);

            // 
            // Stop waiting if a valid sample was read.
            //
            if(lIter < 2)
            {
               if(ulYPos > 1436)
               {
                  break;
               }
            }
            else
            {
               if(ulYPos < 200)
               {
                  break;
               }
            }   
         }

         //
         // Save the sample.
         //        
        ulCornerX[lIter] = ulXPos;
        ulCornerY[lIter] = ulYPos;

        //
        // Fill in the box in the corner of the screen.
        //
        for(ulXPos = 0; ulXPos < 8; ulXPos++)
        {
           LCDColorLine(lPosX[lIter] + ulXPos, lPosY[lIter] + 0,
                        lPosX[lIter] + ulXPos, lPosY[lIter] + 7, sColor);
        }

        //
        // Wait until the screen is not being touched.
        //
        while(1)
        {
           //
           // Sample the touch screen.
           //
           ReadSample(&ulXPos, &ulYPos);

           // 
           // Stop waiting if an invalid sample was read.
           //
           if(lIter < 2)
           {
              if(ulYPos < 1436)
              {
                 break;
              }
           }
           else
           {
              if(ulYPos > 150)
              {
                 break;
              }
           }
        }

        //
        // Set the pixel color to white.
        // 
        sColor.r = 15;
        sColor.g = 15;
        sColor.b = 15;

        //
        // Clear the box in the corner of the screen.
        //
        for(ulXPos = 0; ulXPos < 8; ulXPos++)
        {
           LCDColorLine(lPosX[lIter] + ulXPos, lPosY[lIter] + 0,
                        lPosX[lIter] + ulXPos, lPosY[lIter] + 7, sColor);
        }
    }

    // 
    // Clear the screen to white
    //
    for(ulYPos = 0; ulYPos < 240; ulYPos++)
    {
        for(ulXPos = 0; ulXPos < 320; ulXPos++)
	  {
   	      LCDColorSetPixel(ulXPos, ulYPos, sColor);
	  }
    }

    //
    // Set the pixel color to red.
    // 
    sColor.r = 15;
    sColor.g = 0;
    sColor.b = 0;

    //
    // Give the user some instruction
    //
    LCDColorPrintStringX2("Touch the screen.", 17, 10, sColor);
    LCDColorPrintString("Press a user button on the keypad", 17, 35, sColor);
    LCDColorPrintString("   to exit the demo", 17, 45, sColor);

    //
    // Program loop.  The exit condition is within the loop.
    //
    while (1)
    {
        //
        // Sample the touch screen.
        //
        ReadSample(&ulXPos, &ulYPos);

        // 
        // Convert the touch screen coordinate to a screen coordinate
        //
        ulXPos = 320 - ((320 * (ulXPos - ulCornerX[1])) / (ulCornerX[0] - ulCornerX[1]));
        ulYPos = 240 - ((240 * (ulYPos - ulCornerY[3])) / (ulCornerY[0] - ulCornerY[3]));

        //
        // Pixel color is already red.  Draw a red circle at the touched position 
        // with a radius of 10.
        //
        LCDColorFillCircle(ulXPos, ulYPos, 10, sColor);

        // 
        // Delay for readability
        //
        for (ulXPos = 0; ulXPos < 0x10000; ulXPos++){}

        //
        // Check for a user button to be pressed.
        //
        KPRead(cButtons);
        for(i = 0; i < 6; i++)
        {
           if(cButtons[i])
           {
              break;
           }
        }
        if(i != 6)
        {
           break;
        }
    }
    
    //
    // Disable the LCD controller.
    //
    LCDColorContrastDisable();
    LCDColorBacklightOff();
    LCDColorOff();
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲女与黑人做爰| 久久久综合激的五月天| 亚洲综合色噜噜狠狠| 欧美亚洲日本国产| 日韩av中文字幕一区二区| 欧美视频一区在线| 天堂成人免费av电影一区| 欧美第一区第二区| 国产成人av电影在线播放| 亚洲女同一区二区| 欧美日韩国产一级二级| 久久99精品久久久久久| 国产人伦精品一区二区| 在线视频观看一区| 久久精品999| 中文字幕一区二区三区在线播放 | 亚洲蜜臀av乱码久久精品| 精品视频一区二区不卡| 久久成人麻豆午夜电影| 成人免费一区二区三区在线观看| 91国产视频在线观看| 久久精品国产99国产精品| 中文字幕一区二区三区精华液| 欧美日韩久久不卡| 国产成人精品三级| 香蕉久久一区二区不卡无毒影院| 久久伊99综合婷婷久久伊| 99免费精品视频| 麻豆国产欧美日韩综合精品二区| 国产精品看片你懂得| 欧美日韩国产经典色站一区二区三区 | 亚洲九九爱视频| 26uuu亚洲婷婷狠狠天堂| 91原创在线视频| 久久国产视频网| 一区二区三区在线播| 久久综合色综合88| 欧美理论片在线| 91网站在线播放| 激情小说欧美图片| 亚洲午夜电影在线观看| 中文幕一区二区三区久久蜜桃| 欧美福利视频导航| 99精品欧美一区二区三区综合在线| 免费观看日韩av| 亚洲高清视频中文字幕| 国产精品视频免费| 久久久久久免费毛片精品| 欧美日韩亚洲国产综合| 91在线免费视频观看| 国产在线观看一区二区| 国产一区二区主播在线| 亚洲国产精品一区二区久久| 国产精品婷婷午夜在线观看| 精品国产乱码久久久久久闺蜜| 欧美在线一区二区三区| 91在线观看美女| 国产宾馆实践打屁股91| 国产一区二区不卡| 久88久久88久久久| 日本亚洲视频在线| 日本少妇一区二区| 婷婷夜色潮精品综合在线| 洋洋成人永久网站入口| 亚洲三级在线播放| 亚洲人成网站在线| 中文字幕佐山爱一区二区免费| 国产三级久久久| 久久久99久久精品欧美| 久久久久久久综合| 久久久精品中文字幕麻豆发布| 精品sm捆绑视频| 久久综合久久久久88| 久久久亚洲国产美女国产盗摄| 精品国产乱码久久久久久久久| 精品国一区二区三区| 久久一区二区视频| 久久精品一区二区三区四区| www国产精品av| 国产日韩亚洲欧美综合| 国产精品欧美极品| 亚洲精选一二三| 亚洲成人动漫av| 美女视频一区在线观看| 激情综合色丁香一区二区| 国产呦萝稀缺另类资源| 国产.欧美.日韩| 91丨九色丨蝌蚪丨老版| 欧美性xxxxx极品少妇| 91.xcao| 欧美mv日韩mv国产网站app| 国产日产欧美一区| 亚洲美女视频一区| 视频精品一区二区| 极品少妇xxxx精品少妇| 国产成人99久久亚洲综合精品| av电影天堂一区二区在线观看| 91成人免费在线| 欧美一级二级三级蜜桃| 久久精品视频一区二区三区| 综合久久给合久久狠狠狠97色| 一区二区三区中文在线观看| 日本成人在线视频网站| 岛国精品一区二区| 欧洲视频一区二区| 亚洲精品一区二区三区精华液| 中文字幕巨乱亚洲| 亚洲国产综合91精品麻豆| 久久精品国产亚洲aⅴ| youjizz国产精品| 欧美另类一区二区三区| 欧美韩日一区二区三区| 亚洲6080在线| 成人污污视频在线观看| 欧美欧美欧美欧美| 亚洲欧洲在线观看av| 青椒成人免费视频| 91丝袜高跟美女视频| 精品av久久707| 亚洲成人动漫精品| 国产成人精品影视| 欧美电影在哪看比较好| 国产精品麻豆99久久久久久| 日本视频一区二区三区| 91福利在线免费观看| 久久久电影一区二区三区| 亚洲成av人片一区二区三区| 91在线国内视频| 欧美成人精精品一区二区频| 亚洲精品中文字幕在线观看| 国产不卡在线视频| 日韩精品一区二区三区中文不卡| 一区二区三区波多野结衣在线观看| 国产自产2019最新不卡| 欧美日韩1区2区| 亚洲综合激情另类小说区| 成人免费观看视频| 久久久久亚洲蜜桃| 麻豆视频一区二区| 欧美午夜寂寞影院| 一区二区三区欧美亚洲| 成人av免费在线观看| 久久免费看少妇高潮| 喷白浆一区二区| 欧美日韩三级在线| 亚洲一区成人在线| 色香蕉久久蜜桃| 日韩毛片在线免费观看| 成人综合在线视频| 国产日韩精品一区二区三区 | 久久久久久久久蜜桃| 日本不卡一区二区三区| 欧美巨大另类极品videosbest | 首页国产欧美日韩丝袜| 欧美主播一区二区三区美女| 自拍偷拍亚洲综合| 成人app下载| 中国av一区二区三区| 国产 欧美在线| 国产午夜精品久久| 国产精品一区免费视频| 久久蜜桃一区二区| 国产在线视频精品一区| 337p粉嫩大胆噜噜噜噜噜91av| 久久丁香综合五月国产三级网站| 日韩欧美精品在线| 青青草国产精品亚洲专区无| 日韩美女在线视频| 久久精品国产亚洲高清剧情介绍| 日韩欧美一区二区久久婷婷| 老司机一区二区| 国产三级一区二区| 粉嫩一区二区三区在线看| 国产精品国产三级国产专播品爱网| 成人av电影在线网| 亚洲人亚洲人成电影网站色| 色狠狠色噜噜噜综合网| 亚洲成在线观看| 欧美一级免费大片| 国产一区二区在线观看免费| 久久久国产一区二区三区四区小说 | 欧美裸体bbwbbwbbw| 免费高清在线一区| 国产视频911| 97se亚洲国产综合自在线| 一区二区成人在线观看| 91精品国产高清一区二区三区 | 成人av网站在线| 亚洲午夜av在线| 欧美va在线播放| 不卡的av电影| 午夜激情久久久| 久久人人超碰精品| 色综合久久综合网| 美腿丝袜亚洲色图| 国产精品福利一区二区三区| 在线不卡一区二区| 国产一本一道久久香蕉| 一级精品视频在线观看宜春院| 91精品国模一区二区三区|