hal.c
来自「epson公司的一个关于s1d13706的低层驱动程序」· C语言 代码 · 共 80 行
C
80 行
/*
**===========================================================================
** HAL.C
**---------------------------------------------------------------------------
** Copyright (c) 2000, 2001 Epson Research and Development, Inc.
** All Rights Reserved.
**===========================================================================
*/
#include "hal.h"
#include "assert.h"
#include "nonsefns.h"
/*-----------------------------------------------------------------------*/
static const char Revision[] = "HAL.C=$Revision: 21 $";
/*-----------------------------------------------------------------------*/
static const char szHalVersion[] = " 13706 HAL Version ";
static const char szVersion[SIZE_VERSION] = "1.05";
static const char szStatus[SIZE_STATUS] = "";
#ifdef INTEL_DOS
static const char szRevision[SIZE_REVISION] = "-D"; // -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 13706 then check for the revision.
*/
if (0x28 == (val & 0xFC))
{
*pId = val & 0x03;
return ERR_OK;
}
else
{
*pId = 0;
return ERR_UNKNOWN_DEVICE;
}
}
/*-------------------------------------------------------------------------*/
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?