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

📄 ls7266.h

📁 用TMS320LF2407A开发电机控制的源代码
💻 H
字号:
/************************************************************************
Project name: 	motorTest.pjt
File name: 		ls7266.h
Author: 		胡天亮, 山东大学数控技术研究中心
				Hu Tianliang, CNC Research Center, Shandong University
Description:	LS7266 register and its data definition
History:		(1) Aug. 25th, 2005, original
				Address according to FOURAXES PCB Board
*************************************************************************/
#ifndef lf7266_h
#define lf7266_h

//addresses 
//#define LS7266_CMD		(volatile unsigned int *)0x8E00 //cmd register of ls7266
//#define LS7266_DAT		(volatile unsigned int *)0x8E00 //data register of ls7266

#define LS7266_CMD 	portE000 	//cmd register of ls7266
ioport unsigned int portE000;   // C2xx compiler specific keyword 

#define LS7266_DAT 	portE000 	//data register of ls7266
ioport unsigned int portE000;   // C2xx compiler specific keyword 

#define LS7266_CTR 	port2000 	//control signal of ls7266
ioport unsigned int port2000;   // C2xx compiler specific keyword 
		
//RLD Reg
#define LS7266_RLD(arg)			((arg)|0x80)
#define LS7266_XRLD(arg)		((arg)|0x00)
#define LS7266_YRLD(arg)		XRLD(arg)

#define LS7266_RstBP			0x01

#define LS7266_RstCNTR			0x02
#define LS7266_RstFLAGS 		0x04
#define LS7266_RstE				0x06

#define LS7266_Trsf_PR_CNTR 	0x08
#define LS7266_Trsf_CNTR_OL 	0x10
#define LS7266_Trsf_PR0_PSC 	0x18

//CMR Reg
#define LS7266_CMR(arg) 		((arg)|0xA0)
#define LS7266_XCMR(arg) 		((arg)|0x20)
#define LS7266_YCMR(arg) 		XCMR(arg)

#define LS7266_BINCnt			0x00
#define LS7266_BCDCnt 			0x01

#define LS7266_NormalCnt		0x00
#define LS7266_RngLmt			0x02
#define LS7266_NonRecycle	    0x04
#define LS7266_ModN				0x06

#define LS7266_NonQUAR			0x00
#define LS7266_QUARX1			0x08
#define LS7266_QUARX2			0x10
#define LS7266_QUARX4			0x18

//IOR Reg
#define LS7266_IOR(arg) 		((arg)|0xC0)
#define LS7266_XIOR(arg) 		((arg)|0x40)
#define LS7266_YIOR(arg)		XIOR(arg)

#define LS7266_DisAB			0x00
#define LS7266_EnAB				0x01

#define LS7266_SelLCNTR			0x00
#define LS7266_SelLOL			0x02

#define LS7266_SelRCNTR			0x00
#define LS7266_SelABGATE		0x04

#define LS7266_SelCyBw			0x00
#define LS7266_SelCmpBw			0x08
#define LS7266_SelCB_UPDN		0x10
#define LS7266_SelIdxErr		0x18

//IDR Reg
#define LS7266_IDR(arg) 		((arg)|0xE0)
#define LS7266_XIDR(arg)		((arg)|0x60)
#define LS7266_YIDR(arg)		XIDR(arg)
#define LS7266_DisIDX			0x00
#define LS7266_EnIDX			0x01

#define LS7266_NegIDX			0x00
#define LS7266_PosIDX			0x02

#define LS7266_LCNTR_LOL_IDX	0x00
#define LS7266_RCNTR_ABG_IDX	0x04

//constant
#define LS7266_FCK_DIV			0x00

#endif

⌨️ 快捷键说明

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