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

📄 arm_clcd.cpp

📁 ARM9基于WINDOWSCE的BSP源代码
💻 CPP
字号:
/*++
*
* 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) 1995-1998  Microsoft Corporation
*
* Release Status:OS005-SW-70002-r0p0-00REL0
* $Copyright: 
* ----------------------------------------------------------------
* This confidential and proprietary software may be used only as
* authorised by a licensing agreement from ARM Limited
*   (C) COPYRIGHT 2004 ARM Limited
*       ALL RIGHTS RESERVED
* The entire notice above must be reproduced on all authorised
* copies and copies may only be made to the extent permitted
* by a licensing agreement from ARM Limited.
* ----------------------------------------------------------------
* File:     arm_clcd.cpp,v
* Revision: 1.2
* ----------------------------------------------------------------
* $
*
* Module Name:  
*    arm_clcd.cpp
*
* Abstract:  
*   Implementation of CLCD GPE class. 
*
--*/
#include "precomp.h"    /* define header files */
#include "palette.h"    /* a sample palette table for 8 bit color */

// Declare an external function, other external functions are declared in 
//  dispdrvr.h
extern "C" void DispDrvrSetupPalette();

// Macro defined in palette.h to utilise the example palatte table 
INSTANTIATE_PALETTE                                                             
   
// Start with Errors, warnings, and temporary messages - For DEBUGZONE
INSTANTIATE_GPE_ZONES(0x3,"GDI Driver","unused1","unused2")

// Main entry point for a GPE-compliant driver
static GPE *pGPE = (GPE *)NULL;
GPE *GetGPE()
{

    if( !pGPE )
    {
        // The default with no arguments is 240x320 16bpp
        pGPE = new Arm_clcd(DispDrvr_cxScreen,DispDrvr_cyScreen,16);    
    }
    
    if ( pGPE == NULL )
    {
        ERRORMSG(1, (TEXT("GPE: GPE derived Arm_clcd class instantiation failed! Driver aborted!\r\n")));
        return NULL;
    }
    
    return pGPE;
}


// Constructor
Arm_clcd::Arm_clcd(int display_width, int display_height, int bpp)
{
    DEBUGMSG( GPE_ZONE_INIT,(TEXT("Arm_clcd::Arm_clcd %3d x %3d @ %d bpp\r\n"),
            display_width,display_height,bpp));
	RETAILMSG( 1,(TEXT("Arm_clcd::Arm_clcd %3d x %3d @ %d bpp\r\n"),
            display_width,display_height,bpp));
   //DispDrvr_cx(y)Screen is Screen size 640*480  (noted by ww)
   
    if (display_width > DispDrvr_cxScreen || display_height > 
      DispDrvr_cyScreen || (bpp != 8 && bpp != 16)){
        RETAILMSG (1,(TEXT("Error: Wrong Arm_clcd setting, using default one\r\n")));
        display_width = 240;
        display_height = 320;
        bpp = 16;
    }

    //set value of screen size for GPE base class (w)
    m_nScreenWidth = display_width;
    m_nScreenHeight = display_height;
    // To tell DispDrvrInitialize() the color depth.  (cx*bpp/32 word???)
    DispDrvr_cdwStride = DispDrvr_cxScreen * bpp / 32; 
    DispDrvrInitialize();   // do initialization on CLCD control and timing registers
                            // physical plane size is 640 x 480 for SHARP 8.4 TFT   
    
    m_ModeInfo.modeId = 0;
    m_ModeInfo.width = m_nScreenWidth; // Windows

⌨️ 快捷键说明

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