亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? hal_indirect.c

?? 是一個手機功能的模擬程序
?? C
?? 第 1 頁 / 共 3 頁
字號:
//===========================================================================
//	HAL_INDIRECT.C
//
//	The routines in this file comprise the register and access methods for
//	the S1D13716.
//
//	The 13716 supports two indirect access modes (and no direct methods).
//	The modes have been labeled "Serial Indirect" and "Parallel Indirect".
//	The following text describes the access modes, from a programming
//	point of view as they pertain to accessing the 13716 mounted on a
//	S5U13716B00? evaluation board.
//
//	Regardless of the access mode the 13716 interprets the current access
//	cycle according to the state of the RS control line. On 13716 eval
//	boards the RS line is connected to Address 1. Writing to odd addresses
//	result in the RS line being pulled ???? and writing to even addresses
//	result in the RS line being pulled ????.
//
//	Parallel Indirect
//	This mode consists of two distinct cycles, address and data. When the
//	RS line is low an address cycle is performed. When the RS line is high
//	the 13716 interprets this to be a data cycle.
//
//	A typical Parallel Indirect sequence to access a control register
//	will resemble the following:
//		With RS low
//		 - Write the register LSB
//		 - Write the register MSB	// this step can be skipped if the
//									// MSB was previousley set
//		With RS high
//		 - Read/Write the register data
//
//	Serial Indirect
//	This mode uses three types of cycles. A command cycle, when RS is low
//	(valid commands consist of SER_SET_ADDR, WRITE and READ) and address or
//	data cycles when the RS line is high.
//
//	A typical Serial Indirect sequence to access a control register
//	will resemble the following:
//		With RS low
//		 - SER_SET_ADDR
//		With RS high
//		 - Write the Addr LSB 		// Write the address
//		 - Write the Addr MSB		// this step can be skipped if the
//									// MSB was previously set
//		With RS low
//		 - WRITE					// Inform the system we want to write data
//		With RS high
//		 -  Read/Write register data
//---------------------------------------------------------------------------
//  Copyright (c) 2003 Epson Research and Development, Inc.
//  All Rights Reserved.
//===========================================================================
// (Tabs set to every 4)

#include "hal.h"
#include "hal_platform.h"
#include "hal_private.h"
#include "hal_indirect.h"

HALIND_STRUCT HalIndInfo;			// HAL indirect pointers structure.

UInt16 tmplword,tmphword;
UInt8 tmplbyte,tmphbyte;

UInt16 swap16addr( in UInt16 Value )
{
	return (UInt16)( ((Value>>8)&0x00FF) | ((Value&0x00FF)<<8) );
}




//---------------------------------------------------------------------------
// INDIRECT FUNCTION: halpIndirectInit() - Initialize HAL to communicate using indirect interface
//---------------------------------------------------------------------------
void halpIndirectInit( UInt32 RegAddr )
{
	HalIndInfo.pIndex8	= (pvUInt8)(RegAddr + 0);

	HalIndInfo.pData8	= (pvUInt8)(RegAddr + 3);	/* A1 for RS signal */


	HalIndInfo.pIndex16	= (pvUInt16)(RegAddr + 0);

	HalIndInfo.pData16	= (pvUInt16)(RegAddr + 3);



#if 0
	HalIndInfo.pIndex8	= (pvUInt8)(RegAddr + 0);
#ifdef EPSON_ORIGINAL	
	HalIndInfo.pData8	= (pvUInt8)(RegAddr + 3);
#else
	HalIndInfo.pData8	= (pvUInt8)(RegAddr + 2);	/* A1 for RS signal */
#endif

	HalIndInfo.pIndex16	= (pvUInt16)(RegAddr + 0);
#ifdef EPSON_ORIGINAL	
	HalIndInfo.pData16	= (pvUInt16)(RegAddr + 3);
#else
	HalIndInfo.pData16	= (pvUInt16)(RegAddr + 2);
#endif

#endif
}


//---------------------------------------------------------------------------
//	FUNCTION: halpParWriteReg8()
//
//	DESCRIPTION:
//		Writes one eight bit control register with the specified data
//		using indirect parallel I/O.
//
//	PARAMETERS:
//		index	- Register offset to write the value to
//		value	- The eight bit value to write to the register
//---------------------------------------------------------------------------
void halpParWriteReg8( UInt32 index, UInt8 value )
{
		*HalIndInfo.pIndex8= LOBYTE(index);
		*HalIndInfo.pIndex8= HIBYTE(index);

		*HalIndInfo.pData8= value;
}


