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

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

?? kbd.c

?? EP9315 BSP for WinCE 源代碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
//**********************************************************************
// 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.
// Copyright(c) Cirrus Logic Corporation 2001, All Rights Reserved                       
//
//   File: kbd.c      Module: keyboard driver
//
//   Revision:
//
//   Synopsis: Low level keyboard drivers. This file provides the common control
//             of the keyboard hardware. 
//             Most of these methods are exposed for external access.
//             These driver methods must be supported at an OS driver level.
//
// EXAMPLE:
//               void kbd_main(void)
//               {
//                   byte rr1,rr2,cc1,cc2;
//
//                   GKBD_SetDebounce(0xfc);
//                   GKBD_SetPreScale(0xfa);
//
//                   rr1=GKBD_GetLastR1();
//                   rr2=GKBD_GetLastR2();
//                   cc1=GKBD_GetLastC1();
//                   cc2=GKBD_GetLastC2();
//
//                   // initialize the keyboard device
//                   GKBD_Enable(TRUE);
//                         
//                   // loop
//                   while (1)   
//                   {
//                       byte r1 = GKBD_GetLastR1();
//                       byte r2 = GKBD_GetLastR2();
//                       byte c1 = GKBD_GetLastC1();
//                       byte c2 = GKBD_GetLastC2();
//
//                       if ((rr1!=r1 || cc1!=c1) &&
//                           (rr2!=r2 || cc2!=c2))
//                       {
//                           rr1=r1;
//                           cc1=c1;
//                           rr2=r2;
//                           cc2=c2;
//                       }
//                   }
//
//
//                   return;
//               }
//
//
//**********************************************************************


/*=============================================================================
                   > INCLUDE FILES <
-----------------------------------------------------------------------------*/
#include <windows.h>
#include <hwdefs.h>
#include <haluser.h>

#include "kbd.h"    // keyboard defines and structures

/*=============================================================================
               > DEFINITIONS LOCAL TO THIS FILE <
-----------------------------------------------------------------------------*/

/*=============================================================================
           > FUNCTION PROTOTYPES LOCAL TO THIS FILE <
-----------------------------------------------------------------------------*/
static unsigned char KBD_IsIrqActive(unsigned long result);
static unsigned char KBD_IsOneKey(unsigned long result);
static unsigned char KBD_IsTwoKey(unsigned long result);
static unsigned char KBD_GetFirstRow(unsigned long result);
static unsigned char KBD_GetSecondRow(unsigned long result);
static unsigned char KBD_GetFirstCol(unsigned long result);
static unsigned char KBD_GetSecondCol(unsigned long result);

/*=============================================================================
                > STRUCTURES LOCAL TO THIS FILE <
-----------------------------------------------------------------------------*/

/*=============================================================================
            > DATA DECLARATIONS LOCAL TO THIS FILE <
-----------------------------------------------------------------------------*/
static unsigned char g_nFirstRow=0,g_nFirstCol=0;
static unsigned char g_nSecondRow=0,g_nSecondCol=0;
static unsigned char g_bNoKey=FALSE;




//****************************************************************************
// GKBD_HandleIrq
//****************************************************************************
// This should be called as the IRQ handler. This function  will grab and 
// store button press results, check and  make sure values are correct
// and reset the IRQ so that other KBD events can be processed. 
//
void GKBD_HandleIrq( void )
{
    //
    // get the keypress results register
    //
    unsigned long result = *KEYBOARD_KEYREG;

    //
    // if a IRQ was signaled by this device
    //
    if (KBD_IsIrqActive(result))
    {
        // if two keys were pressed at the same time
        // we need to grab the second keypress first.
        // while this is not a requirement, it is
        // just done this why to make the code
        // expediant
        if (KBD_IsTwoKey(result))
        {
            // get the second key values
            g_nSecondRow=KBD_GetSecondRow(result)+1;
            g_nSecondCol=KBD_GetSecondCol(result)+1;
        }
        // make sure that the first keypress
        // is available
        else if (!KBD_IsOneKey(result))
        {
            g_bNoKey=TRUE;

            // get the second key values
            g_nSecondRow=0;
            g_nSecondCol=0;
            
            return;
        }

        // get the first key press
        g_nFirstRow=KBD_GetFirstRow(result)+1;
        g_nFirstCol=KBD_GetFirstCol(result)+1;

        // set global marker that no keys
        // are currently pressed
        g_bNoKey=FALSE;
    }

    return;
}

