📄 hal_host.h
字号:
/************************************************************************
; HAL_HOST.h
;
; Copyright (c) 2002 Epson Research and Development, Inc.
;
; All Rights Reserved.
; 2002.11.12 D Eric Start.
;
;************************************************************************/
#ifndef __HAL_HOST_H__
#define __HAL_HOST_H__
//===========================================================
// Definitions for the dwflags of HAL_STRUCT
//===========================================================
#define fNO_RESET 0x00000001 // True if software reset is not needed during chip init.
#define fFIXED_SADDR 0x00000002 // True if start addr is set by user
#define fFIXED_STRIDE 0x00000004 // True if line address offset is set by user
#define fVER_13710 0x00000008 // True if 13710 software being used
#define fVER_13711 0x00000010 // True if 13711 software being used
#define fNO_INIT_I2C 0x00000020 // True if not supporting I2C bus on GPIO pins
#define fINDIRECT_INTERFACE 0x00000040 // True if host Indirect Interface should be used
#define fPLL_LOWPOWER 0x00000080 // True if prefer using low power consumption by PLL
#define fDEBUG_REG_WRITES 0x00000100 // True if HAL debugging of register writes is enabled
#define fSAA7111_SVIDEO 0x00010000 // True if SAA7111A input is S-Video, else CVBS
#define fSAA7111_PAL 0x00020000 // True if SAA7111A input is PAL, else NTSC
#define fSAA7111_DITHER 0x00040000 // True if SAA7111A dithering enabled (sub-address 12h bit 2)
#define fSAA7127_SVIDEO 0x00100000 // True if SAA7127H output is S-Video, else RGB
#define fSAA7127_PAL 0x00200000 // True if SAA7127H output is PAL, else NTSC
#define fEPSONCAM_PROTO25 0x01000000 // True if Epson Camera is Proto2-5 (not proto2-2)
//===========================================================
// Error Condition Codes
//===========================================================
enum
{
ERR_NONE = 0, // No error, call was successful.
ERR_NOT_CONFIGURED, // The file has not been configured.
ERR_BAD_CFG_DATA, // CFG data does not match the CRC.
ERR_BAD_I2C_INIT, // Error during I2C bus initialization/programming.
ERR_FAILED // Catch-all error condition
};
//==============================================================
// Static Values Used By The Hal For Specific Timeing Delay.
//===============================================================
#define HAL_DELAY_RESET 5000 // Delay after issuing a software reset (in microseconds)
#define HAL_DELAY_PLL_OFF 244 // Delay after 1st write of reg 0012h (in microseconds)
#define HAL_DELAY_PLL_ON 100 // Delay after 2nd write of reg 0012h (in microseconds)
//===============================================================
// Flags use in hal config
//===============================================================
#define fINIT_NORMAL 0x0000 // Normal intialization - reset the chip, set the clocks, init regs and LUT, and clear display memory.
#define fDONT_RESET 0x0001 // Do not reset before doing the init.
#define fDONT_INIT_REGS 0x0002 // Do not initialize the registers as part of the init sequence (doesn't include the LUT)
#define fDONT_INIT_LUT 0x0004 // Do not set the LUT to default values as part of the initialization.
#define fDONT_CLEAR_MEM 0x0008 // Don't clear video memory as the final step of controller initialization.
#define fDONT_INIT_I2C 0x0010 // Do not init the I2C bus as part of the init sequence.
#define fDONT_CHECK_CRC 0x8000 // Don't check for valid CRC, but still fail if app not configured (CRC=0).
//===============================================================
// the definiens of Chipset
//===============================================================
typedef enum
{
cl_S1D13710 = 0,
cl_S1D13711,
cl_S1D13712,
cl_S1D13713,
cl_S1D13714
} ChipTypeDef;
// define function
ChipTypeDef GetChipType(void);
char * GetChipName( void );
void GetChipID(unsigned long *pProductCode, unsigned long *pRevisionCode);
unsigned long GetMemSize(void);
void halWriteReg8 ( unsigned long Index, unsigned char Value );
void halWriteReg16 ( unsigned long Index, unsigned short Value );
void halWriteReg32 ( unsigned long Index, unsigned long Value );
unsigned char halReadReg8( unsigned long Index );
unsigned short halReadReg16( unsigned long Index );
unsigned long halReadReg32( unsigned long Index );
void halWriteDisplay8( unsigned long Offset, unsigned char Value );
void halWriteDisplay16( unsigned long Offset, unsigned short Value);
void halWriteDisplay32( unsigned long Offset, unsigned long Value );
unsigned char halReadDisplay8( unsigned long Offset );
unsigned short halReadDisplay16( unsigned long Offset );
unsigned long halReadDisplay32( unsigned long Offset );
void halInitRegisters( void );
void halInitLUT( void );
BOOL halpInitI2C(void);
void halpClearVmem( unsigned long * ptr );
BOOL halInitController( unsigned long Flags );
void halInitIndirectInterface(unsigned char * addr);
void halIndirectWriteDisplayAddress(unsigned long addr);
void halIndirectWriteReg8(unsigned long index, unsigned char value);
void halIndirectWriteReg16(unsigned long index, unsigned short value);
void halIndirectWriteReg32(unsigned long index, unsigned long value);
unsigned char halIndirectReadReg8(unsigned long index);
unsigned short halIndirectReadReg16(unsigned long index);
unsigned long halIndirectReadReg32(unsigned long index);
void halIndirectWriteDisplay8(unsigned long addr,unsigned char data );
void halIndirectWriteDisplay16(unsigned long addr,unsigned short data );
void halIndirectWriteDisplay32(unsigned long addr,unsigned long data );
unsigned char halIndirectReadDisplay8( unsigned long addr);
unsigned short halIndirectReadDisplay16(unsigned long addr);
unsigned long halIndirectReadDisplay32(unsigned long addr);
long halGetLastError( char * ErrMsg, long MaxSize );
#endif //__HAL_HOST_H__
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -