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

📄 comemldv.cpp

📁 The Lite Evaluation/Demonstration Kit is intended to illustrate use of the AN3042. The AN3042 is c
💻 CPP
字号:
// comemLDv.cpp: implementation of the comemDevice class.
//
//////////////////////////////////////////////////////////////////////

#include <afx.h>			// for DEBUG_NEW (otherwise we would just include windows.h)
#include <stdio.h>
#include "comemLDv.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

CComemDevice *comemDevL[COMEM_MAX_DEVICES] = {NULL};

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CComemDevice::CComemDevice(DWORD comemIDIn)
{
   int i;
   lctl = 0;
   lint = 0;
   lhdata = 0;
   hctl = 0x0;
   hint = 0x0000;
   hldata = 0;

   physPage = 0;
   linPage = 0;

   venID = 0x12be;
   devID = 0x3042;
   comemID = comemIDIn;
   comemDevL[comemID] = this;
   for (i = 0; i < COMEM_MAX_BARS; i++)
      linBAR[i] = 0;

   // We've already filtered comemID -- no need for an error check      
   // We read all of the information from our file, not from the device. 
   // TBD -- There should be an option to poll the device first, or to not load
   //		the registers from a file.

   // If the status returns error, assume that there's no driver and continue.
   DWORD refCount;
   if(comemGetStatusL(&refCount, comemID) == NO_ERROR)
      {
      if(comemGetPCIInfoL(&(pciRegs), comemID) != NO_ERROR)
         {
	      report_error("Comem device number %x was not found.", comemID);
	      }

		  DWORD status = comemCreateBarPtrL(linBAR, comemID);
		  if (status != NO_ERROR)
			  reportErrorCode(status, "creating linear pointers to BARs.");
	   }
}

CComemDevice::~CComemDevice()
{
}

⌨️ 快捷键说明

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