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

📄 hal.c

📁 一个图形显示芯片s1d13505的应用程序
💻 C
字号:
/*
**===========================================================================
**	HAL.C
**---------------------------------------------------------------------------
**
** Copyright (c) 1997, 2001 Epson Research and Development, Inc.
** All Rights Reserved.
**
**===========================================================================
*/

#ifdef INTEL
#include <stdio.h>
#endif

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

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

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

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

static const char szHalVersion[] = " 13505 HAL Version ";
static const char szVersion[SIZE_VERSION]    = "2.10";
static const char szStatus[SIZE_STATUS]      = "";
static const char szRevision[SIZE_REVISION]  = "";

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

/*
**	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;
}

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

/*
** seGetLibseVersion()          
**
** This function is defined in both LIBSE and the HAL libraries.
** Since LIBSE is only used for non-Intel platforms, Intel applications
** will receive an error from seGetLibseVersion().
** 
*/
#ifdef INTEL
int seGetLibseVersion(int *ver)
   {
   *ver = 0;
   return ERR_FAILED;
   }
#endif

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

/*
**	seGetChipID()
**
**	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 seReserved1, int *pId )
{
	int val;
   BYTE bVal;

	ASSERT( 0 == seReserved1 );

	DPF( In seGetChipID() );

   /*
    * Enable Host Interface
    */

   /*
   ** After reset, the 13505 card begins in HW suspend mode.
   ** This mode must be cancelled before continuing.
   */
   seHWSuspend(seReserved1, FALSE);

   /*
    * Miscellaneous Disable Register
    * REG[1Bh]
    */
   seGetReg(seReserved1, REG_MISC, &bVal);
   seSetReg(seReserved1, REG_MISC, (BYTE) (bVal & ~0x80));  /* clear bit 7 */

   CheckMemory(seReserved1);

	val = ReadRegister( seReserved1, REG_REVISION_CODE );

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

			default:
				*pId = ID_S1D13505;
				return ERR_OK;
		}
	}

	*pId = ID_UNKNOWN;
	return ERR_UNKNOWN_DEVICE;
}

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

⌨️ 快捷键说明

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