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

📄 pcb_pv013ba1.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_5150

// Audio Type
#define _AUDIO_NONE				0
#define _AUDIO_7496				1
#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


//********************************************************** 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		1	// enable control pin of invertor	// enable path through 2 transistors
#define _LIGHT_DISABLE		0

#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

/*
// video ch sel (using NJM2244)
#define _VIDEO_CH_AV1		0		// _TRUE: enable to show "HUE"
#define _VIDEO_CH_AV2		1		// _TRUE: enable to show "HUE"
#define VideoSelCHAV1()		{bVideoCh = _VIDEO_CH_AV1;}
#define VideoSelCHAV2()		{bVideoCh = _VIDEO_CH_AV2;}

// Infrared audio emitter setting
#define _INFRARED_ENABLE	_FALSE//_TRUE//
#if 0//(_INFRARED_ENABLE == _TRUE)
#define _INFRARED_23_28		1
#define _INFRARED_33_38		0
#define InfraredEmitter_23_28()	{;}
#define InfraredEmitter_33_38()	{;}
#endif
*/
//************************************************************ 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 1	// 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 PCB MISC
// Define panel 12v  EVAN 050512
#define _POWER12VUSE			_OFF
//**************************************************************** END PCB MISC


//**************************************************** START MCU PIN ASSIGNMENT
sbit bDIRLR					= P1^0;
sbit bDIRUD					= P1^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[1]	// enable control pin
#define bLIGHTPOWER			MCU_PORT5_F30[3]
#define bPANELPOWER			MCU_PORT5_F30[4]	//error since connecting to NC(P1), use P5.4
#if(_POWER12VUSE == _ON)
sbit bPANELPOWER12V			= P1^2;				//unused in this file
#endif
sbit bIR_GPIO				= P3^2;

#define bVIDEORESET			MCU_PORT6_F38[7]	//Video reset pin, low active.
#define bVIDEOPOWER			MCU_PORT6_F38[5]

#if (_PCB_RIGHTECH_A_USE_PV013BA1 == _FALSE)
sbit bLEDGREEN				= P3^3;
#else
sbit bInfraredEmitter			= P3^3;		// infrared audio emitter control, L:3.3/3.8 | H:2.3/2.8
// Infrared audio emitter setting
#define _INFRARED_ENABLE	_TRUE//_FALSE//
#if (_INFRARED_ENABLE == _TRUE)
//#define _INFRARED_23_28		1
//#define _INFRARED_33_38		0
//20050810, update, by request
#define _INFRARED_23_28		0
#define _INFRARED_33_38		1
#define InfraredEmitter_23_28()	{bInfraredEmitter = _INFRARED_23_28;}
#define InfraredEmitter_33_38()	{bInfraredEmitter = _INFRARED_33_38;}
#endif
#endif
#define bLEDRED				MCU_PORT5_F30[6]	//test only

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


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

sbit b4052A					= P3^4;
sbit b4052B					= P3^5; 

// I/O key definition
#if (_KEYPAD_TYPE == _KEYPAD_TYPE_700_0365_X)	// led used
#define bPOWER_KEY		(MCU_PORT5_F30[5]&0x01)
#define bLEFT_KEY		(MCU_PORT6_F38[3]&0x01)	// Down
#define bRIGHT_KEY		(MCU_PORT6_F38[2]&0x01)	// Up
#define bMENU_KEY		(MCU_PORT6_F38[0]&0x01)	// Menu
// customer's keypad reverse this:
//#define bVIDEO1			(MCU_PORT6_F38[1]&0x01)	// TV key
//sbit 	bVIDEO2			= P1^7;					// v1/v2 key
//---------x.hu, 20050803, update-------------//
#define bVIDEO2			(MCU_PORT6_F38[1]&0x01)	// TV key
sbit 	bVIDEO1			= P1^7;					// v1/v2 key
sbit	bSource			= P1^7;					// for 1 key source change
#elif (_KEYPAD_TYPE == _KEYPAD_TYPE_700_0345_X)	//led nc

