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

📄 pnl_pvi07_dt.h

📁 MST720-DEMO程序
💻 H
📖 第 1 页 / 共 2 页
字号:
/******************************************************************************
 Copyright (c) 2003 MStar Semiconductor, Inc.
 All rights reserved.

 [Module Name]: Pnl_PVI07_DT.h
 [Date]:	19-Mar-2004
 [Comment]:
   Panel parameters.[PM070WX1] 800X480
 [Reversion History]:
*******************************************************************************/

#ifndef __PVI07DT_H
#define __PVI07DT_H


///////////////////////////////////////////////
// Common setting
///////////////////////////////////////////////
#define PANEL_NAME		"PVI07_DT"
#define PANEL_DOT_WIDTH 	107		// unit: um
#define PANEL_DOT_HEIGHT	372		// unit: um

//////////////////////////////////////////////
// Panel output
//////////////////////////////////////////////
#define PANEL_DITHER		1		// 8/6 bits panel

#define PANEL_LVDS			0
#define PANEL_TTL		0
#define PANEL_TCON		1
#define PANEL_ANALOG_TCON	0

#define PANEL_SWAP_LVDS_POL 0
#define PANEL_SWAP_LVDS_CH	0
#define PANEL_LVDS_TI_MODE		0

#define PANEL_6BIT_OUT		1		// 0/1: 8BIT/6BIT out
#define PANEL_DITHER_ENABLE	1		// 0/1:Enable/Disable
#define PANEL_DITHER_CONTROL	0x0C+(PANEL_6BIT_OUT<<1)+PANEL_DITHER_ENABLE

#define PANEL_SWAP_8BIT_ML	0
#define PANEL_SWAP_6BIT_ML	1
#define PANEL_SWAP_RB		1
#define PANEL_SWAP_CONTROL	(PANEL_SWAP_RB<<2)+(PANEL_SWAP_6BIT_ML<<1)+PANEL_SWAP_8BIT_ML

#define PANEL_DCLK_DELAY	0x0		// Range (0~F)
#define PANEL_INV_DCLK		1		// 1: Invert output DCLK
#define PANEL_INV_DE		0		// 1: Invert output DE
#define PANEL_INV_VSYNC 	0		// 1: Invert output VSYNC
#define PANEL_INV_HSYNC 	0		// 1: Invert output HSYNC
#define PANEL_SYNC_CONTROL	(PANEL_DCLK_DELAY<<4)+(PANEL_INV_DCLK<<3)+(PANEL_INV_DE<<2) \
				+(PANEL_INV_VSYNC<<1)+PANEL_INV_HSYNC	
// Lock Y line
#define PANEL_LOCK_Y_LINE	0

///////////////////////////////////////////////
// Output tmming setting
///////////////////////////////////////////////
// driving current setting (0x00=4mA, 0x01=6mA, 0x02=8mA, 0x03=12mA)
#define PANEL_DCLK_CURRENT	0x01		// DCLK current
#define PANEL_DE_CURRENT	0x01		// DE signal current
#define PANEL_HS_CURRENT	0x01		// HSYNC current
#define PANEL_VS_CURRENT	0x01		// VSYNC current
#define PANEL_BM_CURRENT	0x01		// B data High-Nibble current
#define PANEL_BL_CURRENT	0x01		// B data Low-Nibble current
#define PANEL_GM_CURRENT	0x01		// G data High-Nibble current
#define PANEL_GL_CURRENT	0x01		// G data Low-Nibble current
#define PANEL_RM_CURRENT	0x01		// R data High-Nibble current
#define PANEL_RL_CURRENT	0x01		// R data Low-Nibble current

#define PANEL_ADCLK_CURRENT	0x01		// Analog Panel DCLK current

#define PANEL_ON_TIMING1	0		// time between panel & data while turn on power
#define PANEL_ON_TIMING2	50		// time between data & back light while turn on power
#define PANEL_OFF_TIMING1	20		// time between back light & data while turn off power
#define PANEL_OFF_TIMING2	0		// time between data & panel while turn off power

#define PANEL_HSYNC_WIDTH		32
#define PANEL_HSYNC_BACK_PORCH	199

#define PANEL_VSYNC_WIDTH	  	4
#define PANEL_VSYNC_BACK_PORCH	24

#define PANEL_HSTART		(PANEL_HSYNC_WIDTH + PANEL_HSYNC_BACK_PORCH)
#define PANEL_VSTART		(PANEL_VSYNC_WIDTH + PANEL_VSYNC_BACK_PORCH)
#define PANEL_WIDTH		800
#define PANEL_HEIGHT		480
#define PANEL_HTOTAL		1051
#define PANEL_VTOTAL		525

