/*=============================================
  * Copyright (c)      Realtek Semiconductor Corporation, 2005
  * All rights reserved.
  * ============================================ */

/*================= File Description ================= */
/**
 * @file
 * 	This file is for global structure's declaration.
 *
 * @author 	$Author: kingee $
 * @date 	$Date: 2006-09-06 14:48:38 +0800 (?ζ?δΈ? 06 δΉζ? 2006) $
 * @version 	$Revision: 1184 $
 * @ingroup 	global
 */

/**
* @addtogroup global
* @{
*/

#ifndef  _GLOBAL_H
#define  _GLOBAL_H
#include "Core\Header\includeCD.h"
/*===================== Module Dependency  ================== */

/*========================== Types ========================== */

/*======================== Definitions ====================== */
#if _ADD_NEW_LANGUAGES
#define _LANGUAGE_ENGLISH             1
#define _LANGUAGE_GERMAN		    1
#define _LANGUAGE_FRENCH             1
#define _LANGUAGE_SPANISH             1
#define _LANGUAGE_ITALIAN             1
#define _LANGUAGE_FLEMISH             1
#define _LANGUAGE_PORTUGUESE             1
#define _LANGUAGE_RUSSIAN             1
#define _LANGUAGE_CHINESE_S             1

enum LanguageType
{
#if _LANGUAGE_ENGLISH
	_ENGLISH,
#endif
#if _LANGUAGE_GERMAN
	_GERMAN,
#endif
#if _LANGUAGE_FRENCH
	_FRENCH,
#endif
#if _LANGUAGE_SPANISH
	_SPANISH,
#endif
#if _LANGUAGE_ITALIAN
	_ITALIAN,
#endif
#if _LANGUAGE_FLEMISH
	_FLEMISH,
#endif
#if _LANGUAGE_PORTUGUESE
	_PORTUGUESE,
#endif
#if _LANGUAGE_RUSSIAN
	_RUSSIAN,
#endif
#if _LANGUAGE_CHINESE_S
	_CHINESE_S,
#endif
};

#define _LANGUAGE_FIRST	_ENGLISH
#define _LANGUAGE_LAST		_CHINESE_S
#define _LANGUAGE_DEFAULT	_LANGUAGE_FIRST

#else
enum LanguageType
{
    _ENGLISH=0,
    //_FRENCH,
    //_GERMAN,
    //_SPANISH,
    _CHINESE_S,
//    _CHINESE_T,
//    _JAPAN,
//    _ITALIAN,
};

#define _LANGUAGE_FIRST	_ENGLISH
#define _LANGUAGE_LAST		_CHINESE_S
#define _LANGUAGE_DEFAULT	_LANGUAGE_FIRST
#endif
//--------------------------------------------------
// Data Type Redefine
//--------------------------------------------------
typedef unsigned char BYTE;
typedef unsigned char UINT8;
typedef char SBYTE;
typedef char INT8;
typedef unsigned int  WORD;
typedef unsigned int UINT16;
typedef	int  SWORD;
typedef int INT16;
typedef unsigned long DWORD;
typedef unsigned long UINT32;
typedef long SDWORD;
typedef long INT32;
typedef bit BOOL;
typedef bit BIT;

//--------------------------------------------------
// Definitions of Page
//--------------------------------------------------
#define _PAGE0                          0x00
#define _PAGE1                          0x01
#define _PAGE2                          0x02
#define _PAGE3                          0x03
#define _PAGE4                          0x04
#define _PAGE5                          0x05
#define _PAGE6                          0x06
#define _PAGE7                          0x07
//
#define _PAGE8                          0x08
#define _PAGE9                          0x09
#define _PAGEA                          0x0A
#define _PAGEB                          0x0B
#define _PAGEC                          0x0C
#define _PAGED                          0x0D
#define _PAGEE                          0x0E
#define _PAGEF                          0x0F