//---------------------------------------------------------------------------
//	FUNCTION: halpParWriteReg16()
//
//	DESCRIPTION:
//		Writes two consective eight bit control registers with
//		one sixteen bit value using parallel indirect I/O.
//
//	PARAMETERS:
//		index	- Register offset to the LSB register
//				  The MSB of value will be written to index + 1
//		value	- The sixteen bit value to write to the registers
//---------------------------------------------------------------------------
void halpParWriteReg16( UInt32 index, UInt16 value )
{
	halSetProcessExclusivity( TRUE );

	// Read first 8-bit value.
	if (HalInfo.dwFlags & fINDIRECT_ADDR16)
		*HalIndInfo.pIndex16 = LOWORD(index);
	else
	{
		*HalIndInfo.pIndex8 = LOBYTE(index);
		*HalIndInfo.pIndex8 = HIBYTE(index);
	}
	*HalIndInfo.pData8 = LOBYTE(value);

	// Read second 8-bit value.
	index++;
	if (HalInfo.dwFlags & fINDIRECT_ADDR16)
		*HalIndInfo.pIndex16 = LOWORD(index);
	else
	{
		*HalIndInfo.pIndex8 = LOBYTE(index);
		*HalIndInfo.pIndex8 = HIBYTE(index);
	}
	*HalIndInfo.pData8 = HIBYTE(value);

	halSetProcessExclusivity( FALSE );
}


//---------------------------------------------------------------------------
//	FUNCTION: halpParWriteReg32()
//
//	DESCRIPTION:
//		Writes four consective eight bit control registers with
//		one thirty-two bit value using parallel indirect I/O.
//
//	PARAMETERS:
//		index	- Register offset to the LSB register
//				  The MSB of value will be written to index + 1 ...
//		value	- The thirty-two bit value to write to the registers
//---------------------------------------------------------------------------
void halpParWriteReg32( UInt32 index, UInt32 value )
{
	halSetProcessExclusivity( TRUE );

	// Read first 8-bit value.
	if (HalInfo.dwFlags & fINDIRECT_ADDR16)
		*HalIndInfo.pIndex16 = LOWORD(index);
	else
	{
		*HalIndInfo.pIndex8 = LOBYTE(index);
		*HalIndInfo.pIndex8 = HIBYTE(index);
	}
	*HalIndInfo.pData8 = LOBYTE(LOWORD(value));

	// Read second 8-bit value.
	index++;
	if (HalInfo.dwFlags & fINDIRECT_ADDR16)
		*HalIndInfo.pIndex16 = LOWORD(index);
	else
	{
		*HalIndInfo.pIndex8 = LOBYTE(index);
		*HalIndInfo.pIndex8 = HIBYTE(index);
	}
	*HalIndInfo.pData8 = HIBYTE(LOWORD(value));

	// Read third 8-bit value.
	index++;
	if (HalInfo.dwFlags & fINDIRECT_ADDR16)
		*HalIndInfo.pIndex16 = LOWORD(index);
	else
	{
		*HalIndInfo.pIndex8 = LOBYTE(index);
		*HalIndInfo.pIndex8 = HIBYTE(index);
	}
	*HalIndInfo.pData8 = LOBYTE(HIWORD(value));

	// Read fourth 8-bit value.
	index++;
	if (HalInfo.dwFlags & fINDIRECT_ADDR16)
		*HalIndInfo.pIndex16 = LOWORD(index);
	else
	{
		*HalIndInfo.pIndex8 = LOBYTE(index);
		*HalIndInfo.pIndex8 = HIBYTE(index);
	}
	*HalIndInfo.pData8 = HIBYTE(HIWORD(value));

	halSetProcessExclusivity( FALSE );
}


//---------------------------------------------------------------------------
//	FUNCTION: halpParReadReg8()
//
//	DESCRIPTION:
//		Reads one eight bit register and returns the value to the caller
//		using parallel indirect I/O.
//
//	PARAMETERS:
//		index	- The register offset to read data from
//
//	RETURNS:
//		The eight bit value read from the register.
//---------------------------------------------------------------------------
UInt8 halpParReadReg8( UInt32 index )
{
	UInt8 val = 0;

	*HalIndInfo.pIndex8= LOBYTE(index);
	*HalIndInfo.pIndex8= HIBYTE(index);
	
	val = *HalIndInfo.pData8;

	return val;
}


