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

📄 i2c.lst

📁 在cypress晶片上實驗讀取ps2 keyboard按鍵後顯示在lcd上,同時利用I2C寫入EEPROM
💻 LST
📖 第 1 页 / 共 4 页
字号:
   489                           ;i2c.c: 303: }
   490  057B  0844               	movf	?a_i2c_read+1,w
   491                           ;i2c.c: 306: }
   492  057C  0008               	return
   493                           ;i2c.c: 154: void
   494                           ;i2c.c: 155: i2c_SendAcknowledge(unsigned char 
      +                          status)
   495                           ;i2c.c: 156: {
   496  057D                     _i2c_SendAcknowledge
   497                           ;	_status assigned to ?a_i2c_SendAcknowledge+0
   498  0000                     _i2c_SendAcknowledge$status	set	?a_i2c_SendAckn
      +                          owledge
   499                           ;	__dcnt assigned to ?a_i2c_SendAcknowledge+1
   500  0000                     _i2c_SendAcknowledge$_dcnt	set	?a_i2c_SendAckno
      +                          wledge+1
   501                           ;	__dcnt assigned to ?a_i2c_SendAcknowledge+1
   502  0000                     _i2c_SendAcknowledge$_dcnt	set	?a_i2c_SendAckno
      +                          wledge+1
   503                           ;_status stored from w
   504  057D  0183               	clrf	3	;select bank 0
   505  057E  00C3               	movwf	?a_i2c_SendAcknowledge
   506                           ;i2c.c: 157: RC1 = 0; TRISC1 = 0;
   507  057F  1087               	bcf	7,1
   508  0580  1683               	bsf	3,5
   509  0581  1087               	bcf	7,1
   510                           ;i2c.c: 158: if ( status & 0x01) {
   511  0582  1283               	bcf	3,5
   512  0583  1C43               	btfss	?a_i2c_SendAcknowledge,0
   513  0584  2D87               	goto	l55
   514                           ;i2c.c: 159: RC0 = 0; TRISC0 = 0;
   515  0585  1007               	bcf	7,0
   516  0586  2D88               	goto	L3
   517                           ;i2c.c: 160: }else {
   518  0587                     l55
   519                           ;i2c.c: 161: RC0 = 1; TRISC0 = 0;
   520  0587  1407               	bsf	7,0
   521  0588                     L3
   522  0588  1683               	bsf	3,5
   523  0589  1007               	bcf	7,0
   524                           ;i2c.c: 162: }
   525                           ;i2c.c: 163: { unsigned char _dcnt; _dcnt = (1)
      +                          *((20*1000L)/(12*1000L)); while(--_dcnt != 0) c
      +                          ontinue; };
   526  058A  1283               	bcf	3,5
   527  058B  01C4               	clrf	?a_i2c_SendAcknowledge+1
   528  058C  0AC4               	incf	?a_i2c_SendAcknowledge+1
   529  058D                     l58
   530  058D  0BC4               	decfsz	?a_i2c_SendAcknowledge+1
   531  058E  2D8D               	goto	l58
   532                           ;i2c.c: 164: TRISC1 = 1;
   533  058F  1683               	bsf	3,5
   534  0590  1487               	bsf	7,1
   535                           ;i2c.c: 165: { unsigned char _dcnt; _dcnt = (4)
      +                          *((20*1000L)/(12*1000L)); while(--_dcnt != 0) c
      +                          ontinue; };
   536  0591  3004               	movlw	4
   537  0592  1283               	bcf	3,5
   538  0593  00C4               	movwf	?a_i2c_SendAcknowledge+1
   539  0594                     l61
   540  0594  0BC4               	decfsz	?a_i2c_SendAcknowledge+1
   541  0595  2D94               	goto	l61
   542                           ;i2c.c: 166: return;
   543                           ;i2c.c: 167: }
   544  0596  0008               	return
   545                           ;i2c.c: 185: int
   546                           ;i2c.c: 186: i2c_GetByte(unsigned char more)
   547                           ;i2c.c: 187: {
   548  0597                     _i2c_GetByte
   549                           ;	_more assigned to ?a_i2c_GetByte+0
   550  0000                     _i2c_GetByte$more	set	?a_i2c_GetByte
   551                           ;	_byte assigned to ?a_i2c_GetByte+1
   552  0000                     _i2c_GetByte$byte	set	?a_i2c_GetByte+1
   553                           ;_more stored from w
   554  0597  0183               	clrf	3	;select bank 0
   555  0598  00C3               	movwf	?a_i2c_GetByte
   556                           ;i2c.c: 188: int byte;
   557  0599  24EF               	fcall	_i2c_ReadByte
   558  059A  0856               	movf	btemp,w
   559  059B  00C4               	movwf	?a_i2c_GetByte+1
   560  059C  0857               	movf	btemp+1,w
   561  059D  00C5               	movwf	?a_i2c_GetByte+2
   562  059E  0A44               	incf	?a_i2c_GetByte+1,w
   563  059F  1903               	btfsc	3,2
   564  05A0  0A45               	incf	?a_i2c_GetByte+2,w
   565  05A1  1D03               	btfss	3,2
   566  05A2  2DA7               	goto	l66
   567                           ;i2c.c: 191: return (-1);
   568  05A3  30FF               	movlw	255
   569  05A4  00D6               	movwf	btemp
   570  05A5  00D7               	movwf	btemp+1
   571  05A6  0008               	return
   572  05A7                     l66
   573                           ;i2c.c: 193: i2c_SendAcknowledge(more);
   574  05A7  0843               	movf	?a_i2c_GetByte,w
   575  05A8  257D               	fcall	_i2c_SendAcknowledge
   576                           ;i2c.c: 195: return byte;
   577  05A9  0845               	movf	?a_i2c_GetByte+2,w
   578  05AA  00D7               	movwf	btemp+1
   579  05AB  0844               	movf	?a_i2c_GetByte+1,w
   580  05AC  00D6               	movwf	btemp
   581                           ;i2c.c: 196: }
   582  05AD  0008               	return
   583                           ;i2c.c: 173: signed char
   584                           ;i2c.c: 174: i2c_PutByte(unsigned char data)
   585                           ;i2c.c: 175: {
   586  05AE                     _i2c_PutByte
   587                           ;	_data assigned to ?a_i2c_PutByte+0
   588  0000                     _i2c_PutByte$data	set	?a_i2c_PutByte
   589                           ;_data stored from w
   590  05AE  0183               	clrf	3	;select bank 0
   591  05AF  00C3               	movwf	?a_i2c_PutByte
   592                           ;i2c.c: 176: if(i2c_SendByte(data))
   593  05B0  2491               	fcall	_i2c_SendByte
   594  05B1  3800               	iorlw	0
   595  05B2  1D03               	btfss	3,2
   596                           ;i2c.c: 177: return (-1);
   597  05B3  34FF               	retlw	-1
   598                           ;i2c.c: 178: return i2c_ReadAcknowledge();
   599  05B4  2CD4               	ljmp	_i2c_ReadAcknowledge
   600  05B5                     _i2c_PutString
   601                           ;	_error assigned to ?a_i2c_PutString+0
   602  0000                     _i2c_PutString$error	set	?a_i2c_PutString
   603                           ;i2c.c: 205: signed char error;
   604  05B5  2DD5               	goto	l68
   605  05B6                     l69
   606                           ;i2c.c: 208: {
   607  05B6  0844               	movf	?_i2c_PutString+1,w
   608  05B7  00E1               	movwf	code_ptr+1
   609  05B8  0843               	movf	?_i2c_PutString,w
   610  05B9  118A  20BD  118A   	fcall	string_table
   611  05BC  25AE  118A         	fcall	_i2c_PutByte
   612  05BE  00C3               	movwf	?a_i2c_PutString
   613  05BF  0F43               	incfsz	?a_i2c_PutString,w
   614  05C0  2DCA               	goto	l71
   615                           ;i2c.c: 210: return -(int)length;
   616  05C1  0845               	movf	?_i2c_PutString+2,w
   617  05C2  00D6               	movwf	btemp
   618  05C3  01D7               	clrf	btemp+1
   619  05C4  09D6               	comf	btemp
   620  05C5  09D7               	comf	btemp+1
   621  05C6  0AD6               	incf	btemp
   622  05C7  1903               	btfsc	3,2
   623  05C8  0AD7               	incf	btemp+1
   624  05C9  0008               	return
   625  05CA                     l71
   626                           ;i2c.c: 212: if(error)
   627  05CA  08C3               	movf	?a_i2c_PutString
   628  05CB  1903               	btfsc	3,2
   629  05CC  2DD1               	goto	l72
   630                           ;i2c.c: 213: return (int)length;
   631  05CD  0845               	movf	?_i2c_PutString+2,w
   632  05CE  00D6               	movwf	btemp
   633  05CF  01D7               	clrf	btemp+1
   634  05D0  0008               	return
   635  05D1                     l72
   636  05D1  0AC3               	incf	?_i2c_PutString
   637  05D2  1903               	btfsc	3,2
   638  05D3  0AC4               	incf	?_i2c_PutString+1
   639                           ;i2c.c: 215: length--;
   640  05D4  03C5               	decf	?_i2c_PutString+2
   641  05D5                     l68
   642                           ;i2c.c: 216: }
   643  05D5  1283               	bcf	3,5
   644  05D6  1303               	bcf	3,6	;carry unused
   645  05D7  08C5               	movf	?_i2c_PutString+2
   646  05D8  1D03               	btfss	3,2
   647  05D9  2DB6               	goto	l69
   648                           ;i2c.c: 218: return 0;
   649  05DA  01D6               	clrf	btemp
   650  05DB  01D7               	clrf	btemp+1
   651                           ;i2c.c: 219: }
   652  05DC  0008               	return
   653                           
   654                           	psect	text13
   655                           ;i2c.c: 279: void
   656                           ;i2c.c: 280: i2c_Free()
   657                           ;i2c.c: 281: {
   658  0339                     _i2c_Free
   659                           ;	_ucI assigned to ?a_i2c_Free+0
   660  0000                     _i2c_Free$ucI	set	?a_i2c_Free
   661                           ;	__dcnt assigned to ?a_i2c_Free+1
   662  0000                     _i2c_Free$_dcnt	set	?a_i2c_Free+1
   663                           ;	__dcnt assigned to ?a_i2c_Free+1
   664  0000                     _i2c_Free$_dcnt	set	?a_i2c_Free+1
   665                           ;i2c.c: 282: unsigned char ucI;
   666  0339  1683               	bsf	3,5
   667  033A  1303               	bcf	3,6	;carry unused
   668  033B  1407               	bsf	7,0
   669                           ;i2c.c: 285: for(ucI=0;ucI!=9;ucI++)
   670  033C  1283               	bcf	3,5
   671  033D  01C3               	clrf	?a_i2c_Free
   672  033E                     l89
   673                           ;i2c.c: 286: {
   674                           ;i2c.c: 287: RC1 = 1; TRISC1 = 0;
   675  033E  1487               	bsf	7,1
   676  033F  1683               	bsf	3,5
   677  0340  1087               	bcf	7,1
   678                           ;i2c.c: 288: { unsigned char _dcnt; _dcnt = (5)
      +                          *((20*1000L)/(12*1000L)); while(--_dcnt != 0) c
      +                          ontinue; };
   679  0341  3005               	movlw	5
   680  0342  1283               	bcf	3,5
   681  0343  00C4               	movwf	?a_i2c_Free+1
   682  0344                     l93
   683  0344  0BC4               	decfsz	?a_i2c_Free+1
   684  0345  2B44               	goto	l93
   685                           ;i2c.c: 289: RC1 = 0; TRISC1 = 0;
   686  0346  1087               	bcf	7,1
   687  0347  1683               	bsf	3,5
   688  0348  1087               	bcf	7,1
   689                           ;i2c.c: 290: { unsigned char _dcnt; _dcnt = (5)
      +                          *((20*1000L)/(12*1000L)); while(--_dcnt != 0) c
      +                          ontinue; };
   690  0349  3005               	movlw	5
   691  034A  1283               	bcf	3,5
   692  034B  00C4               	movwf	?a_i2c_Free+1
   693  034C                     l96
   694  034C  0BC4               	decfsz	?a_i2c_Free+1
   695  034D  2B4C               	goto	l96
   696                           ;i2c.c: 291: }
   697  034E  0AC3               	incf	?a_i2c_Free
   698  034F  0843               	movf	?a_i2c_Free,w
   699  0350  3A09               	xorlw	9
   700  0351  1903               	btfsc	3,2
   701  0352  0008               	return
   702  0353  2B3E               	goto	l89
   703                           
   704                           	psect	text15
   705  0000                     
   706  0000                     
   707  0000                     
   708  0000                     
   709  0000                     
   710  0000                     
   711  0000                     
   712  0000                     
   713  0000                     
   714  0000                     
   715  0000                     
   716  0000                     
   717  0000                     
   718  0000                     
   719  0000                     
   720  0000                     
   721  0000                     
   722  0000                     
   723  0000                     
   724  0000                     
   725  0000                     
   726  0000                     
   727  0000                     
   728  0000                     
   729  0000                     
   730  0000                     
   731  0000                     
   732  0000                     
   733  0000                     
   734  0000                     
   735  0000                     
   736  0000                     
   737  0000                     
   738  0000                     

⌨️ 快捷键说明

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