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

📄 hardware.lst

📁 2005年电子设计竞赛悬挂运动控制系统源码
💻 LST
📖 第 1 页 / 共 4 页
字号:
                            	.DEFINE C_D2_LatchA				0x0020 			// 
                            	.DEFINE C_D2_LatchB				0x0040 			//
                            	.DEFINE C_D2_LatchAB			0x00C0 			//
                            	
                            	//... Define for P_LVD_Ctrl ...................
                            	.DEFINE C_LVD24V				0x0000 			// LVD = 2.4V 
                            	.DEFINE C_LVD28V				0x0001 			// LVD = 2.8V
                            	.DEFINE C_LVD32V				0x0002 			// LVD = 3.2V
                            	.DEFINE C_LVD36V				0x0003 			// LVD = 3.6V
                            	
                            	
                            	
                            	/////////////////////////////////////////////////////////////////
                            	// Note: This register map to the P_INT_Ctrl(0x7010)
                            	// 	User's interrupt setting have to combine with this register 
                            	//	while co-work with SACM library.
                            	//
                            	//  See. following function for example:
                            	//	F_SP_SACM_A2000_Init_:
                            	//	F_SP_SACM_S480_Init_:
                            	//	F_SP_SACM_S240_Init_:
                            	//	F_SP_SACM_MS01_Init_:
                            	//	F_SP_SACM_DVR_Init_: 
                            	//////////////////////////////////////////////////
00000005                    	.IRAM
00000005 00 00              	.VAR	R_InterruptStatus = 0 					// 
                            	
                            	
                            	//////////////////////////////////////////////////
                            	
                            	.define C_RampDelayTime 16
                            	
                            	.define C_QueueSize 100		
                            			
00000006 00 00              	.VAR 	R_Queue 
00000007 00 00 00 00        	.DW		C_QueueSize-1	DUP(0) 
         00 00 00 00
         00 00 00 00
         00 00 00 00
         00 00 00 00
         00 00 00 00
         00 00 00 00
         00 00 00 00
         00 00 00 00
         00 00 00 00
         00 00 00 00
         00 00 00 00
         00 00 00 00
         00 00 00 00
         00 00 00 00
         00 00 00 00
         00 00 00 00
         00 00 00 00
         00 00 00 00
         00 00 00 00
         00 00 00 00
         00 00 00 00
         00 00 00 00
         00 00 00 00
         00 00 00 00
         00 00 00 00
         00 00 00 00
         00 00 00 00
         00 00 00 00
         00 00 00 00
         00 00 00 00
         00 00 00 00
         00 00 00 00
         00 00 00 00
         00 00 00 00
         00 00 00 00
         00 00 00 00
         00 00 00 00
         00 00 00 00
         00 00 00 00
         00 00 00 00
         00 00 00 00
         00 00 00 00
         00 00 00 00
         00 00 00 00
         00 00 00 00
         00 00 00 00
         00 00 00 00
         00 00 00 00
         00 00      
0000006A 00 00              	.VAR	R_ReadIndex 
0000006B 00 00              	.VAR	R_WriteIndex 
                            	
0000BDF2                    	.CODE
                            	
                            					
                            	
                            	///////////////////////////////////////////
                            	// Function: Initial Queue
                            	// Destory: R1,R2
                            	///////////////////////////////////////////	
                            	_SP_InitQueue:	.PROC
                            	_SP_InitQueue_A2000:
                            	_SP_InitQueue_S480:
                            	_SP_InitQueue_S240:
                            	_SP_InitQueue_MS01:
                            	_SP_InitQueue_DVR:
                            	
                            	F_SP_InitQueue_A2000:
                            	F_SP_InitQueue_S480:
                            	F_SP_InitQueue_S240:
                            	F_SP_InitQueue_MS01:
                            	F_SP_InitQueue_DVR:
                            	F_SP_InitQueue:
0000BDF2 09 93 06 00        			R1 = R_Queue
0000BDF4 40 94              			R2 = 0 
                            	L_ClearQueueLoop?:		
0000BDF5 D1 D4              			[R1++] = R2
0000BDF6 09 43 6A 00        			cmp	R1, R_Queue+C_QueueSize
0000BDF8 44 4E              			jne	L_ClearQueueLoop?
                            				
0000BDF9 40 92              			R1 = 0
0000BDFA 19 D3 6A 00        			[R_ReadIndex] = R1
0000BDFC 19 D3 6B 00        			[R_WriteIndex] = R1
                            					
0000BDFE 90 9A              			RETF
                            			.ENDP
                            			
                            	///////////////////////////////////////////
                            	// Function: Get a data form Queue
                            	// Output:  R1: Data
                            	//			R2: return value
                            	// Destory: R1,R2
                            	///////////////////////////////////////////	
                            	F_SP_ReadQueue_A2000:
                            	F_SP_ReadQueue_S480:
                            	F_SP_ReadQueue_S240:
                            	F_SP_ReadQueue_MS01:
                            	F_SP_ReadQueue_DVR:
                            	F_SP_ReadQueue:
0000BDFF 12 95 6A 00        			R2 = [R_ReadIndex]
0000BE01 12 45 6B 00        			cmp R2,[R_WriteIndex]
0000BE03 0D 5E              			je	L_RQ_QueueEmpty
                            	
0000BE04 0A 05 06 00        			R2 += R_Queue				// get queue data address
0000BE06 C2 92              			R1 = [R2]
                            			
