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

📄 pcb_pv023bc1.h

📁 车载 液晶显示器的主控程序(主要使用芯片为 MYSON MTV512 单片机、RealTek 2323 Scare 芯片、TVP5147(视频解码)。配Sharp 8寸液晶显示器 )。
💻 H
字号:
//----------------------------------------------------------------------------------------------------
// PCB NAME		: PV013BA1.pcb
// DESIGNED BY	: Premier
//----------------------------------------------------------------------------------------------------


//************************************************************ START PCB CONFIG
// MCU Type
#define _MYSON_MTV312			1
#define _MYSON_MTV512			2
#define _MCU_TYPE				_MYSON_MTV512

// Scaler Type
#define _RTD2323				0
#define _RTD2023L				1
#define _RTD2023S				2
#define _RTD2023L_SHRINK		3
#define _SCALER_TYPE			_RTD2323

// Definations of Host Interface (Parallel/Serial Port)
#define _SERIAL_PORT			0
#define _PARALLEL_PORT			1
#define _HOST_INTERFACE		_SERIAL_PORT

// Video Type
#define _VIDEO_5150				0
#define _VIDEO_5147				1
#define _VIDEO_TYPE				_VIDEO_5147

// Audio Type
#define _AUDIO_NONE			0
#define _AUDIO_7496				1
#define _AUDIO_DA7052A               2
#define _AUDIO_DEVICE			_AUDIO_NONE

// Definations of RTD/MCU Crystal Frequency in KHz
#define _XTAL12000K				12000
#define _XTAL24576K				24576
#define _XTAL24000K				24000
#define _RTD_XTAL				_XTAL24000K
#define _MCU_XTAL				_XTAL24000K

// RTD2323 Internal Regulator Active
//   __FALSE: use external 3.3v-->1.8v regulator
//   __TRUE : use internal 3.3v-->1.8v regulator
#define _INTERNAL_REGULATOR		_FALSE

// Definitions for Backlight PWM Setting
#define _PWM0						0
#define _PWM1						1
#define _PWM2						2
#define _MCUPWM						3
#define _BACKLIGHT_PWM				_MCUPWM
#define _BACKLIGHT_PWM_INVERSE		_DISABLE
//************************************************************** END PCB CONFIG
#define _POWER12VUSE  _OFF

//********************************************************** START MACRO OPTION
// Definitions for GPIO Control
#define _PANEL_ON			0   // Power on  state for LCD panel 
#define _PANEL_OFF			1   // Power off state for LCD panel

#define _LIGHT_ON			0	// Power on  state for backlight inverter
#define _LIGHT_OFF			1	// Power off state for backlight inverter

#define _LIGHT_ENABLE		0	// enable control pin of invertor	// enable path through 1 transistors
#define _LIGHT_DISABLE		1

#define _VDC_ON				0   // Power on  state for video decoder
#define _VDC_OFF			1   // Power off state for video decoder

#define _LVDS_ON			0   // Power on  state for LVDS Tx
#define _LVDS_OFF			1   // Power off state for LVDS Tx

#define _LED_ON				0   // Power on  state for LED
#define _LED_OFF			1   // Power off state for LED

//************************************************************ END MACRO OPTION
//version 200D
//--------------------------------------------------
// RTD2023L and RTD2023S Pin Share
//--------------------------------------------------
#define _PIN_21_TO_40               (0 & 0x03)  // 0 ~ 1
#define _PIN_16_17_OR_43_44         (0 & 0x03)  // 0 ~ 1



//************************************************************* START PIN SHARE
// RTD2323 Pin Share
// 6bit TCON
#if (_PANEL_STYLE == _PANEL_TCON)	//for TCON Pin Define
#define _PIN_3				(0 & 0x03)  // 0 ~ 3		// to power 3.3v
#define _PIN_4				(0 & 0x03)  // 0 ~ 3		// to power 3.3v
#define _PIN_48				(0 & 0x03)  // 0 ~ 3		//tcon 0
#define _PIN_49				(3 & 0x03)  // 0 ~ 3		//tcon 1

#define _PIN_50_51			(1 & 0x01)  // 0 ~ 1	//tcon 4,tcon 9
#define _PIN_52_53			(0 & 0x01)  // 0 ~ 1	//tcon 13,tcon 7
#define _PIN_54				(0 & 0x03)  // 0 ~ 3		//tcon 11
#define _PIN_55_56_57		(0 & 0x01)  // 0 ~ 1	//tcon 0,tcon 12,tcon 3
#define _PIN_122_FUNC		(0 & 0x01)  // 0 ~ 1	// NC pin
#define _PIN_110			(0 & 0x01)  // 0 ~ 1		//NC pin

#define _PIN_111			(3 & 0x03)  // 0 ~ 3		//tcon 2
#define _PIN_112_113_114	(0 & 0x03)  // 0 ~ 3	//tcon 10,tcon 8,tcon 5
#define _PIN_115_118_119	(0 & 0x01)  // 0 ~ 1	//SDIO3,SCSB,SCLK
#define _PIN_120_121		(1 & 0x03)  // 0 ~ 3		//NC pin
#define _PIN_122			(0 & 0x01)  // 0 ~ 1			//NC pin
#endif