#if (_CUSTOM_HAOZHEN_PRJ5K == _TRUE)
#define bPOWER_KEY		(MCU_PORT5_F30[5]&0x01)
#define bRIGHT_KEY		(MCU_PORT6_F38[2]&0x01)	// Down
#define bLEFT_KEY		(MCU_PORT6_F38[3]&0x01)	// up
#define bVIDEO1			(MCU_PORT6_F38[1]&0x01)	// TV key
sbit 	bVIDEO2			= P1^7;					// v1/v2 key
sbit	bSource			= P1^7;						// for 1 key source change
#define bMENU_KEY		(MCU_PORT6_F38[0]&0x01)	// Menu
#else
#define bPOWER_KEY		(MCU_PORT5_F30[5]&0x01)
#define bLEFT_KEY		(MCU_PORT6_F38[2]&0x01)	// Down
#define bRIGHT_KEY		(MCU_PORT6_F38[3]&0x01)	// up
#define bVIDEO1			(MCU_PORT6_F38[1]&0x01)	// TV key
sbit 	bVIDEO2			= P1^7;					// v1/v2 key
sbit	bSource			= P1^7;					// for 1 key source change
#define bMENU_KEY		(MCU_PORT6_F38[0]&0x01)	// Menu
#endif
#elif (_KEYPAD_TYPE == _KEYPAD_TYPE_RT88A)

/*
#define bPOWER_KEY			(MCU_PORT5_F30[5]&0x01)
#define bLEFT_KEY			(MCU_PORT6_F38[2]&0x01)		// Down
#define bRIGHT_KEY			(MCU_PORT6_F38[3]&0x01)		// Up
sbit 	bVIDEO2				= P1^7;						// v1/v2 key
sbit	bSource				= P1^7;						// for 1 key source change
#define bMENU_KEY			(MCU_PORT6_F38[0]&0x01)		// Menu
#define bVIDEO1				(MCU_PORT6_F38[1]&0x01)		// TV key
*/
//20050810
#define 	bMENU_KEY		(MCU_PORT5_F30[5]&0x01)
#define 	bVIDEO1		(MCU_PORT6_F38[2]&0x01)	
#define 	bVIDEO2		(MCU_PORT6_F38[3]&0x01)	
sbit 		bLEFT_KEY		= P1^7;						
#define 	bPOWER_KEY	(MCU_PORT6_F38[0]&0x01)	
#define 	bRIGHT_KEY		(MCU_PORT6_F38[1]&0x01)		

#define bSource			bVIDEO1				
#elif (_KEYPAD_TYPE == _KEYPAD_TYPE_DEFAULT)		
#define bPOWER_KEY		(MCU_PORT5_F30[5]&0x01)
#define bLEFT_KEY		(MCU_PORT6_F38[3]&0x01)
#define bRIGHT_KEY		(MCU_PORT6_F38[2]&0x01)
sbit bMENU_KEY			= P1^7;
#define bVIDEO1			(MCU_PORT6_F38[0]&0x01)
#define bVIDEO2			(MCU_PORT6_F38[1]&0x01)
#define bSource			bVIDEO2
#else 
#define bPOWER_KEY		(MCU_PORT5_F30[5]&0x01)
#define bLEFT_KEY		(MCU_PORT6_F38[2]&0x01)	// Down
#define bRIGHT_KEY		(MCU_PORT6_F38[3]&0x01)	// up
sbit 	bVIDEO2			= P1^7;					// v1/v2 key
sbit	bSource			= P1^7;					// for 1 key source change
#define bMENU_KEY		(MCU_PORT6_F38[0]&0x01)	// Menu
#define bVIDEO1			(MCU_PORT6_F38[1]&0x01)	// TV key
#endif
//****************************************************** END MCU PIN ASSIGNMENT



⌨️ 快捷键说明

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