#define PANEL_MAX_HTOTAL	1300
#define PANEL_MIN_HTOTAL	1035
#define PANEL_MAX_VTOTAL	750
#define PANEL_MIN_VTOTAL	610
#define PANEL_DCLK		(((DWORD)PANEL_HTOTAL*PANEL_VTOTAL*60)/1000000)
#define PANEL_MAX_DCLK		42
#define PANEL_MIN_DCLK		30

///////////////////////////////////////////////
// Panel color default setting
///////////////////////////////////////////////
#define _COLOR_DEF_CONTRAST		0x88
#define _COLOR_DEF_SATURATION		0x88
#define _COLOR_DEF_HUE			50
#define _COLOR_DEF_CB			0x96
#define _COLOR_DEF_CR			0x6A
#define _INIT_VD_SATURATION		0x80	// for BK3.65h initial setting
#define _INIT_VD_BRT				0x80		//for BK3.64h intial setting
#define _INIT_VD_CON				0x92		//for BK3.63h intial setting

#ifdef _MST7X_C_
BYTE code tPanel_InitialTable[]=
{
	0x03, BK0_25_OPL_SET0, 			// Set output clock (32.5MHz)
	0x00, 0x50, 0x32,				// BK0_25_OPL_SET0, BK0_26_OPL_SET1, BK0_27_OPL_SET2

	0x01, BK0_36_VDSUSG,
	0x0C,					// BK0_36_VDSUSG

	0x17, BK0_40_VFDEST_L,
	0x00,	//LOBYTE(PANEL_VSTART), 		// VFDEST [41:40]
	0x00,	//HIBYTE(PANEL_VSTART),		// BK0_40_VFDEST_L, BK0_41_VFDEST_H
	0x01,	//LOBYTE(PANEL_HSTART), 		// HFDEST [43:42]
	0x00,	//HIBYTE(PANEL_HSTART),		// BK0_42_HFDEST_L, BK0_43_HFDEST_H
	LOBYTE(PANEL_HEIGHT),			// VFDEEND [45:44]
	HIBYTE(PANEL_HEIGHT),			// BK0_44_VFDEEND_L, BK0_45_VFDEEND_H
	LOBYTE(PANEL_HTOTAL-1), 		// HFDEEND [47:46]
	HIBYTE(PANEL_HTOTAL-1), 			// BK0_46_HFDEEND_L, BK0_47_HFDEEND_H
	0xF0, 0x00,				// SIHST [49:48]	// BK0_48_SIHST_L, BK0_49_SIHST_H
	LOBYTE(PANEL_HEIGHT),			// SIVEND [4B:4A]
	HIBYTE(PANEL_HEIGHT),			// BK0_4A_SIVEND_L, BK0_4B_SIVEND_H
	LOBYTE(PANEL_WIDTH+0xF8),		// SIHEND [4D:4C]
	HIBYTE(PANEL_WIDTH+0xF8),		// BK0_4C_SIHEND_L, BK0_4D_SIHEND_H
	LOBYTE(PANEL_VTOTAL),			// VDTOT [4F:4E]
	HIBYTE(PANEL_VTOTAL),			// BK0_4E_VDTOT_L, BK0_4F_VDTOT_H
	// BK0_50_VSST_L, BK0_51_VSST_H, BK0_52_VSEND_L, BK0_53_VSEND_H
	0xE8,	//LOBYTE(PANEL_VTOTAL-PANEL_VSTART),	// VSST [51:50]
	0x09,	//HIBYTE(PANEL_VTOTAL-PANEL_VSTART),
	0x00,	//LOBYTE(PANEL_VTOTAL-PANEL_VSYNC_WIDTH-PANEL_VSYNC_BACK_PORCH),	// VSEND [53:52]
	0x02,	//HIBYTE(PANEL_VTOTAL-PANEL_VSYNC_WIDTH-PANEL_VSYNC_BACK_PORCH),
	LOBYTE(PANEL_HTOTAL-1), 		// HDTOT [55:54]
	HIBYTE(PANEL_HTOTAL-1),			// BK0_54_HDTOT_L, BK0_55_HDTOT_H
	PANEL_HSYNC_WIDTH,			// BK0_56_HSEND

	0x01, BK0_60_DITHCTRL,
	PANEL_DITHER_CONTROL,			// BK0_60_DITHCTRL

	0x01, BK0_86_FNTN_TEST,
	PANEL_SWAP_CONTROL,			// BK0_86_FNTN_TEST

	0x01, BK0_B1_SYNC_CONTROL,
	PANEL_SYNC_CONTROL,			// BK0_B1_SYNC_CONTROL
	
	-1,
	
};

