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

📄 chiplib.c

📁 用C语言设计的EPSON LCD控制器S1D13700驱动。
💻 C
字号:
//===========================================================================
// chiplib.c
//
// For this file, set tabs to 4 spaces.
//---------------------------------------------------------------------------
//
//	Copyright (c) 2003 Epson Research and Development, Inc.
//	All Rights Reserved.
//
//===========================================================================

#include <string.h>
#include "hal.h"
#include "chiplib.h"

//
// Application MUST always call InitChipLib() when starting up.
//
static Boolean gfUsing13700 = FALSE;
static Boolean gfUsing13714 = FALSE;
static Boolean gfUsing13715 = FALSE;
static Boolean gfUsing13721 = FALSE;


//---------------------------------------------------------------------------
//	FUNCTION:		InitChipLib()
//---------------------------------------------------------------------------

void InitChipLib(void)
{
	gfUsing13700 = !strcmp(HalInfo.szChipId,"13700");
}


//---------------------------------------------------------------------------
//	FUNCTION:		is13721Chip()
//---------------------------------------------------------------------------

Boolean is13700Chip(void)
{
	return gfUsing13700;
}

//---------------------------------------------------------------------------
//	FUNCTION:		GetChipName()
//---------------------------------------------------------------------------

char *GetChipName(void)
{
	return HalInfo.szChipId;
}

//---------------------------------------------------------------------------
//	FUNCTION:		GetChipId()
//---------------------------------------------------------------------------

void GetChipId(UInt32 *pProductCode, UInt32 *pRevisionCode)
{
	// Dummy codes
	*pProductCode = 0xff;
	*pRevisionCode = 0xff;
}


//---------------------------------------------------------------------------
//	FUNCTION:		GetMemSize()
//---------------------------------------------------------------------------

UInt32 GetMemSize(void)
{
	return (32768UL);
}




//---------------------------------------------------------------------------
//	FUNCTION:		SetBitsPerPixel()
//---------------------------------------------------------------------------

void SetBitsPerPixel( UInt8 bpp )
{
	halWriteReg8( REG0020_GRAYSCALE_P1, bpp );
	return;
}


//---------------------------------------------------------------------------
//	FUNCTION:		GetBitsPerPixel()
//---------------------------------------------------------------------------

UInt8 GetBitsPerPixel( void )
{
	UInt8	reg;

	reg = (UInt8)( halReadReg8( REG0020_GRAYSCALE_P1 ) & 3);

	switch( reg )
	{
		default:
		case  0:	return  1;
		case  1:	return  2;
		case  3:	return  4;
	}
}



//---------------------------------------------------------------------------
//	FUNCTION:		GetMemAddress()
//---------------------------------------------------------------------------

UInt32 GetMemAddress(UInt32 BaseAddress)
{
	return BaseAddress;
}



//---------------------------------------------------------------------------
//	FUNCTION:		GetDisplayWidth()
//---------------------------------------------------------------------------

UInt8 GetDisplayWidth( void )
{
	UInt8	width=0;
	return width;
}

//---------------------------------------------------------------------------
//	FUNCTION:		GetDisplayHeight()
//---------------------------------------------------------------------------

UInt8 GetDisplayHeight( void )
{
return 8;
}




//----------------------------------------------------------------------------
// GetPClkDivide()
//----------------------------------------------------------------------------

UInt8 GetPClkDivide(void)
{
	return 1;//return ((halReadReg16(REG0030_LCDINTCLOCK) & 0x0f) + 1) * 2;
}

//----------------------------------------------------------------------------
// GetFrameRate()
//
// Note that GetFrameRate() is synchronized with the same function in chipdef.cpp
//----------------------------------------------------------------------------

UInt32 GetFrameRate(void)
{

	return 0;
}

//----------------------------------------------------------------------------
// GetSystemClkDivide()
//----------------------------------------------------------------------------

UInt8 GetSystemClkDivide(void)
{
	return 0;//(halReadReg16(REG0018_SYSCLK) & 0x03) + 1;
}



//----------------------------------------------------------------------------
// GetPClkFreq()
//----------------------------------------------------------------------------

UInt32 GetPClkFreq(void)
{
	return 0;// GetSystemClock(NULL) / GetPClkDivide();
}




















//----------------------------------------------------------------------------
// SetLutBypassEnable()
//----------------------------------------------------------------------------



//---------------------------------------------------------------------------
//  FUNCTION: isHostIndirectInterface()
//---------------------------------------------------------------------------
Boolean isHostIndirectInterface( void )
{
//	HostTypeDef ht = GetHostInterfaceType();
//	return ( ht==cl_HOSTTYPE_INDIRECT68 || ht==cl_HOSTTYPE_INDIRECT80_TYPE1 || ht==cl_HOSTTYPE_INDIRECT80_TYPE2 || ht==cl_HOSTTYPE_INDIRECT80_TYPE3 );
	return ( (HalInfo.dwFlags & fINDIRECT_INTERFACE) != 0 );	// Do it this was as per Juro's request.
}




⌨️ 快捷键说明

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