0000BE07 12 95 6A 00        			R2 = [R_ReadIndex]
0000BE09 41 04              			R2 += 1
0000BE0A 0A 45 64 00        			cmp	R2, C_QueueSize
0000BE0C 01 4E              			jne	L_RQ_NotQueueBottom
0000BE0D 40 94              			R2 = 0
                            	L_RQ_NotQueueBottom:	
0000BE0E 1A D5 6A 00        			[R_ReadIndex] = R2		
                            			//r2 = 0x0000 						// get queue data
0000BE10 90 9A              			retf 
                            	L_RQ_QueueEmpty:
                            			//r2 = 0x8000 						// queue empty
0000BE11 90 9A              			retf 
                            	
                            	///////////////////////////////////////////
                            	// Function: Get a data from Queue but do 
                            	//			not change queue index
                            	// R1: output
                            	// Destory: R1,R2
                            	///////////////////////////////////////////
                            	F_SP_ReadQueue_NIC:
                            	F_SP_ReadQueue_NIC_A2000:
                            	F_SP_ReadQueue_NIC_S480:
                            	F_SP_ReadQueue_NIC_S240:
                            	F_SP_ReadQueue_NIC_MS01:
                            	F_SP_ReadQueue_NIC_DVR:
0000BE12 12 95 6A 00        			R2 = [R_ReadIndex]
0000BE14 12 45 6B 00        			cmp R2,[R_WriteIndex]
0000BE16 03 5E              			je	L_RQ_QueueEmpty?
                            	
0000BE17 0A 05 06 00        			R2 += R_Queue				// get queue data index
0000BE19 C2 92              			R1 = [R2]
                            	L_RQ_QueueEmpty?:
0000BE1A 90 9A              			RETF
                            			
                            	///////////////////////////////////////////
                            	// Function: Put a data to Queue
                            	// R1: Input
                            	// Destory: R1,R2
                            	///////////////////////////////////////////	
                            	F_SP_WriteQueue_A2000:
                            	F_SP_WriteQueue_S480:
                            	F_SP_WriteQueue_S240:
                            	F_SP_WriteQueue_MS01:
                            	F_SP_WriteQueue_DVR:
                            	F_SP_WriteQueue:
0000BE1B 12 95 6B 00        			R2 = [R_WriteIndex] 			// put data to queue
0000BE1D 0A 05 06 00        			R2 += R_Queue
0000BE1F C2 D2              			[R2] = R1
                            	
0000BE20 12 95 6B 00        			R2 = [R_WriteIndex]
0000BE22 41 04              			R2 += 1
0000BE23 0A 45 64 00        			cmp	R2, C_QueueSize
0000BE25 01 4E              			jne	L_WQ_NotQueueBottom
0000BE26 40 94              			R2 = 0
                            	L_WQ_NotQueueBottom:
0000BE27 1A D5 6B 00        			[R_WriteIndex] = R2
0000BE29 90 9A              			RETF
                            	
                            			
                            	///////////////////////////////////////////
                            	// Function: Test Queue Status
                            	// o/p: R1
                            	// Destory: R1
                            	///////////////////////////////////////////	
                            	F_SP_TestQueue_A2000:
                            	F_SP_TestQueue_S480:
                            	F_SP_TestQueue_S240:
                            	F_SP_TestQueue_MS01:
                            	F_SP_TestQueue_DVR:
                            	F_SP_TestQueue:
                            			//... Test Queue Empty ...
0000BE2A 11 93 6A 00        			R1 = [R_ReadIndex] 
0000BE2C 11 43 6B 00        			cmp R1,[R_WriteIndex] 
0000BE2E 12 5E              			je	L_TQ_QueueEmpty 
                            	
                            			//... Test Queue Full ...
0000BE2F 11 93 6A 00        			R1 = [R_ReadIndex] 				// For N Queue Full: 1.R=0 and W=N-1 2. R<>0 and W=R-1 
0000BE31 05 4E              			jnz	L_TQ_JudgeCond2 
0000BE32 11 93 6B 00        			R1 = [R_WriteIndex] 
0000BE34 09 43 63 00        			cmp	R1, C_QueueSize-1 			// Cond1
0000BE36 08 5E              			je	L_TQ_QueueFull 			
                            	L_TQ_JudgeCond2:		
0000BE37 11 93 6A 00        			R1 = [R_ReadIndex] 
0000BE39 41 22              			R1 -=1 
0000BE3A 11 43 6B 00        			cmp R1,[R_WriteIndex] 
0000BE3C 02 5E              			je	L_TQ_QueueFull 	
                            	
0000BE3D 40 92              			r1 = 0 							// not Full, not empty
0000BE3E 90 9A              			retf 
                            	L_TQ_QueueFull:
0000BE3F 41 92              			r1 = 1 							// full
0000BE40 90 9A              			retf 
                            	L_TQ_QueueEmpty:
0000BE41 42 92              			r1 = 2 							// empty
0000BE42 90 9A              			retf 
                            	
                            	
                            	
                            	
                            	
                            	///////////////////////////////////////////////////////////////////////////////
                            	// Function: The partial code of hardware setting of SACM_A2000_Initial() 
                            	//			or F_SACM_A2000_Initial:
                            	// Note: The following functions are the partial code of original
                            	//			initial subroutine. (H/W setting part) 

⌨️ 快捷键说明

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