//8Bit TTL
#if (_PANEL_STYLE == _PANEL_TTL)	//for TTL Pin Define
#define _PIN_3				(0 & 0x03)  // 0 ~ 3		// PWM0
#define _PIN_4				(0 & 0x03)  // 0 ~ 3		// PWM1
#define _PIN_48				(2 & 0x03)  // 0 ~ 3		// DHS
#define _PIN_49				(2 & 0x03)  // 0 ~ 3		// DVS

#define _PIN_50_51 			(0 & 0x01)  // 0 ~ 1		// 
#define _PIN_52_53			(1 & 0x01)  // 0 ~ 1		// DEN
#define _PIN_54				(2 & 0x03)  // 0 ~ 3		// 
#define _PIN_55_56_57		(1 & 0x01)  // 0 ~ 1		// Serial interface
#define _PIN_122_FUNC		(0 & 0x01)  // 0 ~ 1		// 
#define _PIN_110			(0 & 0x01)  // 0 ~ 1		// 

#define _PIN_111			(0 & 0x01)	// V0 of V8 port2
#define _PIN_112_113_114	(0 & 0x01)	// V1-V3 of V8 port2
#define _PIN_115_118_119	(0 & 0x01)  // V4-V6 of V8 port2
#define _PIN_120_121		(0 & 0x03)  // V7/VCLK of V8 port2
#define _PIN_122			(0 & 0x01)  // 
#endif

//LVDS
#if (_PANEL_STYLE == _PANEL_LVDS)	//for RSDS and LVDS Pin Define
#define _PIN_3				(0 & 0x03)  // 0 ~ 3
#define _PIN_4				(0 & 0x03)  // 0 ~ 3
#define _PIN_48				(3 & 0x03)  // 0 ~ 3		2: DHS; 3: TCON0
#define _PIN_49				(3 & 0x03)  // 0 ~ 3		2: DVS; 3: TCON1

#define _PIN_50_51			(1 & 0x01)  // 0 ~ 1
#define _PIN_52_53			(0 & 0x01)  // 0 ~ 1
#define _PIN_54				(0 & 0x03)  // 0 ~ 3		TTL Output should be 2
#define _PIN_55_56_57		(0 & 0x01)  // 0 ~ 1		TTL Output should be 1
#define _PIN_122_FUNC		(0 & 0x01)  // 0 ~ 1
#define _PIN_110			(1 & 0x01)  // 0 ~ 1
	#if 0	// use video8 2nd port
#define _PIN_111			(0 & 0x03)  // 0 ~ 3
#define _PIN_112_113_114	(0 & 0x03)  // 0 ~ 3
#define _PIN_115_118_119	(0 & 0x01)  // 0 ~ 1
#define _PIN_120_121		(0 & 0x03)  // 0 ~ 3
#define _PIN_122			(0 & 0x01)  // 0 ~ 1
	#else
#define _PIN_111			(1 & 0x03)  // 0 ~ 3
#define _PIN_112_113_114	(1 & 0x03)  // 0 ~ 3
#define _PIN_115_118_119	(0 & 0x01)  // 0 ~ 1
#define _PIN_120_121		(2 & 0x03)  // 0 ~ 3
#define _PIN_122			(0 & 0x01)  // 0 ~ 1
	#endif
#endif
//*************************************************************** END PIN SHARE


//**************************************************** START MCU PIN ASSIGNMENT
#define bDIRLR			MCU_PORT6_F38[0]
#define bDIRUD			MCU_PORT6_F38[1]
sbit bI2CSDA				= P1^2;
sbit bI2CSCL				= P1^3;
sbit bSCALERSDIO3		= P1^4;
sbit bSCALERSCSB		= P1^5; 
sbit bSCALERSCLK			= P1^6;

#define bLIGHT_ENABLE		MCU_PORT5_F30[2]	// enable control pin
sbit bPANELPOWER			= P1^0;	
sbit bIR_GPIO				= P3^2;

#define bVIDEORESET			MCU_PORT6_F38[3]

#define bLEDGREEN			MCU_PORT7_F76[0]
#define bLEDRED				MCU_PORT7_F76[1]

sbit bDVICONNECT			= P3^2; 			//only for test
sbit bVGACONNECT			= P3^2;	

#define BL_BRIGHT_PORT		MCU_DAC_F20[1]
#define VOLUME_PORT		MCU_DAC_F20[0]

#define b4052A				MCU_PORT6_F38[4]
#define b4052B				b4052A

// I/O key definition
sbit 		bPOWER_KEY		= P3^5;	
sbit 		bMENU_KEY			= P3^4;	
sbit 	bEXIT					= P3^3;		// ????
#define bSource 				(MCU_PORT5_F30[3]&0x01)	//k7
#define 	bLEFT_KEY			(MCU_PORT5_F30[4]&0x01)	//k6
#define 	bRIGHT_KEY				(MCU_PORT5_F30[5]&0x01)	

#define 	bVIDEO1			(MCU_PORT5_F30[6]&0x01)
#define 	bVIDEO2			(MCU_PORT5_F30[7]&0x01)


//****************************************************** END MCU PIN ASSIGNMENT



⌨️ 快捷键说明

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