// ************ ACE setting start ****************

BYTE code tMsACETable[]=
{
	
	1, GEN_00_REGBK,			// select register bank ADC
	REGBANKADC,			// GEN_00_REGBK
	
	// MACE setting start
	
	// lpf 9 tap  0x50
	5, BK1_50_LPF_TAP1,
	0x7E, 0x04,			// BK1_50_LPF_TAP1, BK1_51_LPF_TAP2
	0x3C, 0x04,			// BK1_52_LPF_TAP3, BK1_53_LPF_TAP4
	0x1C,				// BK1_54_LPF_TAP5

	// wle and ble (enable)   0x7F 0x80
	2, BK1_7F_MAX_PIX,
	0xFA, 0x08,			// BK1_7F_MAX_PIX, BK1_80_MIN_PIX
	
	// 0x7e   03 to 02 jordan0608  solve vetical line disable white peaking
	1, BK1_7E_VIP_Y_CTRL,	
	0x03,				// BK1_7E_VIP_Y_CTRL

	// fcc	0x56-0x76
	33, BK1_56_FCC_CB_1T,
	0x72, 0x93, 0x6E, 0xAC, 0x9D, 0x6B, 0x5A, 0x9A,	// BK1_56, BK1_57, BK1_58, BK1_59, BK1_5A, BK1_5B, BK1_5C, BK1_5D,
	0x5D, 0x75, 0xB0, 0x48, 0x64, 0xC8, 0x80, 0x80,	// BK1_5E, BK1_5F, BK1_60, BK1_61, BK1_62, BK1_63, BK1_64, BK1_65, 
	0x80, 0x80, 0xB2, 0xBA, 0xFB, 0x73, 0xFB, 0xFB,	// BK1_66, BK1_67, BK1_68, BK1_69, BK1_6A, BK1_6B, BK1_6C, BK1_6D,
	0xFF, 0x6A, 0x00, 0xFF, 0x40, 0x88, 0x88, 0x85,	// BK1_6E, BK1_6F, BK1_70, BK1_71, BK1_72, BK1_73, BK1_74, BK1_75,
	0x4B,						// BK1_76,

	// lpf + (diff peak)  0x88
	1, BK1_88_YC_LPF,
	0x1C,				// BK1_88_YC_LPF
	
	// band 1  0x78
	1, BK1_78_PEAK_BAND1,	 
	0x9F,				// BK1_78_PEAK_BAND1

	2, BK1_81_EGE_BAND1_POS,
	0x10, 0x30,			// BK1_81_EGE_BAND1_POS, BK1_82_EGE_BAND1_NEG
	
	// band 2  0x79
	1, BK1_79_PEAK_BAND2,
	0x5F,				// BK1_79_PEAK_BAND2

	2, BK1_83_EGE_BAND2_POS,
	0x04, 0x10,			// BK1_83_EGE_BAND2_POS, BK1_84_EGE_BAND2_NEG
	
	// lti	0x7a
	1, BK1_7A_LTI,
	0xDA,				// BK1_7A_LTI

	2, BK1_86_EGE_LTI_POS,
	0x00, 0x00,			// BK1_86_EGE_LTI_POS, BK1_87_EGE_LTI_NEG

	3, BK1_7B_TERM_SEL,
	0xB5,				// mix term	BK1_7B_TERM_SEL
	0x84,				// coring		BK1_7C_CROING
	0x70,				// cti		BK1_7D_CTI

	// enable cti_med cti lti_med lti peak lpftap (csc)   0x77
	1, BK1_77_APP_CTRL,
	0x7E,				// BK1_77_APP_CTRL

	//bri_YPbPr   0x85
	 1, BK1_85_M_BRI,			// 0xE0 for Mode1_CSC_Bypass "1110b"
	 0xF8,				// BK1_85_M_BRI
	
	// MACE setting end
	
	1, GEN_00_REGBK,			// select register bank scaler
	REGBANKSCALER,			// GEN_00_REGBK
	
	-1,
};


