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

📄 pcmciawin.h

📁 Microsoft WinCE 6.0 BSP FINAL release source code for use with the i.MX27ADS TO2 WCE600_FINAL_MX27_S
💻 H
字号:
/*
 *
 * Copyright (C) 2003-2004, MOTOROLA, INC. All Rights Reserved
 * THIS SOURCE CODE IS CONFIDENTIAL AND PROPRIETARY AND MAY NOT
 * BE USED OR DISTRIBUTED WITHOUT THE WRITTEN PERMISSION OF
 * MOTOROLA, INC.
 *
 * Copyright (C) 2004-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 	
 *
 */
 
#ifndef __PCMCIAWIN_H_
#define __PCMCIAWIN_H_

/*+Public include files******************************************************
 Include any files to export any inherited data type *necessary* needed by 
 client to use the services of this module.  Files which are included for
 internal use within this module should be done in a later section, and should
 *not* be exported un-necessarily.
**************************************************************************-*/
#include <windows.h>
#include <types.h>
#include <socksv2.h>
#include <memory.h>
#include <ceddk.h>
#include <resmgr.h>

#include "socket.h"
#include "pcmciasock.h"

/*+Public Macro definitions**************************************************
 Define all public macros or macros to be used only within the module for 
 bootstapping the definitions of other items
**************************************************************************-*/

/*+Public Type definitions***************************************************
 Define all types which will be exported from this module.  Type definitions
 to be used within the module should be defined in the later section.
**************************************************************************-*/

class CPcmciaMemWindows : public CPcmciaMemWindowImpl<CPcmciaSocket>
{
public:
                    CPcmciaMemWindows( CPcmciaSocket* pPcmSocket,
                                       DWORD dwWinIndex,
                                       const SS_WINDOW_STATE* pcWindowState,
                                       const SS_WINDOW_INFO* pcWindowInfo );
                    ~CPcmciaMemWindows();

protected:
    virtual void    FreeResources();
    virtual void    DisableWindow();
    virtual void    ProgramWindow();
    virtual DWORD   GetNewOffset( PSS_WINDOW_STATE pWindowState );
    virtual DWORD   GetNewLength( PSS_WINDOW_STATE pWindowState,
                                  DWORD dwNewOffset );
    virtual BOOL    GetBaseAddress( PSS_WINDOW_STATE pWindowState,
                                    DWORD dwNewOffset,
                                    DWORD dwNewLength,
                                    DWORD& dwNewBaseAddress );

    BYTE            m_uEnableBit;
    WORD            m_wWinBaseOffset;
    WORD            m_wWinPageOffset;
    DWORD           m_dwBaseAddress;
};


////////////////////////////////////////////////////////////////////////////////

class CPcmciaIoWindows : public CPcmciaIoWindowImpl<CPcmciaSocket>
{
public:
                    CPcmciaIoWindows( CPcmciaSocket* pPcmSocket,
                                      DWORD dwWinIndex,
                                      const SS_WINDOW_STATE* pcWindowState,
                                      const SS_WINDOW_INFO* pcWindowInfo );
                    ~CPcmciaIoWindows();

protected:
    virtual void    FreeResources();
    virtual void    DisableWindow();
    virtual void    ProgramWindow();
    virtual DWORD   GetNewOffset( PSS_WINDOW_STATE pWindowState );
    virtual DWORD   GetNewLength( PSS_WINDOW_STATE pWindowState,
                                  DWORD dwNewOffset );
    virtual BOOL    GetBaseAddress( PSS_WINDOW_STATE pWindowState,
                                    DWORD dwNewOffset,
                                    DWORD dwNewLength,
                                    DWORD& dwNewBaseAddress );

    BYTE            m_uEnableBit;
    BYTE            m_uIoCtrlBitOffset;
    WORD            m_wIoStatEndOffset;
    WORD            m_wIoOffsetOffset;
	   DWORD           m_dwBaseAddress;
    DWORD           m_dwOffset;
};