//---------------------------------------------------------------------------
//	FUNCTION: halpParReadReg16()
//
//	DESCRIPTION:
//		Reads two consective eight bit control registers and returns the
//		resulting sixteen bit value using parallel indirect I/O.
//
//	PARAMETERS:
//		index	- Register offset to the LSB register
//				  The MSB value will be read from index + 1
//
//	RETURNS:
//		The sixteen bit value read from the registers.
//---------------------------------------------------------------------------
UInt16 halpParReadReg16( UInt32 index )
{
	UInt16 val;

	halSetProcessExclusivity( TRUE );

	// Read first 8-bit value.
	if (HalInfo.dwFlags & fINDIRECT_ADDR16)
		*HalIndInfo.pIndex16 = LOWORD(index);
	else
	{
		*HalIndInfo.pIndex8 = LOBYTE(index);
		*HalIndInfo.pIndex8 = HIBYTE(index);
	}
	val = *HalIndInfo.pData8;

	// Read second 8-bit value.
	index++;
	if (HalInfo.dwFlags & fINDIRECT_ADDR16)
		*HalIndInfo.pIndex16 = LOWORD(index);
	else
	{
		*HalIndInfo.pIndex8 = LOBYTE(index);
		*HalIndInfo.pIndex8 = HIBYTE(index);
	}
	val |= (UInt16)(*HalIndInfo.pData8<<8);

	halSetProcessExclusivity( FALSE );

	return val;
}


//---------------------------------------------------------------------------
//	FUNCTION: halpParReadReg32()
//
//	DESCRIPTION:
//		Reads four consective eight bit control registers and returns the
//		resulting thirty-two bit value using parallel indirect I/O.
//
//	PARAMETERS:
//		index	- Register offset to the LSB register
//
//	RETURNS:
//		The thirty-two bit value read from the registers.
//---------------------------------------------------------------------------
UInt32 halpParReadReg32( UInt32 index )
{
	UInt16 loword, hiword;

	halSetProcessExclusivity( TRUE );

	// Read first 8-bit value.
	if (HalInfo.dwFlags & fINDIRECT_ADDR16)
		*HalIndInfo.pIndex16 = LOWORD(index);
	else
	{
		*HalIndInfo.pIndex8 = LOBYTE(index);
		*HalIndInfo.pIndex8 = HIBYTE(index);
	}
	loword = *HalIndInfo.pData8;

	// Read second 8-bit value.
	index++;
	if (HalInfo.dwFlags & fINDIRECT_ADDR16)
		*HalIndInfo.pIndex16 = LOWORD(index);
	else
	{
		*HalIndInfo.pIndex8 = LOBYTE(index);
		*HalIndInfo.pIndex8 = HIBYTE(index);
	}
	loword |= (UInt16)(*HalIndInfo.pData8<<8);

	// Read third 8-bit value.
	index++;
	if (HalInfo.dwFlags & fINDIRECT_ADDR16)
		*HalIndInfo.pIndex16 = LOWORD(index);
	else
	{
		*HalIndInfo.pIndex8 = LOBYTE(index);
		*HalIndInfo.pIndex8 = HIBYTE(index);
	}
	hiword = *HalIndInfo.pData8;

	// Read fourth 8-bit value.
	index++;
	if (HalInfo.dwFlags & fINDIRECT_ADDR16)
		*HalIndInfo.pIndex16 = LOWORD(index);
	else
	{
		*HalIndInfo.pIndex8 = LOBYTE(index);
		*HalIndInfo.pIndex8 = HIBYTE(index);
	}
	hiword |= (UInt16)(*HalIndInfo.pData8<<8);

	halSetProcessExclusivity( FALSE );

	return MAKELONG(loword, hiword);
}


//---------------------------------------------------------------------------
//	FUNCTION: halpParWriteDisplay8()
//
//	DESCRIPTION:
//		This routine writes one eight bit value to the specified display
//		memory offset using parallel indirect I/O.
//
//	PARAMETERS:
//		addr	- The offset in display memory to write the value to.
//		data	- The eight bit value to be written to display memory.
//---------------------------------------------------------------------------
void halpParWriteDisplay8( UInt32 addr, UInt8 data, UInt32 count )
{
	UInt32 loop;

	halSetProcessExclusivity( TRUE );

	SetDisplayAddrParallel(addr);
	
	for ( loop=0; loop<count; loop++ )
		*HalIndInfo.pData8 = data;

	halSetProcessExclusivity( FALSE );
}


