⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 kbd.cpp

📁 Microsoft WinCE 6.0 BSP FINAL release source code for use with the i.MX27ADS TO2 WCE600_FINAL_MX27_S
💻 CPP
字号:
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this source code is subject to the terms of the Microsoft 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 LICENSE.RTF on your
// install media.
//
//------------------------------------------------------------------------------
//
// Copyright (C) 2006, Freescale Semiconductor, Inc. All Rights Reserved.
// THIS SOURCE CODE, AND ITS USE AND DISTRIBUTION, IS SUBJECT TO THE TERMS
// AND CONDITIONS OF THE APPLICABLE LICENSE AGREEMENT
//
//------------------------------------------------------------------------------

//------------------------------------------------------------------------------
//
//  File:  kbd.c
//
//  Implementation of keyboard entry point
//
//------------------------------------------------------------------------------
#include <windows.h>
#include <ceddk.h>
#include <keybddbg.h>
#include <keybdpdd.h>
#include "keypad.hpp"
#include "csp.h"


//------------------------------------------------------------------------------
// External Functions
extern BOOL BSPKppPowerOn();

//------------------------------------------------------------------------------
// External Variables
extern "C" DBGPARAM dpCurSettings;


//------------------------------------------------------------------------------
// Defines
#define ZONEID_PDD         7
#define ZONEID_FUNCTION    13
#define ZONEMASK_PDD       (1 << ZONEID_PDD)
#define ZONEMASK_FUNCTION  (1 << ZONEID_FUNCTION)


//------------------------------------------------------------------------------
// Types


//------------------------------------------------------------------------------
// Global Variables
UINT v_uiPddId;
PFN_KEYBD_EVENT v_pfnKeybdEvent;


//------------------------------------------------------------------------------
// Local Variables


//------------------------------------------------------------------------------
// Local Functions

void WINAPI KeybdPdd_PowerHandler(BOOL bOff);


//------------------------------------------------------------------------------
//
// Function: KPP_PowerHandler
//
// Called from layout manager MDD to power up or down the keypad.
//
// Parameters:
//      uiPddId -
//          [in] PDD id value.
//
//      fTurnOff -
//          [in] If TRUE, request to turn power off.
//               If FALSE, request to turn power on.
//
// Returns:
//      None.
//
//------------------------------------------------------------------------------
static void WINAPI KPP_PowerHandler(UINT uiPddId, BOOL fTurnOff)
{
    KeybdPdd_PowerHandler(fTurnOff);
}


static KEYBD_PDD KPPPdd = {
    KPP_PDD,
    _T("KPPLayout"),
    KPP_PowerHandler,
    NULL
};


//------------------------------------------------------------------------------
//
// Function: KPP_Entry
//
// Entry function for the keypad PDD.
//
// Parameters:
//      uiPddId -
//          [in] PDD id value.
//
//      pfnKeybdEvent -
//          [in] When the PDD's IST executes, the IST sends the current
//          keyboard event to the keyboard Layout Manager through the
//          pfnKeybdEvent callback function that the Layout Manager
//          identifies to the PDD's entry function.
//
//      ppKeybdPdd -
//          [out] Set to KEYBD_PDD structure for KPP.
//
//
// Returns:
//      TRUE is success, FALSE if failure.
//
//------------------------------------------------------------------------------
BOOL WINAPI KPP_Entry(UINT uiPddId, PFN_KEYBD_EVENT pfnKeybdEvent,
                      PKEYBD_PDD *ppKeybdPdd)
{
    SETFNAME(_T("KPP_Entry"));

    BOOL fRet = FALSE;

    KPP_FUNCTION_ENTRY();

    v_uiPddId = uiPddId;
    v_pfnKeybdEvent = pfnKeybdEvent;

    // dpCurSettings.ulZoneMask |= ZONEMASK_PDD;

    DEBUGMSG(ZONE_INIT, (_T("%s: Initialize KPP ID %u\r\n"), pszFname,
        uiPddId));
    DEBUGCHK(ppKeybdPdd != NULL);

    *ppKeybdPdd = &KPPPdd;

    // We always assume that there is a keyboard.
    if (KppInitialize())
    {
        KppIsrThreadStart();
    }
    else
    {
        ERRORMSG(1,(TEXT("Could not initialize keypad.\r\n")));
    }

    BSPKppPowerOn();

    fRet = TRUE;

    KPP_FUNCTION_ENTRY();

    return fRet;
}
#ifdef DEBUG
// Verify function declaration against the typedef.
static PFN_KEYBD_PDD_ENTRY v_pfnKeybdEntry = KPP_Entry;
#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -