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

📄 stm8_tsl_rc_acquisition.ls

📁 STM8s
💻 LS
📖 第 1 页 / 共 2 页
字号:
 759  00ec e402          	and	a,(2,x)
 760  00ee e702          	ld	(2,x),a
 761                     ; 685         TSL_IO_SW_Burst_TestSyncShift();
 763  00f0 cd0000        	call	_TSL_IO_SW_Burst_TestSyncShift
 765                     ; 686         TSL_IO_SW_Burst_Wait_Vih();
 767  00f3 cd0019        	call	_TSL_IO_SW_Burst_Wait_Vih
 769                     ; 687         TSL_IO_SW_Burst_Stop_Timer();
 771  00f6 cd0061        	call	_TSL_IO_SW_Burst_Stop_Timer
 773                     ; 689         Measurement = CounterStop;
 775  00f9 be02          	ldw	x,_CounterStop
 776  00fb 1f0e          	ldw	(OFST-1,sp),x
 777                     ; 692         sTouchIO.PORT_ADDR->ODR |= sTouchIO.DriveMask;
 779  00fd 92c608        	ld	a,[_sTouchIO.w]
 780  0100 ba0b          	or	a,_sTouchIO+3
 781  0102 92c708        	ld	[_sTouchIO.w],a
 782                     ; 693         sTouchIO.PORT_ADDR->DDR |= sTouchIO.DriveMask;
 784  0105 be08          	ldw	x,_sTouchIO
 785  0107 e602          	ld	a,(2,x)
 786  0109 ba0b          	or	a,_sTouchIO+3
 787  010b e702          	ld	(2,x),a
 788                     ; 694         sTouchIO.PORT_ADDR->CR1 |= sTouchIO.DriveMask;
 790  010d be08          	ldw	x,_sTouchIO
 791  010f e603          	ld	a,(3,x)
 792  0111 ba0b          	or	a,_sTouchIO+3
 793  0113 e703          	ld	(3,x),a
 794                     ; 695         ((GPIO_TypeDef *)(LOADREF_PORT_ADDR))->ODR &= (u8)(~LOADREF_BIT);
 796  0115 721d5000      	bres	20480,#6
 797                     ; 696         enableInterrupts();
 800  0119 9a            rim
 802                     ; 701         if (IT_Sync_Flags.one_charge_sync_enable)
 805  011a b600          	ld	a,_IT_Sync_Flags
 806  011c a504          	bcp	a,#4
 807  011e 270a          	jreq	L362
 808                     ; 703           IT_Sync_Flags.start = 0;
 810  0120 72170000      	bres	_IT_Sync_Flags,#3
 812  0124               L172:
 813                     ; 704           while (IT_Sync_Flags.start == 0);
 815  0124 b600          	ld	a,_IT_Sync_Flags
 816  0126 a508          	bcp	a,#8
 817  0128 27fa          	jreq	L172
 818  012a               L362:
 819                     ; 712         disableInterrupts();
 822  012a 9b            sim
 824                     ; 713         TSL_IO_SW_Burst_Start_Timer();
 827  012b cd005c        	call	_TSL_IO_SW_Burst_Start_Timer
 829                     ; 714         sTouchIO.PORT_ADDR->CR1 &= (u8)(~sTouchIO.DriveMask);
 831  012e be08          	ldw	x,_sTouchIO
 832  0130 b60b          	ld	a,_sTouchIO+3
 833  0132 43            	cpl	a
 834  0133 e403          	and	a,(3,x)
 835  0135 e703          	ld	(3,x),a
 836                     ; 715         sTouchIO.PORT_ADDR->DDR &= (u8)(~sTouchIO.DriveMask);
 838  0137 be08          	ldw	x,_sTouchIO
 839  0139 b60b          	ld	a,_sTouchIO+3
 840  013b 43            	cpl	a
 841  013c e402          	and	a,(2,x)
 842  013e e702          	ld	(2,x),a
 843                     ; 716         TSL_IO_SW_Burst_TestSyncShift();
 845  0140 cd0000        	call	_TSL_IO_SW_Burst_TestSyncShift
 847                     ; 717         TSL_IO_SW_Burst_Wait_Vil();
 849  0143 cd0006        	call	_TSL_IO_SW_Burst_Wait_Vil
 851                     ; 718         TSL_IO_SW_Burst_Stop_Timer();
 853  0146 cd0061        	call	_TSL_IO_SW_Burst_Stop_Timer
 855                     ; 720         Measurement += CounterStop;
 857  0149 1e0e          	ldw	x,(OFST-1,sp)
 858  014b 72bb0002      	addw	x,_CounterStop
 859  014f 1f0e          	ldw	(OFST-1,sp),x
 860                     ; 722         CumulatedMeasurement += Measurement;
 862  0151 1e06          	ldw	x,(OFST-9,sp)
 863  0153 72fb0e        	addw	x,(OFST-1,sp)
 864  0156 1f06          	ldw	(OFST-9,sp),x
 865                     ; 725         if (SamplingShifter == SAMPLING_SHIFTER_LOOP_START)
 867  0158 b601          	ld	a,_SamplingShifter
 868  015a a101          	cp	a,#1
 869  015c 262e          	jrne	L572
 870                     ; 727           tmpval = (u32)((u32)Measurement * MAX_MEAS_COEFF);
 872  015e 1e0e          	ldw	x,(OFST-1,sp)
 873  0160 90ae0fff      	ldw	y,#4095
 874  0164 cd0000        	call	c_umul
 876  0167 96            	ldw	x,sp
 877  0168 1c000a        	addw	x,#OFST-5
 878  016b cd0000        	call	c_rtol
 880                     ; 728           MaxMeasurement = (u16)((u16)(tmpval >> 8) + NB_CYCLES_VIHVIL_LOOP);
 882  016e 1e0b          	ldw	x,(OFST-4,sp)
 883  0170 1c0008        	addw	x,#8
 884  0173 1f02          	ldw	(OFST-13,sp),x
 885                     ; 729           tmpval = (u32)((u32)Measurement * MIN_MEAS_COEFF);
 887  0175 1e0e          	ldw	x,(OFST-1,sp)
 888  0177 a6e6          	ld	a,#230
 889  0179 cd0000        	call	c_cmulx
 891  017c 96            	ldw	x,sp
 892  017d 1c000a        	addw	x,#OFST-5
 893  0180 cd0000        	call	c_rtol
 895                     ; 730           MinMeasurement = (u16)((u16)(tmpval >> 8) - NB_CYCLES_VIHVIL_LOOP);
 897  0183 1e0b          	ldw	x,(OFST-4,sp)
 898  0185 1d0008        	subw	x,#8
 899  0188 1f04          	ldw	(OFST-11,sp),x
 901  018a 201d          	jra	L772
 902  018c               L572:
 903                     ; 734           if ((Measurement < MinMeasurement) || (Measurement > MaxMeasurement))
 905  018c 1e0e          	ldw	x,(OFST-1,sp)
 906  018e 1304          	cpw	x,(OFST-11,sp)
 907  0190 2506          	jrult	L303
 909  0192 1e0e          	ldw	x,(OFST-1,sp)
 910  0194 1302          	cpw	x,(OFST-13,sp)
 911  0196 2311          	jrule	L772
 912  0198               L303:
 913                     ; 736             MeasRejected++;
 915  0198 0c09          	inc	(OFST-6,sp)
 916                     ; 737             RejectionCounter++;
 918  019a 0c08          	inc	(OFST-7,sp)
 919                     ; 738             break; // Out from 'for SamplingShifter' loop !!!
 920  019c               L732:
 921                     ; 745     while (MeasRejected && (RejectionCounter <= MAX_REJECTED_MEASUREMENTS));
 923  019c 0d09          	tnz	(OFST-6,sp)
 924  019e 2716          	jreq	L503
 926  01a0 0d08          	tnz	(OFST-7,sp)
 927  01a2 2603          	jrne	L42
 928  01a4 cc00aa        	jp	L532
 929  01a7               L42:
 930  01a7 200d          	jra	L503
 931  01a9               L772:
 932                     ; 657            SamplingShifter < (SAMPLING_SHIFTER_NB_LOOPS + SAMPLING_SHIFTER_LOOP_START);
 932                     ; 658            SamplingShifter++)
 934  01a9 3c01          	inc	_SamplingShifter
 935                     ; 656       for (SamplingShifter = SAMPLING_SHIFTER_LOOP_START;
 935                     ; 657            SamplingShifter < (SAMPLING_SHIFTER_NB_LOOPS + SAMPLING_SHIFTER_LOOP_START);
 937  01ab b601          	ld	a,_SamplingShifter
 938  01ad a109          	cp	a,#9
 939  01af 2403          	jruge	L62
 940  01b1 cc00b3        	jp	L342
 941  01b4               L62:
 942  01b4 20e6          	jra	L732
 943  01b6               L503:
 944                     ; 747     if (MeasRejected == 0)
 946  01b6 0d09          	tnz	(OFST-6,sp)
 947  01b8 2616          	jrne	L122
 948                     ; 749       FinalMeasurementValue += CumulatedMeasurement;
 950  01ba 1e06          	ldw	x,(OFST-9,sp)
 951  01bc cd0000        	call	c_uitolx
 953  01bf ae0004        	ldw	x,#_FinalMeasurementValue
 954  01c2 cd0000        	call	c_lgadd
 957                     ; 638   for (AcqLoopIndex = 0; AcqLoopIndex < AcqNumber; AcqLoopIndex++)
 959  01c5 0c01          	inc	(OFST-14,sp)
 960  01c7               L712:
 963  01c7 7b01          	ld	a,(OFST-14,sp)
 964  01c9 1110          	cp	a,(OFST+1,sp)
 965  01cb 2403          	jruge	L03
 966  01cd cc009a        	jp	L312
 967  01d0               L03:
 968  01d0               L122:
 969                     ; 758   TSL_IO_Clamp(); // To avoid consumption
 971  01d0 cd004b        	call	_TSL_IO_Clamp
 973                     ; 759   enableInterrupts();
 976  01d3 9a            rim
 978                     ; 761   *sTouchIO.RejectedNb = RejectionCounter;
 981  01d4 7b08          	ld	a,(OFST-7,sp)
 982  01d6 92c70e        	ld	[_sTouchIO+6.w],a
 983                     ; 763   if (RejectionCounter <= MAX_REJECTED_MEASUREMENTS)
 985  01d9 0d08          	tnz	(OFST-7,sp)
 986  01db 2620          	jrne	L313
 987                     ; 765     FinalMeasurementValue = (u32)(FinalMeasurementValue >> 3); /* Division by SAMPLING_SHIFTER_NB_LOOPS */
 989  01dd ae0004        	ldw	x,#_FinalMeasurementValue
 990  01e0 a603          	ld	a,#3
 991  01e2 cd0000        	call	c_lgursh
 994  01e5 2008          	jra	L713
 995  01e7               L513:
 996                     ; 768       FinalMeasurementValue = (u32)(FinalMeasurementValue >> 1);
 998  01e7 3404          	srl	_FinalMeasurementValue
 999  01e9 3605          	rrc	_FinalMeasurementValue+1
1000  01eb 3606          	rrc	_FinalMeasurementValue+2
1001  01ed 3607          	rrc	_FinalMeasurementValue+3
1002  01ef               L713:
1003                     ; 766     while (AdjustmentLevel--)
1005  01ef 7b11          	ld	a,(OFST+2,sp)
1006  01f1 0a11          	dec	(OFST+2,sp)
1007  01f3 4d            	tnz	a
1008  01f4 26f1          	jrne	L513
1009                     ; 770     *sTouchIO.Measurement = (u16)FinalMeasurementValue;
1011  01f6 be06          	ldw	x,_FinalMeasurementValue+2
1012  01f8 92cf0c        	ldw	[_sTouchIO+4.w],x
1014  01fb 2016          	jra	L323
1015  01fd               L313:
1016                     ; 775     if (sTouchIO.Type == SCKEY_TYPE)
1018  01fd 3d10          	tnz	_sTouchIO+8
1019  01ff 260a          	jrne	L523
1020                     ; 778       pKeyStruct->Setting.b.NOISE = 1; /* Warning: Application layer must reset this flag */
1022  0201 be00          	ldw	x,_pKeyStruct
1023  0203 e602          	ld	a,(2,x)
1024  0205 aa40          	or	a,#64
1025  0207 e702          	ld	(2,x),a
1027  0209 2008          	jra	L323
1028  020b               L523:
1029                     ; 783       pMCKeyStruct->Setting.b.NOISE = 1; /* Warning: Application layer must reset this flag */
1031  020b be00          	ldw	x,_pMCKeyStruct
1032  020d e602          	ld	a,(2,x)
1033  020f aa40          	or	a,#64
1034  0211 e702          	ld	(2,x),a
1035  0213               L323:
1036                     ; 788 }
1039  0213 5b11          	addw	sp,#17
1040  0215 81            	ret
1267                     	switch	.ubsct
1268  0000               _AcquisitionBitMask:
1269  0000 00            	ds.b	1
1270                     	xdef	_AcquisitionBitMask
1271  0001               _SamplingShifter:
1272  0001 00            	ds.b	1
1273                     	xdef	_SamplingShifter
1274  0002               _CounterStop:
1275  0002 0000          	ds.b	2
1276                     	xdef	_CounterStop
1277  0004               _FinalMeasurementValue:
1278  0004 00000000      	ds.b	4
1279                     	xdef	_FinalMeasurementValue
1280                     	xref.b	_pMCKeyStruct
1281                     	xref.b	_IT_Sync_Flags
1282                     	xref.b	_pKeyStruct
1283                     	xdef	_TSL_IO_SW_Burst_Stop_Timer
1284                     	xdef	_TSL_IO_SW_Burst_Start_Timer
1285                     	xdef	_TSL_IO_SW_Burst_Wait_Vih
1286                     	xdef	_TSL_IO_SW_Burst_Wait_Vil
1287                     	xdef	_TSL_IO_SW_Burst_TestSyncShift
1288                     	xdef	_TSL_IO_Acquisition
1289                     	xdef	_TSL_IO_Clamp
1290                     	xdef	_TSL_IO_Init
1291                     	xdef	_Table_MCKEY_PORTS
1292                     	xdef	_Table_MCKEY_BITS
1293                     	xdef	_Table_SCKEY_BITS
1294  0008               _sTouchIO:
1295  0008 000000000000  	ds.b	9
1296                     	xdef	_sTouchIO
1297                     	xref.b	c_x
1298                     	xref.b	c_y
1318                     	xref	c_lgursh
1319                     	xref	c_lgadd
1320                     	xref	c_uitolx
1321                     	xref	c_cmulx
1322                     	xref	c_rtol
1323                     	xref	c_umul
1324                     	end

⌨️ 快捷键说明

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