//---------------------------------------------------------------------------
//	FUNCTION: halpParWriteDisplay16()
//
//	DESCRIPTION:
//		This routine writes one sixteen bit value to two consective
//		display memory addresses using parallel indirect I/O.
//
//	PARAMETERS:
//		addr	- The offset in display memory to write the LSB of value to
//				  The MSB will be wrtten to addr + 1
//		data	- The 16-bit value to be written to display memory.
//---------------------------------------------------------------------------
void halpParWriteDisplay16( UInt32 addr, UInt16 data, UInt32 count )
{
	UInt32 loop;

	halSetProcessExclusivity( TRUE );

	SetDisplayAddrParallel(addr);

	// Write the data
	for ( loop=0; loop<count; loop++ )
	{
		if (HalInfo.dwFlags & fINDIRECT_DATA16)
			*HalIndInfo.pData16 = data;
		else
		{
			*HalIndInfo.pData8 = LOBYTE(data);
			*HalIndInfo.pData8 = HIBYTE(data);
		}
	}

	halSetProcessExclusivity( FALSE );
}


//---------------------------------------------------------------------------
//	FUNCTION: halpParWriteDisplay32()
//
//	DESCRIPTION:
//		This routine writes four consective eight bit display memory addresses
//		with the thirty-two bits of data using parallel indirect I/O.
//
//	PARAMETERS:
//		addr	- Specifies the offset to the LSB of the data to be written
//		data	- The 32-bit data to be written to the specified address
//---------------------------------------------------------------------------
void halpParWriteDisplay32( UInt32 addr, UInt32 data, UInt32 count )
{
	UInt32 loop;

	halSetProcessExclusivity( TRUE );

	SetDisplayAddrParallel(addr);

	// Write the data
	for ( loop=0; loop<count; loop++ )
	{
		if (HalInfo.dwFlags & fINDIRECT_DATA16)
		{
			*HalIndInfo.pData16 = LOWORD(data);
			*HalIndInfo.pData16 = HIWORD(data);
		}
		else
		{
			*HalIndInfo.pData8 = LOBYTE(LOWORD(data));
			*HalIndInfo.pData8 = HIBYTE(LOWORD(data));
			*HalIndInfo.pData8 = LOBYTE(HIWORD(data));
			*HalIndInfo.pData8 = HIBYTE(HIWORD(data));
		}
	}

	halSetProcessExclusivity( FALSE );
}


