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

📄 halapi.h

📁 s1d13716的源码 windiws ce 或8位单片机
💻 H
字号:
//===========================================================================
//	HALAPI.H
// (Tabs set to every 4)
//---------------------------------------------------------------------------
//  Copyright (c) 2002 Epson Research and Development, Inc.
//  All Rights Reserved.
//===========================================================================

#ifndef __HALAPI_H__
#define __HALAPI_H__


#include "datatype.h"


// Allow both standard C and C++ linkages.
#ifdef __cplusplus
   extern "C" {
#endif



//-----------------------------------------------------------------------------
//  FUNCTION:		halReadDisplay8()
//					halReadDisplay16()
//					halReadDisplay32()
//
//  DESCRIPTION:
//		These routines read display memory at the width	indicated in the
//		function name.
//
//  PARAMETERS:
//		Offset	  - a 32 bit value containing an offset into display memory.
//					To prevent system slowdowns and possibly memory faults,
//					Offset should be a multiple of the boundary of the read
//					size being requested.
//
//  RETURNS:
//		The value at the requested offset.
//
//	MODIFIES:
//		No LCD controller registers are modified by this call.
//-----------------------------------------------------------------------------
UInt8  halReadDisplay8(  UInt32 Offset );
UInt16 halReadDisplay16( UInt32 Offset );
UInt32 halReadDisplay32( UInt32 Offset );



//-----------------------------------------------------------------------------
//  FUNCTION:		halWriteDisplay8()
//					halWriteDisplay16()
//					halWriteDisplay32()
//
//  DESCRIPTION:
//		These routines write display memory at the width indicated in the
//		function name.
//
//  PARAMETERS:
//		Offset  - a 32 bit value containing an offset into display memory.
//				  To prevent system slowdowns and possibly memory faults,
//				  dwOffset should be a multiple of the boundary of the read
//				  size being requested.
//
//		Value	- The value to be written to display memory. Value must be
//				  of the correct size for the function call.
//		Count	- The number of times to repeat the Value in memory.
//				  By including a count (or loop) value this function is far
//				  more efficient at filling display memory.
//
//  RETURNS:	Nothing.
//
//	MODIFIES:
//		The display memory indicated by the parameters to the function call.
//-----------------------------------------------------------------------------
void halWriteDisplay8(  UInt32 Offset, UInt8  Value, UInt32 Count );
void halWriteDisplay16( UInt32 Offset, UInt16 Value, UInt32 Count );
void halWriteDisplay32( UInt32 Offset, UInt32 Value, UInt32 Count );



//-----------------------------------------------------------------------------
//  FUNCTION:		halReadReg8()
//					halReadReg16()
//					halReadReg32()
//
//  DESCRIPTION:
//		These routines read the LCD chip control registers in the width
//		indicated in the function name.
//
//  PARAMETERS:
//		Index	  - Offset to the register to read. The index value is zero
//					based from the beginning of register address space.
//					(eg. if Index == 0x04 then the Memory Clock Configuration
//					register will be read and if Index == 0x8000 then the
//					BitBLT Control Register will be read)
//
//  RETURNS:
//		The value read from the register.
//
//		Be very cautious in determining the index and interpretting the values
//		returned from halReadReg8() and halReadReg16() to ensure the correct
//		meaning is given to the values. Differing endians will move relative
//		 register offsets.
//
//	MODIFIES:	No LCD controller registers are changed.
//-----------------------------------------------------------------------------
UInt8  halReadReg8(  UInt32 Index );
UInt16 halReadReg16( UInt32 Index );
UInt32 halReadReg32( UInt32 Index );



//-----------------------------------------------------------------------------
//  FUNCTION:		halWriteReg8()
//					halWriteReg16()
//					halWriteReg32()
//
//  DESCRIPTION:
//		These routines write the LCD chip control registers at the width
//		indicated in the function name.
//
//  PARAMETERS:
//		Index - Offset to the register to read. The index value is zero	based
//				from the beginning of register address space.
//				(eg. if Index == 0x04 then the Memory Clock Configuration
//				register will be read and if Index == 0x8000 then the BitBLT
//				Control Register will be read)
//		Value - The value to write to the register indicated by offset.
//
//				Be very cautious in interpretting the index and values to write
//				to registers using the halWriteReg8() and halWriteReg16()
//				functions, to ensure the correct meaning is programmed into the
//				register. Differing endians will move relative register offsets.
//
//  RETURNS:	Nothing
//
//	MODIFIES:	The register(s) indicated in the function name.
//-----------------------------------------------------------------------------
void halWriteReg8(  UInt32 Index, UInt8  Value );
void halWriteReg16( UInt32 Index, UInt16 Value );
void halWriteReg32( UInt32 Index, UInt32 Value );



//-----------------------------------------------------------------------------
//  FUNCTION:		halModifyReg8()
//					halModifyReg16()
//					halModifyReg32()
//
//	*WARNING*:
//		These three functions may NOT be implemented in all chip-specific HALs!
//		If these functions do not exist for a particular part, they must be
//		written/added for that part if they are required by test software,
//		therefore common libraries should not use these functions directly.
//
//  DESCRIPTION:
//		These routines moidfy an LCD chip control register at the width
//		indicated in the function name.  The register is first read, then the
//		data is ANDed with the logical NOT of the AndMask, then the data is
//		ORed with the OrMask, then the result is written back to the register.
//		Effect: return (Reg[Index] = (Reg[Index] & ~AndMask) | OrMask);
//
//  PARAMETERS:
//		Index - Offset to the register to read. The index value is zero	based
//				from the beginning of register address space.
//		AndMask - The logical NOT of this argument is ANDed with the read data.
//		OrMask - The result of (data & ~AndMask) is ORed with this argument.
//
//		The AndMask and OrMask are always 32-bit values, but only the lowest
//		8,16,32 bits are significant depending on which function/size is used.
//
//  RETURNS:
//		The effective final value written back to the register.
//
//	MODIFIES:	The register(s) indicated in the function name.
//-----------------------------------------------------------------------------
UInt8  halModifyReg8(  UInt32 Index, UInt32 AndMask, UInt32 OrMask );
UInt16 halModifyReg16( UInt32 Index, UInt32 AndMask, UInt32 OrMask );
UInt32 halModifyReg32( UInt32 Index, UInt32 AndMask, UInt32 OrMask );



//-----------------------------------------------------------------------------
//  FUNCTION:		halReadData()
//					halWriteData()
//
//	*WARNING*:
//		These two functions may NOT be implemented in all chip-specific HALs!
//		If these functions do not exist for a particular part, they must be
//		written/added for that part if they are required by test software,
//		therefore common libraries should not use these functions directly.
//
//  DESCRIPTION:
//		These routines read/write data from/to display memory at the width
//		indicated in AccessSize.  These routines are useful to copy large
//		datasets from/to the display memory more efficiently.
//
//  PARAMETERS:
//		AccessSize	Size of atomic display memory accesses (1,2,4 supported).
//					An AccessSize of zero will use the default interface size.
//		Offset		32-bit value containing an offset into display memory.
//		pData		Caller-supplied buffer to data to write/read.
//		nBytes		Size of data to write/read (in bytes).
//
//		The actual number of bytes written/read will be rounded down to the
//		nearest "AccessSize" quantum.  Passing an invalid AccessSize or a NULL
//		pData argument will cause this function to return with no operation.
//
//		The primary purpose for this function is to optimize display memory
//		accesses, especially in indirect mode, as auto-incrementing can be used.
//
//  RETURNS:	Nothing
//
//	MODIFIES:
//		On writes, the display memory as indicated by the function arguments.
//-----------------------------------------------------------------------------
void halReadData(  int AccessSize, UInt32 Offset,       void* pData, UInt32 nBytes );
void halWriteData( int AccessSize, UInt32 Offset, const void* pData, UInt32 nBytes );



//----------------------------------------------------------------------------
// FUNCTION:	halDelayUS - Delay for the specified number of microseconds.
//
//  DESCRIPTION:
//		This function can be used to delay for short times.
//
//  PARAMETERS:
//		microseconds	Required delay in microsecond units.
//
//  RETURNS:		TRUE if delay supported, else FALSE.
//
//	MODIFIES:		n/a
//----------------------------------------------------------------------------
Boolean halDelayUS( UInt32 microseconds );



#ifdef __cplusplus
   }
#endif


#endif // __HALAPI_H__

⌨️ 快捷键说明

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