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

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

?? hal_indirect16.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 tmp;

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 + 2);

	HalIndInfo.pIndex16	= (pvUInt16)(RegAddr + 0);
	HalIndInfo.pData16	= (pvUInt16)(RegAddr + 2);
}


//---------------------------------------------------------------------------
//	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 )
{
	halSetProcessExclusivity( TRUE );

	// Setup the address
	if (HalInfo.dwFlags & fINDIRECT_ADDR16)
		*HalIndInfo.pIndex16 = LOWORD(index);
	else
	{
		*HalIndInfo.pIndex8 = LOBYTE(index);
		*HalIndInfo.pIndex8 = HIBYTE(index);
	}
	
	// Write the value
	*HalIndInfo.pData8 = value;

	halSetProcessExclusivity( FALSE );
}


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

	halSetProcessExclusivity( TRUE );

	// Setup the register address
	if (HalInfo.dwFlags & fINDIRECT_ADDR16)
		*HalIndInfo.pIndex16 = LOWORD(index);
	else
	{
		*HalIndInfo.pIndex8 = LOBYTE(index);
		*HalIndInfo.pIndex8 = HIBYTE(index);
	}

	val = *HalIndInfo.pData8;

	halSetProcessExclusivity( FALSE );

	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:

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人毛片老司机大片| av激情亚洲男人天堂| 国产老女人精品毛片久久| 91美女在线看| 久久久久免费观看| 日本中文在线一区| aa级大片欧美| 国产欧美日韩精品a在线观看| 人人爽香蕉精品| 91污片在线观看| 久久日韩粉嫩一区二区三区| 一区二区欧美精品| 成人动漫一区二区三区| 久久综合色一综合色88| 日韩国产高清在线| 欧美日高清视频| 亚洲国产成人av| 色综合中文字幕国产 | 自拍偷自拍亚洲精品播放| 日日摸夜夜添夜夜添精品视频| 亚洲一区二区三区美女| av爱爱亚洲一区| 中文字幕欧美激情| 国产成人一级电影| 国产丝袜欧美中文另类| 蜜臀av性久久久久蜜臀aⅴ流畅 | 色婷婷久久久亚洲一区二区三区| 不卡区在线中文字幕| 久久色在线视频| 国产精品一二三四区| 精品国产青草久久久久福利| 奇米精品一区二区三区在线观看 | 亚洲男人的天堂一区二区| 国产精品亚洲第一区在线暖暖韩国| 亚洲精品成人在线| 92国产精品观看| 亚洲视频你懂的| 成人理论电影网| 综合久久国产九一剧情麻豆| 色综合欧美在线视频区| 亚洲精品大片www| 欧美日韩1234| 久久机这里只有精品| 久久久久久久久久美女| 狠狠色狠狠色合久久伊人| 久久影音资源网| 国产成人无遮挡在线视频| 国产精品久久99| 91小宝寻花一区二区三区| 亚洲一区二区在线免费观看视频| 精品一区二区精品| 精品国产第一区二区三区观看体验| 亚洲男同1069视频| 在线不卡免费欧美| 国模套图日韩精品一区二区| 国产精品天干天干在观线| 91在线观看视频| 亚洲国产成人tv| 久久久久综合网| 一本色道亚洲精品aⅴ| 丝瓜av网站精品一区二区| 精品福利一区二区三区| 99re成人精品视频| 麻豆国产欧美日韩综合精品二区| 欧美天天综合网| 美洲天堂一区二卡三卡四卡视频| 欧美午夜在线一二页| 全国精品久久少妇| 国产网站一区二区三区| 欧美色涩在线第一页| 国产一区二区久久| 亚洲国产精品自拍| 国产亚洲欧美在线| 88在线观看91蜜桃国自产| 国产69精品久久久久777| 亚洲一级二级三级| 中文字幕精品一区二区三区精品| 精品制服美女久久| 一区二区三区不卡在线观看| 久久久久久免费网| 欧美人与z0zoxxxx视频| 丁香网亚洲国际| 日韩制服丝袜先锋影音| 亚洲男人电影天堂| 国产区在线观看成人精品| 欧美喷水一区二区| 91在线精品秘密一区二区| 精品一区二区三区免费| 一区二区三区 在线观看视频| 色综合天天综合网天天狠天天 | 国产精品一区二区x88av| 亚洲成人激情av| 最新中文字幕一区二区三区 | 亚洲视频网在线直播| 日韩欧美国产高清| 欧美唯美清纯偷拍| 99久久精品国产精品久久| 久久国产精品99久久人人澡| 午夜日韩在线电影| 一个色在线综合| 国产精品精品国产色婷婷| 国产人久久人人人人爽| 久久综合色综合88| 2024国产精品| 精品国产一二三| 精品国产乱码久久久久久老虎| 成人免费av网站| 国产成人亚洲综合a∨婷婷图片 | www.一区二区| 成人永久aaa| 国产ts人妖一区二区| 久久国产精品第一页| 男女男精品网站| 日本伊人色综合网| 日韩影院免费视频| 男女男精品网站| 麻豆视频观看网址久久| 美国毛片一区二区三区| 国产一区免费电影| 国产一区二区在线观看免费| 国产主播一区二区| 成人午夜视频在线| aaa亚洲精品| 欧美系列亚洲系列| 欧美一区二区网站| 精品久久久久久久久久久久久久久久久| 国产精品一区二区在线观看网站| 最新国产成人在线观看| 亚洲免费在线电影| 亚洲综合视频网| 日韩成人精品在线观看| 玖玖九九国产精品| 国产高清成人在线| 99久久久无码国产精品| 欧美色窝79yyyycom| 日韩一区二区三区在线观看| 久久美女艺术照精彩视频福利播放 | 欧美日本视频在线| 欧美va亚洲va| 国产精品理论片| 亚洲综合色丁香婷婷六月图片| 久久久午夜电影| 亚洲人一二三区| 免费亚洲电影在线| 粉嫩高潮美女一区二区三区| a在线播放不卡| 91精品综合久久久久久| 久久嫩草精品久久久精品一| 亚洲精品第1页| 久草在线在线精品观看| 色狠狠桃花综合| 亚洲精品在线三区| 一区二区不卡在线播放| 激情小说亚洲一区| 欧美色网一区二区| 日本一区二区视频在线| 午夜精品一区二区三区电影天堂 | 国产午夜精品一区二区三区嫩草 | 亚洲va欧美va天堂v国产综合| 国产精品免费免费| 日韩av一区二区三区| 北岛玲一区二区三区四区| 91精品国产手机| 一区二区三区在线观看国产| 国产综合久久久久影院| 欧美在线看片a免费观看| 国产日产欧产精品推荐色| 婷婷开心激情综合| 成人做爰69片免费看网站| 91精品国产黑色紧身裤美女| 国产精品久久久久桃色tv| 久久精品国产一区二区三区免费看| 性久久久久久久| 99免费精品在线观看| 久久综合五月天婷婷伊人| 三级一区在线视频先锋| 91片在线免费观看| 国产精品网站在线| 狠狠狠色丁香婷婷综合久久五月| 麻豆精品久久精品色综合| 欧美中文字幕一区二区三区亚洲 | 日韩一区二区中文字幕| 亚洲老司机在线| jvid福利写真一区二区三区| 日韩欧美国产精品一区| 图片区日韩欧美亚洲| 91福利国产精品| 亚洲精品国产a久久久久久 | 日韩理论片中文av| 国产a久久麻豆| 国产日韩欧美麻豆| 国内成人免费视频| 日韩视频不卡中文| 日韩高清一级片| 欧美日韩不卡视频| 无码av免费一区二区三区试看| 国产乱码精品1区2区3区| 日韩一级片网站| 麻豆成人免费电影| 69堂成人精品免费视频|