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

📄 linkport.h

📁 TI DSP C6713 同相同公司C2812利用MSBSP多功能串口通讯的实例
💻 H
字号:
#ifndef __LINKPORT
#define __LINKPORT

/*----------------------------------------------------------------------------*/
/* INCLUDES                                                                   */
/*----------------------------------------------------------------------------*/
#include <regs.h>

#define MASTER	0
#define	SLAVE	1

#define THIS	MASTER

//define the useful test address
#define EMIFA_GCR		0x1800000	/* Address of EMIFA global control */
#define EMIFA_CE1		0x1800004	/* Address of EMIFA CE1 control	*/


#define EMIFA_GCR_PARAMETER		0x0001403C	/* parameter of EMIFA global control */

#define EMIFA_CE1_64			0x1191C6C1 	//151	//0x10D1C3C1   	131
#define EMIFA_CE1_32			0x1191C621 	//151	//0x10D1C321	131

#define CE1_FIFO_ADD			0x90000000


#define EXT_BETWEEN_BOARD_INT	5
#if THIS == MASTER
#define	EXT_NUC_INT				6
#define CE1_PARAMETER_ADD		0x90020000
//add at 04/12/2004  SHIYAN
#define CE1_DISPLAY_PARAMETER_ADD	0x90080000	//LSB16bit: min of the image, MSB16bit: max of the image.
//end add
#endif

#if THIS == SLAVE
#define	EXT_WITHIN_BOARD_INT	6
#define CE1_DSP_ADD				0x90020000
//add at 04/04/2004  SHIYAN
#define ARBITRATOR_OF_SLAVES			0x90080000	// only LSB 2 bit work
#define SHARE_REG_BETWEEN_SLAVES		0x900A0000	//LSB 32 BIT work
//end add
#endif



#if THIS == MASTER
#define CE1_COMMAND_ADD_32		0x90030000
#endif

#define CE1_REG_ADD				0x90040000
#define CE1_COMMAND_ADD			0x90060000


#define CLEAR_BIT				0
#define	SEND_LVDS				1
#define	REC_LVDS				3

#define	REC_TIMEOUT_FLAG			5
#define	REC_ERROR_FLAG				6
#define REC_DATA_BETWEEN_BOARD_FLAG		7

#if  THIS	==	SLAVE
#define REC_DATA_WITHIN_BOARD_FLAG		8
//add at 04/04/2004  SHIYAN
#define CLEAR_ALL_FLAG				9	//set 1, then only clear the flg, not clear the FIFO, and it auto return to 0
#define FIFO_BETWEEN_BOARD_BUSY_FLAG		10	// 1 means busy
#define FIFO_WITHIN_BOARD_BUSY_FLAG		11	// 1 means busy
//end add
#endif

#if  THIS	==	MASTER
#define	SEND_TO_IRAM				2
#define	REC_AND_SEND_TO_IRAM			4
#define NUC_EN					8
//add at 04/12/2004  SHIYAN
#define SEND_INT_TO_803				9
#define CLEAR_ALL_FLAG				10
#define FIFO_BETWEEN_BOARD_BUSY_FLAG		11	// 1 means busy
#define IS_AUTO_GREY_NORMALIZE			12	// 1 auto 
//end add
#endif

#define  RESET_LINKPORT()			REG_WRITE(CE1_COMMAND_ADD, 0x1)
#define  CLEAR_LINKPORT()			SET_BIT(CE1_COMMAND_ADD, CLEAR_BIT)

#define  LED_ON(i)					REG_WRITE(CE1_REG_ADD, i)
#define  SET_EMIFA_G()				REG_WRITE(EMIFA_GCR, EMIFA_GCR_PARAMETER)

#define  SET_EMIFA_CE1_64()			REG_WRITE(EMIFA_CE1, EMIFA_CE1_64)

#if  THIS	==	MASTER
#define  SET_EMIFA_CE1_32()			REG_WRITE(EMIFA_CE1, EMIFA_CE1_32)
#define  PRODUCE_INT()				SET_BIT(CE1_COMMAND_ADD, SEND_INT_TO_803)
//add at 04/17/2004  SHIYAN
#define DEFAULT_DISPLAY_MAXMIN_VAL	((255)<< 16)
#define  SET_DISPLAY_MAXMIN(val)	REG_WRITE(CE1_DISPLAY_PARAMETER_ADD, val)
#define  SET_DEF_DISPLAY_MAXMIN()	REG_WRITE(CE1_DISPLAY_PARAMETER_ADD, DEFAULT_DISPLAY_MAXMIN_VAL)
//end add
#endif

#define  	IS_REC_ERR()			GET_BIT(CE1_COMMAND_ADD, REC_ERROR_FLAG)
#define		IS_REC_TIMEOUT()		GET_BIT(CE1_COMMAND_ADD, REC_TIMEOUT_FLAG) 

#define		REC_LVDS_DISABLE()		RESET_BIT(CE1_COMMAND_ADD, REC_LVDS)
#define		REC_LVDS_ENABLE()		SET_BIT(CE1_COMMAND_ADD, REC_LVDS)

#define		SEND_LVDS_DISABLE()		RESET_BIT(CE1_COMMAND_ADD, SEND_LVDS)
#define		SEND_LVDS_ENABLE()		SET_BIT(CE1_COMMAND_ADD, SEND_LVDS)

//#define 	SEND_LVDS_DISABLE_32()	RESET_BIT(CE1_COMMAND_ADD_32, SEND_LVDS)	

#if  THIS	==	MASTER
#define 	SEND_IRAM_ENABLE_32()	SET_BIT(CE1_COMMAND_ADD_32, SEND_TO_IRAM)
#define 	SEND_IRAM_ENABLE_64()	SET_BIT(CE1_COMMAND_ADD, SEND_TO_IRAM)
#define		SEND_IRAM_DISABLE_32()	RESET_BIT(CE1_COMMAND_ADD_32, SEND_TO_IRAM)
#define		SEND_IRAM_DISABLE_64()	RESET_BIT(CE1_COMMAND_ADD, SEND_TO_IRAM)
#endif

#define    GET_COM_VALUE()			REG_READ(CE1_COMMAND_ADD)

#if  THIS	==	MASTER
#define  ENABLE_NUC()			SET_BIT(CE1_COMMAND_ADD, NUC_EN)
#define  DISABLE_NUC()			RESET_BIT(CE1_COMMAND_ADD, NUC_EN)
/*
typedef struct 
{ 	unsigned int 	k1;
	unsigned short 	k2;
	unsigned short 	k3;
} NUC_PARAMETER_S;
*/
#endif

#endif

⌨️ 快捷键说明

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