hal.c

来自「epson 13506 driver code」· C语言 代码 · 共 94 行

C
94
字号
/*
**===========================================================================
** HAL.C
**---------------------------------------------------------------------------
** Copyright (c) 1997, 2001 Epson Research and Development, Inc.
** All Rights Reserved.
**===========================================================================
*/

#if defined(INTEL_W32) || defined(INTEL_DOS)
#include <stdio.h>
#endif

#include "hal.h"
#include "assert.h"
#include "nonsefns.h"

/*-----------------------------------------------------------------------*/

static const char Revision[] = "HAL.C=$Revision: 33 $";

/*-----------------------------------------------------------------------*/

static const char szHalVersion[] = " 13506 HAL Version ";
static const char szVersion[SIZE_VERSION]    = "2.12";
static const char szStatus[SIZE_STATUS]      = "";

#ifdef INTEL_DOS
static const char szRevision[SIZE_REVISION]  = "-DOS";
#else
static const char szRevision[SIZE_REVISION]  = "";
#endif

LPHAL_STRUCT _HalInfo;

/*-----------------------------------------------------------------------*/

/*
**	seGetHalVersion()
**
**	This routine returns the HAL version, the release status and
**	the release status version.
*/
void seGetHalVersion( const char **pVersion, const char **pStatus, const char **pRevision )
{
	*pVersion  = szVersion;
	*pStatus   = szStatus;
	*pRevision = szRevision;
}

/*-----------------------------------------------------------------------*/

/*
**	seGetID()
**
**	This routine reads the 13XX revision code register and determines the 
**	video controller.
**
**	Currently there is no need to differentiate between chip revisions.
*/
int seGetId( int *pId )
{
	unsigned val;

	val = seReadRegByte(REG_REVISION_CODE);

	/*
	** If this is a 13506 then check for the revision.
	*/
	if (0x10 == (val & 0xFC))
	{
		switch (val & 0x03)
		{
			case 0:
				*pId = ID_S1D13506_REV0;
				return ERR_OK;

         case 1:
				*pId = ID_S1D13506_REV1;
				return ERR_OK;

			default:
				*pId = ID_UNKNOWN;
            return ERR_UNKNOWN_DEVICE;
		}
	}

	*pId = ID_UNKNOWN;
	return ERR_UNKNOWN_DEVICE;
}

/*-------------------------------------------------------------------------*/

⌨️ 快捷键说明

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