//****************************************************************************
// GKBD_Enable
//****************************************************************************
// Sets bState to TRUE or FALSE. This function is used to enable the keypad 
// IRQ only.
//
void GKBD_Enable
(
    unsigned char bState // TRUE = enable IRQ handling, FALSE for not
)
{

	if( bState ) 
	{
		HalWriteCommonReg( CSC_KTDIV, KTDIV_KEN, KTDIV_KEN );
//		*CSC_KTDIV |= KTDIV_KEN;
	}
	else
	{
		HalWriteCommonReg( CSC_KTDIV, KTDIV_KEN, 0 );
//		*CSC_KTDIV &= (~KTDIV_KEN );
	}

    // set KBD bit int IRQ mask

    /*
    if (bState)
        *IRQ_MASK_A |= INT_KBD;
    else
        *IRQ_MASK_A &= ~INT_KBD;
    */

    return;
}


//****************************************************************************
// GKBD_SetDebounce
//****************************************************************************
// This function is used to preload the de-bounce counter.   The de-bounce 
// counter counts the number of consectutive scans that decoded the same keys. 
// Terminal count for the  de-bounce counter is 0xff. Terminal count indirectly 
// generates key scan interrupt. A pre-load value of 0xfc  will cause the 
// key scan circuitry to count 3 identical  consecutive keypad scans.
//
void GKBD_SetDebounce
(
    unsigned char nDebounce // debounce value in scan counts 
)
{
    unsigned long nValue=0;
    unsigned long nResult = *KEYBOARD_SCANINIT;

    //
    // mask off any bits higher then the 8th bit
    //
    nDebounce &= 0xff;

    //
    // move "passed" debounce value into internal storage
    //
    nValue |= nDebounce;
    
    //
    // move our new value into the low byte of the high word 
    //
    nValue <<= 16;

    //
    // clear bits
    //
    nResult &= ~nValue;

    //
    // OR our new debounce value into the results value
    //
    nResult |= nValue;

    //
    // set the return results
    //
    *KEYBOARD_SCANINIT = nResult;

    return;
}


//****************************************************************************
// GKBD_GetDebounce
//****************************************************************************
// This function is used to get the de-bounce scan counter.
// refer to GKBD_SetDebounce for a full explaination of the
// debounce value.
//
//
unsigned char GKBD_GetDebounce (void)
{
    unsigned long result = *KEYBOARD_SCANINIT;

    // shift upper 16 bits into lower
    result >>= 16;

    // mask out any unwanted bits
    result &= 0xff;

    return ((unsigned char)result);
}


//****************************************************************************
// GKBD_Enable3KeyReset
//****************************************************************************
// Use this method to predefined three-key reset feature. This will 
// allow/protect a three-key press used to  signal the internal watchdog for 
// a complete system reset.
//
   