//--------------------------------------------------
// Definations of Physical Boolean
//--------------------------------------------------
#define _LOCK        				1
#define _UNLOCK              			0
#define _TRUE                           	1
#define _FALSE                          	0
#define _HIGH                           	1
#define _LOW                            	0
#define _ENABLE                         	1
#define _DISABLE                        	0
#define _READ                           	1
#define _WRITE                          	0
#define _ON                             		1
#define _OFF                            		0
#define _SUCCESS                        	1
#define _FAIL                           		0
#define _STABLE                         	1
#define _UNSTABLE                       	0
#define _POSITIVE                       	1
#define _NEGATIVE                       	0
#define _NULL_						0

#define _NEWMODE                        	1
#define _OLDMODE                        	0

//--------------------------------------------------
// Definitions of Bits
//--------------------------------------------------
#define _BIT0                           0x0001
#define _BIT1                           0x0002
#define _BIT2                           0x0004
#define _BIT3                           0x0008
#define _BIT4                           0x0010
#define _BIT5                           0x0020
#define _BIT6                           0x0040
#define _BIT7                           0x0080
#define _BIT8                           0x0100
#define _BIT9                           0x0200
#define _BIT10                          0x0400
#define _BIT11                          0x0800
#define _BIT12                          0x1000
#define _BIT13                          0x2000
#define _BIT14                          0x4000
#define _BIT15                          0x8000

#define DOUBLE(x)			(x*2)

//--------------------------------------------------
// Definitions for Panel Settings
//--------------------------------------------------
#define _PANEL_LVDS                   	2
#define _PANEL_RSDS                   	3
#define _PANEL_TTL                     	0
#define _PANEL_HZ                       	1

//--------------------------------------------------
// Definitions for Display Single/Double Port, Even/Odd Swap,
// Red/Blue Swap, MSB/LSB Swap, 24/18 Bit, Green/Clock Swap,
// High/Low Swap and PN Swap
//--------------------------------------------------
#define _DISP_24_BIT                    		(0 << 7)
#define _DISP_18_BIT                    		(1 << 7)
#define _DISP_EO_SWAP                   	(1 << 6)
#define _DISP_RB_SWAP                   	(1 << 5)
#define _DISP_ML_SWAP                   	(1 << 4)
#define _DISP_SINGLE_PORT               	(0 << 3)
#define _DISP_DOUBLE_PORT               	(1 << 3)
#define _RSDS_GC_SWAP                   	(1 << 2)
#define _RSDS_HL_SWAP                   	(1 << 1)
#define _RSDS_PN_SWAP                   	(1 << 0)


//--------------------------------------------------
// Definitions of Input Source Type
//--------------------------------------------------
#define _SOURCE_VGA                     	0
#define _SOURCE_DVI                     		1	//DVI,HDMI
#define _SOURCE_VIDEO8                  	2	//AV,SV,TV,DVD
#define _SOURCE_YPBPR                   	3	//YPBPR,DTV
#define _SOURCE_NONE                    	4
//#define _SOURCE_HDMI                    	5
//#define _SOURCE_DTV                    	6
//#define _SOURCE_SCART                    	7   Ken

//--------------------------------------------------
// Definitions of ModeHandler State
//--------------------------------------------------
#define _PWOFF_STATE                    	0
#define _INITIAL_STATE                  	1
#define _SEARCH_STATE                   	2
#define _ACTIVE_STATE                   	3
#define _NOSUPPORT_STATE                	4
#define _NOSIGNAL_STATE                 	5
#define _SLEEP_STATE                    	6
#define _PROCESS_STATE              		7
#define _SOURCE_CHANGE_STATE         	8
#define _DTV_SCAN_STATE                    9
#define _DTV_POWER_ON_STATE           10
#define _BURNIN_STATE				11