//---------------------------------------------------------------------------
//	FUNCTION: halpParReadDisplay8()
//
//	DESCRIPTION:
//		This routine reads one eight bit value from the specified display
//		memory address using parallel indirect I/O.
//
//	PARAMETERS:
//		addr	- The address to read from
//

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色综合天天综合狠狠| 精品国产成人系列| 日韩一区二区三区电影在线观看 | 午夜欧美大尺度福利影院在线看| 日本成人中文字幕| 91亚洲精品一区二区乱码| 精品国产伦一区二区三区观看方式 | 91精品国产综合久久婷婷香蕉 | 国产高清成人在线| 777a∨成人精品桃花网| 成人免费在线观看入口| 久久精品国产亚洲aⅴ| 欧美性一二三区| 椎名由奈av一区二区三区| 国产福利精品一区二区| 日韩欧美激情在线| 天使萌一区二区三区免费观看| 成人av影视在线观看| www久久精品| 奇米888四色在线精品| 欧美在线观看一区| 亚洲免费色视频| 色悠悠亚洲一区二区| 国产精品色婷婷久久58| 国产iv一区二区三区| 久久奇米777| 国产一区二区在线电影| 精品理论电影在线| 在线视频国产一区| 亚洲天天做日日做天天谢日日欢| 国产成人超碰人人澡人人澡| 久久久久久久久久久久久久久99| 狠狠色狠狠色综合系列| 久久蜜桃av一区二区天堂| 国产精品一区二区在线看| 精品国产成人在线影院 | 欧美军同video69gay| 亚洲午夜激情av| 欧美日韩国产精品成人| 日韩主播视频在线| 欧美成人vps| 国产精品18久久久久久久久久久久| 精品粉嫩aⅴ一区二区三区四区| 看片网站欧美日韩| 久久网这里都是精品| 国产高清成人在线| 自拍偷拍欧美激情| 欧美亚洲动漫另类| 奇米亚洲午夜久久精品| 精品国产91亚洲一区二区三区婷婷| 国产一区二区三区香蕉| 国产精品欧美一区二区三区| 99久久综合狠狠综合久久| 亚洲欧美福利一区二区| 欧美男生操女生| 久久不见久久见免费视频1| 久久久噜噜噜久噜久久综合| 成人丝袜18视频在线观看| 一区二区三区在线观看欧美 | 亚洲成人av一区二区三区| 欧美一区二区三区视频免费播放| 久久99精品久久久久久动态图| 国产亚洲精品精华液| 在线观看欧美黄色| 久久99精品久久久| 亚洲免费在线观看| 日韩欧美一级片| av在线一区二区三区| 亚洲gay无套男同| 国产性做久久久久久| 91久久精品网| 国产一区二区三区免费在线观看| 亚洲三级在线播放| 欧美变态tickling挠脚心| www.爱久久.com| 美女爽到高潮91| 亚洲免费伊人电影| 久久久久久久久一| 欧美日本国产一区| 91亚洲永久精品| 国产资源精品在线观看| 亚洲国产成人porn| 欧美激情一区三区| 精品区一区二区| 欧美在线小视频| av在线不卡免费看| 韩国欧美一区二区| 亚洲成人免费观看| 亚洲视频一区在线观看| 久久先锋资源网| 欧美一区二区在线看| 91麻豆视频网站| 成人在线视频首页| 黄一区二区三区| 免费成人av资源网| 亚洲观看高清完整版在线观看| 欧美韩日一区二区三区| 精品国精品国产尤物美女| 欧美色区777第一页| av激情成人网| 大白屁股一区二区视频| 国产一区二区三区在线观看免费 | 91久久精品一区二区三区| 高清国产一区二区| 国产在线精品一区二区| 日本不卡视频一二三区| 五月综合激情网| 亚洲在线视频网站| 一级女性全黄久久生活片免费| 国产精品素人一区二区| 国产欧美日韩卡一| 日本一区二区电影| 久久这里只有精品首页| 精品成人一区二区三区| 精品久久人人做人人爰| 日韩亚洲欧美一区二区三区| 欧美精品视频www在线观看| 欧美日韩和欧美的一区二区| 欧美色图12p| 91精品国产欧美一区二区| 欧美一区二区三区色| 91精品国产麻豆国产自产在线| 欧美美女一区二区三区| 91精品国产乱| 精品日韩在线观看| 久久久精品日韩欧美| 中文字幕第一页久久| 亚洲精选免费视频| 亚洲成人av在线电影| 捆绑变态av一区二区三区| 国产曰批免费观看久久久| 国产suv精品一区二区三区| www.日韩av| 欧美日韩高清一区二区| 日韩欧美你懂的| 欧美经典一区二区| 亚洲免费观看在线视频| 无码av免费一区二区三区试看 | 亚洲免费观看高清完整版在线观看熊| 亚洲乱码国产乱码精品精98午夜| 亚洲综合色自拍一区| 青草国产精品久久久久久| 欧美日韩精品一区二区天天拍小说| 欧美日韩免费不卡视频一区二区三区| 91精品国产综合久久福利| 久久久精品影视| 伊人性伊人情综合网| 日本午夜精品一区二区三区电影| 国产精品一卡二卡| 在线一区二区三区做爰视频网站| 91精品国产综合久久精品图片| 精品国产第一区二区三区观看体验| 国产精品毛片久久久久久久| 亚洲国产欧美在线| 国产成人免费网站| 色偷偷久久一区二区三区| 日韩免费观看高清完整版在线观看| 中文字幕在线不卡国产视频| 午夜精品久久久久久久| 成人午夜电影网站| 制服丝袜亚洲网站| 亚洲视频一二三| 精品一区二区在线看| 在线观看一区二区视频| 国产喂奶挤奶一区二区三区| 亚洲一区二区成人在线观看| 国产成人免费视频一区| 欧美日本韩国一区二区三区视频| 国产精品人成在线观看免费 | 亚洲精品视频在线看| 久久99精品国产.久久久久| 色婷婷av久久久久久久| 国产亚洲人成网站| 蜜臀av在线播放一区二区三区 | 亚洲精品你懂的| 国产成人精品1024| 日韩精品一区二区三区蜜臀| 亚洲在线一区二区三区| a亚洲天堂av| 国产精品污污网站在线观看| 久久99精品久久久久| 欧美老女人在线| 亚洲一区二区视频在线观看| aaa国产一区| 欧美韩国一区二区| 国产精品乡下勾搭老头1| 在线成人av影院| 亚洲午夜精品在线| 色美美综合视频| 亚洲免费伊人电影| 91老师国产黑色丝袜在线| 国产精品美女久久久久久2018| 国产真实乱子伦精品视频| 日韩精品一区国产麻豆| 日本欧美肥老太交大片| 欧美男生操女生| 免费在线观看精品| 日韩免费看网站| 国产一区美女在线| 国产女人水真多18毛片18精品视频 |