void GKBD_Enable3KeyReset
(
    unsigned char bState // set to TRUE to enable, and FALSE to disable
)
{
#if 0
    unsigned long nResult = KBD_GetRegisterValue(KBD_SCANINIT);

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
7777精品伊人久久久大香线蕉的 | 午夜精品久久久久久久99水蜜桃| 欧美一级在线观看| 一本久久a久久免费精品不卡| 国产一区二区三区观看| 国产精品乡下勾搭老头1| 麻豆精品在线观看| 天天操天天综合网| 免费在线看成人av| 国产999精品久久久久久绿帽| 成人综合日日夜夜| 在线免费观看日本一区| 色综合久久久久| 7777精品伊人久久久大香线蕉| 色88888久久久久久影院按摩| 欧美美女bb生活片| 久久蜜桃一区二区| 一区二区中文字幕在线| 一区二区三区丝袜| 日韩中文字幕区一区有砖一区| 免费观看30秒视频久久| 成人毛片在线观看| 日韩一区国产二区欧美三区| 国产欧美一区二区三区鸳鸯浴| 国产日韩综合av| 天天亚洲美女在线视频| jlzzjlzz国产精品久久| 欧美日韩大陆一区二区| 久久午夜羞羞影院免费观看| 亚洲视频在线观看一区| 国产一区二区影院| 在线不卡a资源高清| 1024成人网色www| 国产在线精品免费| 欧美浪妇xxxx高跟鞋交| 国产精品久久久久久久久免费樱桃| 久久精品国产久精国产| 欧美日韩高清一区二区三区| 一区二区三区在线看| 国产美女娇喘av呻吟久久| 欧美日韩视频一区二区| 亚洲一二三区在线观看| 成人动漫一区二区| 久久久久久久久久久久电影| 极品少妇一区二区三区精品视频| 日韩视频一区二区三区在线播放| 亚洲v中文字幕| 91极品美女在线| 亚洲色图清纯唯美| 91视频一区二区三区| 亚洲欧洲制服丝袜| 在线不卡的av| 麻豆精品在线播放| 日韩一区二区三区电影| 韩国欧美一区二区| 国产精品久久久久久户外露出| 国产成人精品亚洲日本在线桃色| 久久婷婷久久一区二区三区| 极品美女销魂一区二区三区免费 | 亚洲综合成人在线| 欧美三级三级三级| 日韩电影在线一区二区| 欧美一级精品在线| 国产不卡高清在线观看视频| 中文字幕不卡在线| 欧美精品久久99久久在免费线| 美腿丝袜亚洲一区| 久久老女人爱爱| 99久久精品免费| 国产一区 二区 三区一级| 国产精品久久久久久久久快鸭 | 日韩和欧美的一区| www日韩大片| 99久久精品国产毛片| 日韩成人午夜精品| 国产精品久久久久久亚洲毛片| 在线观看www91| 国产一区美女在线| 亚洲一区二区三区视频在线 | 亚洲精品视频在线观看免费| 欧美精品在线观看播放| 国产精品综合视频| 日日摸夜夜添夜夜添亚洲女人| 性久久久久久久| 欧美一级欧美三级| 国产美女视频一区| 日韩国产一二三区| 亚洲欧美欧美一区二区三区| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 色婷婷久久久综合中文字幕| 国产麻豆精品在线观看| 美国毛片一区二区| 精一区二区三区| 日韩精品电影在线观看| 午夜精品一区二区三区三上悠亚| 亚洲特黄一级片| 国产精品免费观看视频| 亚洲国产精品传媒在线观看| 日本一区二区三区四区 | 在线日韩国产精品| 欧美人动与zoxxxx乱| 欧美视频在线播放| 91精品国产综合久久久久久| 51久久夜色精品国产麻豆| 久久影院视频免费| 久久精品这里都是精品| 国产片一区二区| 亚洲第一搞黄网站| 奇米影视在线99精品| 国产麻豆日韩欧美久久| 欧美性受xxxx黑人xyx性爽| 91精品国产综合久久蜜臀 | 1024成人网| 视频一区中文字幕国产| 国产a精品视频| 欧美日韩精品免费观看视频| 99久久er热在这里只有精品15 | 91精品中文字幕一区二区三区| 欧美日韩和欧美的一区二区| 日韩免费电影网站| 又紧又大又爽精品一区二区| 日韩精品一二区| 日本韩国欧美三级| 久久久久久久免费视频了| 日韩影视精彩在线| 91在线精品一区二区| 久久青草国产手机看片福利盒子| 一级中文字幕一区二区| 国产a久久麻豆| 久久久精品天堂| 色婷婷综合在线| 国产亚洲人成网站| 国产精品久久久久久久久快鸭| 蜜桃精品视频在线观看| 欧美色图片你懂的| 亚洲成人自拍一区| 欧美伦理影视网| 亚洲成人www| 欧美三级电影在线看| 首页亚洲欧美制服丝腿| 欧美日韩一本到| 亚洲v中文字幕| 精品久久人人做人人爰| 成人午夜免费视频| 一区二区三区欧美激情| 欧美性xxxxxx少妇| 蜜桃久久久久久| 亚洲美女在线国产| 日韩女同互慰一区二区| 美女被吸乳得到大胸91| 2021中文字幕一区亚洲| 91免费视频观看| 免费不卡在线视频| 国产精品美女久久久久aⅴ国产馆| 欧美在线999| 国产69精品久久99不卡| 亚洲免费观看高清完整版在线观看熊| 欧洲一区二区三区免费视频| 黄页网站大全一区二区| 综合激情成人伊人| 99re8在线精品视频免费播放| 亚洲欧美日韩中文字幕一区二区三区| 色哟哟国产精品| 国产精品 欧美精品| 亚洲一区二区3| 国产欧美日韩卡一| 国产香蕉久久精品综合网| 欧美伦理视频网站| 色狠狠色噜噜噜综合网| 国产在线一区观看| 激情深爱一区二区| 日韩成人一级大片| 日韩国产一二三区| 另类小说视频一区二区| 午夜视黄欧洲亚洲| 亚洲免费看黄网站| 亚洲综合偷拍欧美一区色| 国产欧美日韩三区| 综合网在线视频| 视频一区二区三区中文字幕| 性感美女极品91精品| 亚洲国产欧美日韩另类综合 | 亚洲综合丁香婷婷六月香| 亚洲欧美一区二区视频| 久久青草国产手机看片福利盒子| 欧美一区二区成人6969| 久久久不卡网国产精品一区| 久久亚洲二区三区| 国产精品色一区二区三区| 国产精品国产自产拍高清av王其| 亚洲最新视频在线观看| 亚洲一区二区三区美女| 日韩 欧美一区二区三区| 成人免费福利片| 色婷婷精品大在线视频| 日韩视频免费观看高清在线视频| 欧美国产精品一区二区| 亚洲精选免费视频| 久久99精品一区二区三区三区| 波多野结衣中文字幕一区二区三区|