/*+Local include files*******************************************************
 Include all files that will be used only within this module here. 
**************************************************************************-*/
#ifdef __PCMCIAWIN_CPP__
/*-------------------------- Local context - START ---------------------------*/
#define VISIBLE             /* Mark as LOCAL context */

/*+Local Macro definitions***************************************************
 Define all macros that will only be used within the module here.
**************************************************************************-*/
#define PCMCIA_MEM_WINDIOWS_BLOCK 0x1000 // PCMCIA require 4 k Alignment for this controller.
#define PCMCIA_MEM_BLOCK_ADDR_MASK (~(PCMCIA_MEM_WINDIOWS_BLOCK-1))


/*+Local function prototypes*************************************************
 Declare all proto-types for functions/procedures only used within the module.
**************************************************************************-*/

/*+Local data declarations***************************************************
 Define all data objects that will used within the module here.
**************************************************************************-*/
// Bank size value
int g_bankSizeValue[] = {
#if (MX21_TO_VER >= 30)
    // For TO3 and later, valid bank size frm: 16B - 32KB
    PCMCIA_BANKSIZE_4, PCMCIA_BANKSIZE_5,
    PCMCIA_BANKSIZE_6, PCMCIA_BANKSIZE_7, PCMCIA_BANKSIZE_8,
    PCMCIA_BANKSIZE_9, PCMCIA_BANKSIZE_10, PCMCIA_BANKSIZE_11,
    PCMCIA_BANKSIZE_12, PCMCIA_BANKSIZE_13, PCMCIA_BANKSIZE_14,
    PCMCIA_BANKSIZE_15
#elif (MX21_TO_VER >= 20)    
    // For TO2.x, valid bank size: 1B - 2KB
    PCMCIA_BANKSIZE_0, PCMCIA_BANKSIZE_1, PCMCIA_BANKSIZE_2,
    PCMCIA_BANKSIZE_3, PCMCIA_BANKSIZE_4, PCMCIA_BANKSIZE_5,
    PCMCIA_BANKSIZE_6, PCMCIA_BANKSIZE_7, PCMCIA_BANKSIZE_8,
    PCMCIA_BANKSIZE_9, PCMCIA_BANKSIZE_10, PCMCIA_BANKSIZE_11     
#else
    // For TO1.x, valid bank size: 1B - 64MB     
    PCMCIA_BANKSIZE_0, PCMCIA_BANKSIZE_1, PCMCIA_BANKSIZE_2,
    PCMCIA_BANKSIZE_3, PCMCIA_BANKSIZE_4, PCMCIA_BANKSIZE_5,
    PCMCIA_BANKSIZE_6, PCMCIA_BANKSIZE_7, PCMCIA_BANKSIZE_8,
    PCMCIA_BANKSIZE_9, PCMCIA_BANKSIZE_10, PCMCIA_BANKSIZE_11,
    PCMCIA_BANKSIZE_12, PCMCIA_BANKSIZE_13, PCMCIA_BANKSIZE_14,
    PCMCIA_BANKSIZE_15, PCMCIA_BANKSIZE_16, PCMCIA_BANKSIZE_17,
    PCMCIA_BANKSIZE_18, PCMCIA_BANKSIZE_19, PCMCIA_BANKSIZE_20,
    PCMCIA_BANKSIZE_21, PCMCIA_BANKSIZE_22, PCMCIA_BANKSIZE_23,
    PCMCIA_BANKSIZE_24, PCMCIA_BANKSIZE_25, PCMCIA_BANKSIZE_26
#endif
};



/*-------------------------- Local context - END ---------------------------*/
#else // !__PCMCIAWIN_CPP__
#define VISIBLE extern      /* Mark as GLOBAL context */
#endif //__PCMCIAWIN_CPP__

/*------------------------- Global context - START -------------------------*/

/*+Public data declarations**************************************************
 Define all data objects that will be exported here.
**************************************************************************-*/


/*+Public function prototypes************************************************
 Define all proto-types for public functions/procedures here.
**************************************************************************-*/

/*-------------------------- Global context - END --------------------------*/
#undef VISIBLE
	
#endif //__PCMCIAWIN_H_

⌨️ 快捷键说明

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