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

📄 itc.ls

📁 ST7LITE39 IIC功能应用实例,是一个完整的源程序
💻 LS
字号:
   1                     ; C Compiler for ST7 (COSMIC Software)
   2                     ; Generator V4.5.5 - 12 Jan 2006
 872                     ; 18 void ITC_Init(void)
 872                     ; 19 { 
 873                     	switch	.text
 874  0000               _ITC_Init:
 877                     ; 20     STORE_CONTENTS()
 880  0000 8a            PUSH CC
 882                     ; 21     DisableInterrupts   
 885  0001 9b            SIM
 887                     ; 23     EISR = REG_DEFAULT; 
 889  0002 3f3c          	clr	_EISR
 890                     ; 24   	EICR = REG_DEFAULT; 
 892  0004 3f37          	clr	_EICR
 893                     ; 26   	RESTORE_CONTENTS()
 896  0006 86            POP CC
 898                     ; 27 }
 901  0007 81            	ret
 924                     ; 37 void ITC_TRAP (void)
 924                     ; 38 {
 925                     	switch	.text
 926  0008               _ITC_TRAP:
 929                     ; 40    { _asm ("TRAP");}
 932  0008 83            TRAP
 934                     ; 41 }                                                                                   
 937  0009 81            	ret
1095                     ; 51 void ITC_ConfigureInterrupt (ITC_Port Portx,unsigned char Pin, 
1095                     ; 52                                                   ITC_Sensitivity Sensitivity)
1095                     ; 53 {                                    
1096                     	switch	.text
1098                     	xref.b	_ITC_ConfigureInterrupt$L
1099  000a               _ITC_ConfigureInterrupt:
1101  000a b701          	ld	_ITC_ConfigureInterrupt$L+1,a
1102  000c bf00          	ld	_ITC_ConfigureInterrupt$L,x
1104                     ; 54     STORE_CONTENTS()                       
1107  000e 8a            PUSH CC
1109                     ; 55     DisableInterrupts          
1112  000f 9b            SIM
1114                     ; 57     if (Sensitivity == IT_EDGE_R_1)
1116  0010 b602          	ld	a,_ITC_ConfigureInterrupt$L+2
1117  0012 a104          	cp	a,#4
1118  0014 2604          	jrne	L775
1119                     ; 59        Nop                                      /*选择错误的触发*/
1122  0016 9d            nop
1125  0017 cc00e9        	jp	L106
1126  001a               L775:
1127                     ; 63     if ((unsigned char)Portx & IT_PortA)
1129  001a b600          	ld	a,_ITC_ConfigureInterrupt$L
1130  001c a501          	bcp	a,#1
1131  001e 275b          	jreq	L306
1132                     ; 65         if ((Pin < 7) && (Pin != 0))
1134  0020 b601          	ld	a,_ITC_ConfigureInterrupt$L+1
1135  0022 a107          	cp	a,#7
1136  0024 2503          	jrult	L21
1137  0026 cc00e9        	jp	L106
1138  0029               L21:
1140  0029 3d01          	tnz	_ITC_ConfigureInterrupt$L+1
1141  002b 2603          	jrne	L41
1142  002d cc00e9        	jp	L106
1143  0030               L41:
1144                     ; 67 	        if (Sensitivity == IT_EDGE_R_1)
1146  0030 b602          	ld	a,_ITC_ConfigureInterrupt$L+2
1147  0032 a104          	cp	a,#4
1148  0034 2604          	jrne	L706
1149                     ; 69                 Nop                             /*选择错误的触发*/
1152  0036 9d            nop
1155  0037 cc00e9        	jp	L106
1156  003a               L706:
1157                     ; 73         	    if (Pin >= 3)
1159  003a b601          	ld	a,_ITC_ConfigureInterrupt$L+1
1160  003c a103          	cp	a,#3
1161  003e 2521          	jrult	L316
1162                     ; 75                     EICR &= EIREG_MASKEI1;
1164  0040 b637          	ld	a,_EICR
1165  0042 a4f3          	and	a,#243
1166  0044 b737          	ld	_EICR,a
1167                     ; 76                     EICR |= (unsigned char)EICR_SET((unsigned char)Sensitivity,2);
1169  0046 b602          	ld	a,_ITC_ConfigureInterrupt$L+2
1170  0048 48            	sll	a
1171  0049 48            	sll	a
1172  004a ba37          	or	a,_EICR
1173  004c b737          	ld	_EICR,a
1174                     ; 77                     EISR &= EIREG_MASKEI1;
1176  004e b63c          	ld	a,_EISR
1177  0050 a4f3          	and	a,#243
1178  0052 b73c          	ld	_EISR,a
1179                     ; 78                     EISR |= (unsigned char)EISR_SET((unsigned char)(Pin-3),2);
1181  0054 b601          	ld	a,_ITC_ConfigureInterrupt$L+1
1182  0056 a003          	sub	a,#3
1183  0058 48            	sll	a
1184  0059 48            	sll	a
1185  005a ba3c          	or	a,_EISR
1186  005c b73c          	ld	_EISR,a
1188  005e cc00e9        	jp	L106
1189  0061               L316:
1190                     ; 82                     EICR &= EIREG_MASKEI0;
1192  0061 b637          	ld	a,_EICR
1193  0063 a4fc          	and	a,#252
1194  0065 b737          	ld	_EICR,a
1195                     ; 83                     EICR |= (unsigned char)EICR_SET((unsigned char)Sensitivity,0);
1197  0067 b637          	ld	a,_EICR
1198  0069 ba02          	or	a,_ITC_ConfigureInterrupt$L+2
1199  006b b737          	ld	_EICR,a
1200                     ; 84                     EISR &= EIREG_MASKEI0;
1202  006d b63c          	ld	a,_EISR
1203  006f a4fc          	and	a,#252
1204  0071 b73c          	ld	_EISR,a
1205                     ; 85                     EISR |= (unsigned char)EISR_SET(Pin,0);
1207  0073 b63c          	ld	a,_EISR
1208  0075 ba01          	or	a,_ITC_ConfigureInterrupt$L+1
1209  0077 b73c          	ld	_EISR,a
1210  0079 206e          	jra	L106
1211  007b               L306:
1212                     ; 90     else if ((unsigned char)Portx & IT_PortB)
1214  007b b600          	ld	a,_ITC_ConfigureInterrupt$L
1215  007d a502          	bcp	a,#2
1216  007f 2768          	jreq	L106
1217                     ; 92         if ((Pin <= 6)  && (Pin != 4))
1219  0081 b601          	ld	a,_ITC_ConfigureInterrupt$L+1
1220  0083 a107          	cp	a,#7
1221  0085 2462          	jruge	L106
1223  0087 b601          	ld	a,_ITC_ConfigureInterrupt$L+1
1224  0089 a104          	cp	a,#4
1225  008b 275c          	jreq	L106
1226                     ; 94        	    if (Sensitivity == IT_EDGE_R_1)
1228  008d b602          	ld	a,_ITC_ConfigureInterrupt$L+2
1229  008f a104          	cp	a,#4
1230  0091 2603          	jrne	L526
1231                     ; 96               Nop                               /* 选择错误的触发 */
1234  0093 9d            nop
1237  0094 2053          	jra	L106
1238  0096               L526:
1239                     ; 100                 if (Pin >=3)
1241  0096 b601          	ld	a,_ITC_ConfigureInterrupt$L+1
1242  0098 a103          	cp	a,#3
1243  009a 252c          	jrult	L136
1244                     ; 102                     EICR &= EIREG_MASKEI2;
1246  009c b637          	ld	a,_EICR
1247  009e a4cf          	and	a,#207
1248  00a0 b737          	ld	_EICR,a
1249                     ; 103                     EICR |= (unsigned char)EICR_SET((unsigned char)Sensitivity,4);
1251  00a2 b602          	ld	a,_ITC_ConfigureInterrupt$L+2
1252  00a4 ae10          	ld	x,#16
1253  00a6 42            	mul	x,a
1254  00a7 ba37          	or	a,_EICR
1255  00a9 b737          	ld	_EICR,a
1256                     ; 104                     EISR &= EIREG_MASKEI2;
1258  00ab b63c          	ld	a,_EISR
1259  00ad a4cf          	and	a,#207
1260  00af b73c          	ld	_EISR,a
1261                     ; 105                     if(Pin==3)
1263  00b1 b601          	ld	a,_ITC_ConfigureInterrupt$L+1
1264  00b3 a103          	cp	a,#3
1265  00b5 2604          	jrne	L336
1266                     ; 107                         EISR |= (unsigned char)EISR_SET(1,4);
1268  00b7 183c          	bset	_EISR,#4
1270  00b9 202e          	jra	L106
1271  00bb               L336:
1272                     ; 111                         EISR |=(unsigned char) EISR_SET((unsigned char)(Pin-3),4);
1274  00bb b601          	ld	a,_ITC_ConfigureInterrupt$L+1
1275  00bd a003          	sub	a,#3
1276  00bf ae10          	ld	x,#16
1277  00c1 42            	mul	x,a
1278  00c2 ba3c          	or	a,_EISR
1279  00c4 b73c          	ld	_EISR,a
1280  00c6 2021          	jra	L106
1281  00c8               L136:
1282                     ; 116                     EICR &= EIREG_MASKEI3;
1284  00c8 b637          	ld	a,_EICR
1285  00ca a43f          	and	a,#63
1286  00cc b737          	ld	_EICR,a
1287                     ; 117                     EICR |= (unsigned char)EICR_SET((unsigned char)Sensitivity,6);
1289  00ce b602          	ld	a,_ITC_ConfigureInterrupt$L+2
1290  00d0 ae40          	ld	x,#64
1291  00d2 42            	mul	x,a
1292  00d3 ba37          	or	a,_EICR
1293  00d5 b737          	ld	_EICR,a
1294                     ; 118                     EISR &= EIREG_MASKEI3;
1296  00d7 b63c          	ld	a,_EISR
1297  00d9 a43f          	and	a,#63
1298  00db b73c          	ld	_EISR,a
1299                     ; 119                     EISR |= (unsigned char)EISR_SET(Pin+1,6);
1301  00dd b601          	ld	a,_ITC_ConfigureInterrupt$L+1
1302  00df 4c            	inc	a
1303  00e0 4e            	swap	a
1304  00e1 48            	sll	a
1305  00e2 48            	sll	a
1306  00e3 a4c0          	and	a,#192
1307  00e5 ba3c          	or	a,_EISR
1308  00e7 b73c          	ld	_EISR,a
1309  00e9               L106:
1310                     ; 126     RESTORE_CONTENTS()                  
1313  00e9 86            POP CC
1315                     ; 127 }                             
1318  00ea 81            	ret
1385                     	switch	.ubsct
1386  0000               _switch_return:
1387  0000 00            	ds.b	1
1388                     	xdef	_switch_return
1389  0001               _temp:
1390  0001 00            	ds.b	1
1391                     	xdef	_temp
1392                     	xdef	_ITC_ConfigureInterrupt
1393                     	xdef	_ITC_TRAP
1394                     	xdef	_ITC_Init
1414                     	end

⌨️ 快捷键说明

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