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

📄 uart_dvh.h

📁 MXIC旺宏液晶电视芯片MX88V44的源码
💻 H
字号:
/*-------------------------------------------------------------------------
UART_DVH.H

Copyright 2004 Macronix International Co., Ltd.
-------------------------------------------------------------------------*/
#ifndef _UART_DV_H_
	#define _UART_DV_H_

	#ifndef _UART_DV_
    	#define global_uart_dv     extern
	#else
    	#define global_uart_dv
	#endif

	//*-------------------------------------------------------------------
	//*			Global Constants
	//*-------------------------------------------------------------------

	//============== Command definition ===================================
	#define	ACK				0x06
	#define	NACK			0x09
									//--- Command to device (PC --> Device)
	#define UARTBAUD		0x05	//set UART baud rate

	#define	MEMRD			0xA0	//read	memory data
	#define	REGRD15xx		0xA1	//read	register data
	#define	REGRDTVTuner	0xA2
	#define	REGRDTVDecoder	0xA3
	#define	REGRDOSDCtrl	0xA4
	#define	REGRDOSDCode	0xA5
	#define	REGRDOSDAttr	0xA6
	#define	RDEEPROM		0xA7
	#define	RDGAMMA			0xA8

	#define	MEMWR			0xC0	//write	memory data
	#define	REGWR15xx		0xC1	//write	register data
	#define	REGWRTVTuner	0xC2
	#define	REGWRTVDecoder	0xC3
	#define	REGWROSDCtrl	0xC4
	#define	REGWROSDCode	0xC5
	#define	REGWROSDAttr	0xC6
	#define	WREEPROM		0xC7
	#define	WRGAMMA			0xC8

	#define GETDEV			0x20	//get device information
								//--- Command from device (Device --> PC)
	#define	MEMRP			0xE0	//respond memory data
	#define	REGRP15xx		0xE1	//respond register data
	#define	REGRPTVTuner	0xE2
	#define	REGRPTVDecoder	0xE3
	#define	REGRPOSDCtrl	0xE4
	#define	REGRPOSDCode	0xE5
	#define	REGRPOSDAttr	0xE6
	#define	RPEEPROM		0xE7
	#define	RPGAMMA			0xE7

	#define	MSGSHOW			0x0A	//show message in PC
	#define	DEVICEINF		0x28	//respond device inf
									//include Project#, IC version
									//FW version and PCB version.
	#define	FILLMEM			0xF0
	#define	UART_PACK_SIZE	8

	//============== UART Parameter Define ================================

	#define	RX_PARSE		0x80	//pack data ready, wait process Parse routine
	#define RX_HAS_DATA		0x40
	#define	RX_SYN1			0x10	//SYN1 byte rx complete
	#define TX_WAITACK		0x08	//wait ACK command
	#define TX_HAS_DATA		0x04
	#define	TX_FLAG			0x01	//UART in TX state
	#define	CLEAN_UARTFlag	0xFF	//XOR there FLAG

	#define	RX_GETLENGTH	4		//length data position in RX buffer
	#define	SYN_BYTE		0x66

	//============== UART Memory Define ================================
	global_uart_dv unsigned char	R15xx_FLAG;
	global_uart_dv unsigned char	W15xx_FLAG;

	global_uart_dv xdata char	Rx_Buf[2][24];//	_at_ 0x0000;
	global_uart_dv xdata char	Tx_Buf[24]	 ;//	_at_ 0x0030;
	global_uart_dv xdata char	ReTx_Buf[24] ;//	_at_ 0x0050;

	global_uart_dv xdata char	UART_RxInUse ;//	_at_ 0x0070;
	global_uart_dv xdata char	Rx_Index	 ;//	_at_ 0x0072;
	global_uart_dv xdata char	Tx_Index	 ;//	_at_ 0x0074;
	global_uart_dv xdata char	Data_Length	 ;//	_at_ 0x0076;
	global_uart_dv xdata char	Parse_Length ;//	_at_ 0x0078;
	global_uart_dv xdata char	Tx_Length	 ;//	_at_ 0x007A;
	global_uart_dv xdata char	ReTx_Length	 ;//	_at_ 0x007C;

	global_uart_dv xdata char	*ExtMemPtr	 ;		//_at_ 0x0080;
	global_uart_dv xdata char	RW15xx_Addr;		//_at_ 0x0088;
	global_uart_dv xdata char	W15xx_Val;			//_at_ 0x008A;
	global_uart_dv xdata char	R15xx_Length;		//_at_ 0x008C;

	global_uart_dv xdata char	Tempbuf[64];		//_at_ 0x00A0;
	global_uart_dv xdata char	WR_TestByte[16];	//_at_ 0x00E0;
			
			//can not be initialized
											// data in progeam "main()"
	global_uart_dv char	UARTFlag;
	global_uart_dv char	UART_Count;

	//============== Struct of the UART pcak ==============================
 	struct	UART_PACK
	{
		unsigned char		syn1;
		unsigned char		cmd;
		unsigned char		length;
		unsigned char		reserve;
		int					addr;
		unsigned char		crc;
		unsigned char		syn2;
	};
	//*-------------------------------------------------------------------
	//*			Global Function
	//*-------------------------------------------------------------------
	global_uart_dv void	UART_RxByte(void);
	global_uart_dv void	UART_TxByte(void);
	global_uart_dv void	UART_ParseFun(void);
	global_uart_dv void	UART_SendOut(char * , char );
	global_uart_dv void	PrepareSendBuf(char * , int , char , char );

#endif	

⌨️ 快捷键说明

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