//--------------------------------------------------
// Definitions of Hsync Type Detection Auto Run Result
//--------------------------------------------------
#define _NO_SIGNAL                      0
#define _NOT_SUPPORT                    1
#define _YPBPR_SYNC                     2
#define _SERRATION_CS                   3
#define _XOR_OR_TYPE_CS_WITH_EQR        4
#define _XOR_OR_TYPE_CS_WITHOUT_EQR     5
#define _SEPARATE_HSYNC                 6
#define _HSYNC_WITHOUT_VS               7

//--------------------------------------------------
// Definitions of Input Sync Type State
//--------------------------------------------------
#define _NO_SYNC_STATE              	0
#define _SS_STATE                       	1
#define _CS_STATE                       	2
#define _SOG_STATE                      	3
#define _SOY_STATE                      	4
#define _DSS_STATE                      	5
#define _VIDEO8_STATE                	6


//--------------------------------------------------
// Definitions of Mode Search Type
//--------------------------------------------------
#define _PRESET_MODE_TYPE               	0
#define _USER_MODE_TYPE                 	1


//--------------------------------------------------
// Definitions of Waiting Events
//--------------------------------------------------
#define _EVENT_IVS                      		0x01
#define _EVENT_IEN_START                	0x02
#define _EVENT_IEN_STOP                 	0x04
#define _EVENT_DVS                      		0x08
#define _EVENT_DEN_START                	0x10
#define _EVENT_DEN_STOP                 	0x20
#define _EVENT_UNDERFLOW                	0x40
#define _EVENT_OVERFLOW                 	0x80


//--------------------------------------------------
// Definations of Scaler Write/Read Type
//--------------------------------------------------
#define _NON_AUTOINC                  	1
#define _AUTOINC                        	0
#define _BURST                          	2
#define _END                            		0


//--------------------------------------------------
// Definations of Load OSD Font Table Type
//--------------------------------------------------
#define _NORMAL_FONT                    	0x00
#define _COMPRESS_FONT                  	0x01


//--------------------------------------------------
// Definations of Red/Green/Blue
//--------------------------------------------------
#define _RED                            		0
#define _GREEN                          	1
#define _BLUE                           	2
#define USER_RED                      	3
#define USER_GREEN                  	4
#define USER_BLUE                     	5

#define _PR                            	0  
#define _Y                          	1
#define _PB                           	2

//--------------------------------------------------
// Definations of DDC Channel
//--------------------------------------------------
#define _DDC2                           0
#define _DDC3                           1

//--------------------------------------------------
// Definations of Scaling
//--------------------------------------------------
#define _SCALE_DOWN                 0
#define _SCALE_UP                       1

//--------------------------------------------------
// Definitions of Display Delay
//--------------------------------------------------
#define _CAPTURE_HDELAY                 	3
#define _PROGRAM_HDELAY                 	10
#define _PROGRAM_VDELAY                 	2
#define _MEASURE_HDEALY                 	7

//--------------------------------------------------
// Global Macros
//--------------------------------------------------
#define LOBYTE(w)                       		((BYTE)(w))
#define HIBYTE(w)                       		((BYTE)(((WORD)(w) >> 8) & 0x00FF))
#define SEC(x)                          			(100 * x)
#define SHL(x,y)			    	    		((x) << (y))
#define SHR(x,y)				        	((x) >> (y))
#define AND(n1,n2)  			        	((n1) & (n2))
#define OR(n1,n2)   			        	((n1) | (n2))


//premier
#define _LED_MSG_RED				0
#define _LED_MSG_GREEN				1
#define _LED_MSG_YELLOW			2
#define _LED_MSG_BLACK				3
#define _LED_MSG_FLASH_RED		4
#define _LED_MSG_FLASH_GREEN		5
#define _LED_MSG_FLASH_YELLOW		6

/*=====================  Extern Variables =================== */
#ifdef _IR_C
    #define EXTERN
#else
    #define EXTERN   extern
#endif

#undef EXTERN

/*======================= Extern Functions ================== */

#endif 