BYTE code tGammaTableNormal[3][33]=
{
	
	{
		0x00,0x03,0x08,0x0F,0x18,0x21,0x2C,0x36,0x42,0x4D,0x57,
		0x62,0x6B,0x74,0x7C,0x84,0x8C,0x94,0x9C,0xA4,0xAC,0xB3,
		0xBA,0xC2,0xC9,0xD0,0xD7,0xDE,0xE5,0xEB,0xF2,0xF8,0xFF,
	},
	{
		0x00,0x03,0x08,0x0F,0x18,0x21,0x2C,0x36,0x42,0x4D,0x57,
		0x62,0x6B,0x74,0x7C,0x84,0x8C,0x94,0x9C,0xA4,0xAC,0xB3,
		0xBA,0xC2,0xC9,0xD0,0xD7,0xDE,0xE5,0xEB,0xF2,0xF8,0xFF,
	},
	{
		0x00,0x03,0x08,0x0F,0x18,0x21,0x2C,0x36,0x42,0x4D,0x57,
		0x62,0x6B,0x74,0x7C,0x84,0x8C,0x94,0x9C,0xA4,0xAC,0xB3,
		0xBA,0xC2,0xC9,0xD0,0xD7,0xDE,0xE5,0xEB,0xF2,0xF8,0xFF,
	},
	
};

short code tVideoColorCorrectionMatrix[][3]=
{
   0x0430,-0x0032, 0x0008, 0x0030, 0x03CD, 0x0008,-0x00A2, 0x0043,
   0x0450,-0xF4E7, 0x9FCB,-0x64C3, 0x6C04,-0x7A3B, 0x623E,-0xD1D5,
  -0x0FC2, 0xBD4E, 0xC6FD,-0xF33E, 0xE935, 0x75ED,-0x768D, 0xC174,
  -0xD43C, 0x3A18,-0xE00A, 0xD6E3,-0x330C, 0x0A84,-0xB7A0, 0xF369,
};

//**************************************************************************

#else	// _MST7X_C_
extern BYTE code tMsACETable[];
extern BYTE code tGammaTableNormal[3][33];
extern short code tVideoColorCorrectionMatrix[][3];

#endif	//_MST7X_C_

#ifdef _SYNC_C_
/****************************** CVBS Timing Table ****************************/
BYTE code tSyncCVBSNTSCTable[] =
{
	1, GEN_00_REGBK,			// select register bank scaler
	REGBANKSCALER,

	//20050921 (set bit3 to avoid BK0_1D produce wrong message for VCR) 
	1, BK0_03_IPCTRL2,		// Set Capture  
	0x88,					// BK0_03_IPCTRL2,

#if DEMODULELATOR_MODE
	
	9, BK0_05_SPRVST_L,		// Set Capture
//	0x2B, 0x00, 
	0x05, 0x00,			// BK0_05_SPRVST_L, BK0_06_SPRVST_H    //20050921 To complement V-shift due to set the BK0_03[3]
	0xC9, 0x00,
	0xD4, 0x01,
	0x00, 0x06,
	0x00,

	7, BK0_30_SRH_L,			// Set H&V scaling rate
	0x00, 0x80, 0xC5,
	0x00, 0xC0, 0x87, 0x10,
		
#else

	9, BK0_05_SPRVST_L,		// Set Capture
	0x29, 0x00, 
	0x56, 0x00,
	0xD4, 0x01,
	0x30, 0x03,
	0x03,

	7, BK0_30_SRH_L,			// Set H&V scaling rate
	0x00, 0x00, 0x00,
	0x00, 0xC0, 0x87, 0x0C,

#endif
	-1
};

BYTE code tSyncCVBSPALTable[] =
{
	1, GEN_00_REGBK,			// select register bank scaler
	REGBANKSCALER,

	//20050921 (set bit3 to avoid BK0_1D produce wrong message for VCR) 
	1, BK0_03_IPCTRL2,		// Set Capture  
	0x88,					// BK0_03_IPCTRL2,

#if DEMODULELATOR_MODE
	
	9, BK0_05_SPRVST_L,		// Set Capture
//	0x31, 0x00, 
	0x05, 0x00,			// BK0_05_SPRVST_L, BK0_06_SPRVST_H    //20050921 To complement V-shift due to set the BK0_03[3]
	0x03, 0x01,
	0x3A, 0x02,
	0xA0, 0x05,
	0x00,

	7, BK0_30_SRH_L,			// Set H&V scaling rate
	0x00, 0x80, 0xC5,
	0x77, 0x77, 0x89, 0x0C,
		
#else

	9, BK0_05_SPRVST_L,		// Set Capture
	0x2A, 0x00, 
	0xA9, 0x00,

⌨️ 快捷键说明

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