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

📄 level3.lst

📁 此程序为利用mage8 AVR 和EM4094实现读取ISO15693类型卡的C程序、读卡稳定、这个项目我们做了好久、非常不错的程序、很适合做这方面产品的朋友们参考
💻 LST
📖 第 1 页 / 共 5 页
字号:
GAS LISTING C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccqgcaaa.s 			page 1


   1               		.file	"level3.c"
   2               		.arch atmega8
   3               	__SREG__ = 0x3f
   4               	__SP_H__ = 0x3e
   5               	__SP_L__ = 0x3d
   6               	__tmp_reg__ = 0
   7               	__zero_reg__ = 1
   8               		.global __do_copy_data
   9               		.global __do_clear_bss
  10               		.stabs	"E:\\PROJECT_GCC\\ISO15693_OK/",100,0,0,.Ltext0
  11               		.stabs	"level3.c",100,0,0,.Ltext0
  12               		.text
  13               	.Ltext0:
  14               		.stabs	"gcc2_compiled.",60,0,0,0
  15               		.stabs	"int:t(0,1)=r(0,1);-32768;32767;",128,0,0,0
  16               		.stabs	"char:t(0,2)=@s8;r(0,2);0;255;",128,0,0,0
  17               		.stabs	"long int:t(0,3)=@s32;r(0,3);0020000000000;0017777777777;",128,0,0,0
  18               		.stabs	"unsigned int:t(0,4)=r(0,4);0000000000000;0000000177777;",128,0,0,0
  19               		.stabs	"long unsigned int:t(0,5)=@s32;r(0,5);0000000000000;0037777777777;",128,0,0,0
  20               		.stabs	"long long int:t(0,6)=@s64;r(0,6);01000000000000000000000;0777777777777777777777;",128,0,0,
  21               		.stabs	"long long unsigned int:t(0,7)=@s64;r(0,7);0000000000000;01777777777777777777777;",128,0,0,
  22               		.stabs	"short int:t(0,8)=r(0,8);-32768;32767;",128,0,0,0
  23               		.stabs	"short unsigned int:t(0,9)=r(0,9);0000000000000;0000000177777;",128,0,0,0
  24               		.stabs	"signed char:t(0,10)=@s8;r(0,10);-128;127;",128,0,0,0
  25               		.stabs	"unsigned char:t(0,11)=@s8;r(0,11);0;255;",128,0,0,0
  26               		.stabs	"float:t(0,12)=r(0,1);4;0;",128,0,0,0
  27               		.stabs	"double:t(0,13)=r(0,1);4;0;",128,0,0,0
  28               		.stabs	"long double:t(0,14)=r(0,1);4;0;",128,0,0,0
  29               		.stabs	"complex int:t(0,15)=s4real:(0,1),0,16;imag:(0,1),16,16;;",128,0,0,0
  30               		.stabs	"complex float:t(0,16)=R3;8;0;",128,0,0,0
  31               		.stabs	"complex double:t(0,17)=R3;8;0;",128,0,0,0
  32               		.stabs	"complex long double:t(0,18)=R3;8;0;",128,0,0,0
  33               		.stabs	"__builtin_va_list:t(0,19)=*(0,20)=(0,20)",128,0,0,0
  34               		.stabs	"_Bool:t(0,21)=@s8;-16;",128,0,0,0
  35               		.stabs	"level3.c",130,0,0,0
  36               		.stabs	"C:/WinAVR/avr/include/avr/io.h",130,0,0,0
  37               		.stabs	"C:/WinAVR/avr/include/avr/sfr_defs.h",130,0,0,0
  38               		.stabs	"C:/WinAVR/avr/include/inttypes.h",130,0,0,0
  39               		.stabs	"int8_t:t(4,1)=(0,10)",128,0,67,0
  40               		.stabs	"uint8_t:t(4,2)=(0,11)",128,0,72,0
  41               		.stabs	"int16_t:t(4,3)=(0,1)",128,0,90,0
  42               		.stabs	"uint16_t:t(4,4)=(0,4)",128,0,95,0
  43               		.stabs	"int32_t:t(4,5)=(0,3)",128,0,106,0
  44               		.stabs	"uint32_t:t(4,6)=(0,5)",128,0,111,0
  45               		.stabs	"int64_t:t(4,7)=(0,6)",128,0,124,0
  46               		.stabs	"uint64_t:t(4,8)=(0,7)",128,0,129,0
  47               		.stabs	"intptr_t:t(4,9)=(4,3)",128,0,141,0
  48               		.stabs	"uintptr_t:t(4,10)=(4,4)",128,0,146,0
  49               		.stabn	162,0,0,0
  50               		.stabn	162,0,0,0
  51               		.stabs	"C:/WinAVR/avr/include/avr/iom8.h",130,0,0,0
  52               		.stabn	162,0,0,0
  53               		.stabs	"C:/WinAVR/avr/include/avr/portpins.h",130,0,0,0
  54               		.stabn	162,0,0,0
  55               		.stabn	162,0,0,0
  56               		.stabs	"C:/WinAVR/avr/include/avr/interrupt.h",130,0,0,0
  57               		.stabn	162,0,0,0
GAS LISTING C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccqgcaaa.s 			page 2


  58               		.stabs	"C:/WinAVR/avr/include/avr/signal.h",130,0,0,0
  59               		.stabn	162,0,0,0
  60               		.stabs	"C:/WinAVR/avr/include/avr/wdt.h",130,0,0,0
  61               		.stabn	162,0,0,0
  62               		.stabs	"level4.h",130,0,0,0
  63               		.stabn	162,0,0,0
  64               		.stabs	"level3.h",130,0,0,0
  65               		.stabn	162,0,0,0
  66               		.stabs	"level2.h",130,0,0,0
  67               		.stabs	"TCAPTURE:T(12,1)=s256capture_data:(12,2)=ar(12,3)=r(12,3);0000000000000;0000000177777;;0;1
  68               		.stabs	"TCAPTURE:t(12,4)=(12,1)",128,0,89,0
  69               		.stabn	162,0,0,0
  70               		.stabs	"level1.h",130,0,0,0
  71               		.stabn	162,0,0,0
  72               		.stabs	"main_receiver:F(0,20)",36,0,59,main_receiver
  73               	.global	main_receiver
  74               		.type	main_receiver, @function
  75               	main_receiver:
   1:level3.c      **** 
   2:level3.c      **** 
   3:level3.c      **** #include <avr/io.h>
   4:level3.c      **** #include <inttypes.h>
   5:level3.c      **** #include <avr/interrupt.h>
   6:level3.c      **** #include <avr/signal.h>
   7:level3.c      **** #include <avr/wdt.h>
   8:level3.c      **** #include "level4.h"
   9:level3.c      **** #include "level3.h"
  10:level3.c      **** #include "level2.h"
  11:level3.c      **** #include "level1.h"
  12:level3.c      **** 
  13:level3.c      **** //--------------------------------------------------------------
  14:level3.c      **** //global variables
  15:level3.c      **** 
  16:level3.c      **** uint8_t maxCaptureTimeLow;           //lower part of current maximum capture time (used to initiali
  17:level3.c      **** uint8_t maxCaptureTimeHi;            //upper part of current maximum capture time (expected value 0
  18:level3.c      **** 
  19:level3.c      **** //--------------------------------------------------------------
  20:level3.c      **** //local declarations
  21:level3.c      **** 
  22:level3.c      **** #define STD_WAIT 145                  //~318us = (145+13)x32 @ 16MHz , 13x32 uC clocks is a setup r
  23:level3.c      **** 
  24:level3.c      **** uint8_t clean_data_cnt;               //clean response data length
  25:level3.c      **** 
  26:level3.c      **** uint16_t maxTGeneral;                 //current datarate maximum response capture time
  27:level3.c      **** uint16_t maxTwa1ee;                   //
  28:level3.c      **** 
  29:level3.c      **** uint8_t signed_crc;                   //flag of signed response
  30:level3.c      **** 
  31:level3.c      **** uint8_t authSelectFlag;               //disable selection before HW Authentication
  32:level3.c      **** //uint8_t em4094_data_invalid_times;
  33:level3.c      **** //uint8_t history_weigan_data[ 5 ];
  34:level3.c      **** uint8_t em4094_data_valid_flag;
  35:level3.c      **** uint8_t data_same_times;
  36:level3.c      **** 
  37:level3.c      **** //void SendCaptureData( uint8_t cmd, uint8_t ack );
  38:level3.c      **** void AddCRC( uint8_t where );
  39:level3.c      **** void Compute_Timeouts( uint8_t flags );
GAS LISTING C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccqgcaaa.s 			page 3


  40:level3.c      **** uint8_t Compare_Weigan_Data( void );
  41:level3.c      **** //void Inventory( void );
  42:level3.c      **** int8_t InventoryStep_version4( void );
  43:level3.c      **** void main_receiver( void );
  44:level3.c      **** void Send( uint8_t len , uint16_t wait_time );
  45:level3.c      **** void Alarm_Check_And_Process( void );
  46:level3.c      **** 
  47:level3.c      **** //uint8_t HW_Authentication(void);
  48:level3.c      **** //uint8_t ToggleEAS(void);
  49:level3.c      **** //uint8_t GeneralRead(void);
  50:level3.c      **** //uint8_t GeneralWrite(void);
  51:level3.c      **** //void RF_Reset(void);
  52:level3.c      **** //uint8_t SwitchToNormalMode(void);
  53:level3.c      **** 
  54:level3.c      **** //--------------------------------------------------------------
  55:level3.c      **** // main loop routine
  56:level3.c      **** //--------------------------------------------------------------
  57:level3.c      **** 
  58:level3.c      **** void main_receiver( void ) 
  59:level3.c      **** {
  76               		.stabn 68,0,59,.LM1-main_receiver
  77               	.LM1:
  78               	/* prologue: frame size=0 */
  79 0000 CF93      		push r28
  80               	/* prologue end (size=1) */
  60:level3.c      **** 
  61:level3.c      ****     uint8_t fwd_bit_count;
  62:level3.c      **** //    uint8_t i;
  63:level3.c      ****     decode_number = 2;
  81               		.stabn 68,0,63,.LM2-main_receiver
  82               	.LM2:
  83               	.LBB2:
  84 0002 82E0      		ldi r24,lo8(2)
  85 0004 8093 0000 		sts decode_number,r24
  64:level3.c      ****     forward_link_type = 0x01;               //default value = 1 from 4 forward link    
  86               		.stabn 68,0,64,.LM3-main_receiver
  87               	.LM3:
  88 0008 81E0      		ldi r24,lo8(1)
  89 000a 8093 0000 		sts forward_link_type,r24
  65:level3.c      **** 
  66:level3.c      ****     uint16_t write_4094_low = 0xCB33;
  67:level3.c      ****     uint16_t write_4094_hi  = 0x0280;
  68:level3.c      ****     
  69:level3.c      ****     WriteSPI( write_4094_low , write_4094_hi );
  90               		.stabn 68,0,69,.LM4-main_receiver
  91               	.LM4:
  92 000e 60E8      		ldi r22,lo8(640)
  93 0010 72E0      		ldi r23,hi8(640)
  94 0012 83E3      		ldi r24,lo8(-13517)
  95 0014 9BEC      		ldi r25,hi8(-13517)
  96 0016 00D0      		rcall WriteSPI
  70:level3.c      ****     Wait( 4000 );
  97               		.stabn 68,0,70,.LM5-main_receiver
  98               	.LM5:
  99 0018 80EA      		ldi r24,lo8(4000)
 100 001a 9FE0      		ldi r25,hi8(4000)
 101 001c 00D0      		rcall Wait
GAS LISTING C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccqgcaaa.s 			page 4


 102               	.L23:
  71:level3.c      **** 
  72:level3.c      ****     while ( 21 ) 
  73:level3.c      ****     {                              // infinite loop
  74:level3.c      **** 
  75:level3.c      ****         wdt_reset( );                            // reset the watchdog
 103               		.stabn 68,0,75,.LM6-main_receiver
 104               	.LM6:
 105               	/* #APP */
 106 001e A895      		wdr
  76:level3.c      **** #ifdef WDT
  77:level3.c      ****         WatchDog_Feed( );
 107               		.stabn 68,0,77,.LM7-main_receiver
 108               	.LM7:
 109               	/* #NOAPP */
 110 0020 00D0      		rcall WatchDog_Feed
  78:level3.c      **** #endif       
  79:level3.c      ****   
  80:level3.c      ****         if ( valid_data_flag == 0 )
 111               		.stabn 68,0,80,.LM8-main_receiver
 112               	.LM8:
 113 0022 8091 0000 		lds r24,valid_data_flag
 114 0026 8823      		tst r24
 115 0028 89F0      		breq .L6
  81:level3.c      ****         {
  82:level3.c      **** //       	 	  SendByte( 0xEE );                    //output error sign;
  83:level3.c      ****         }
  84:level3.c      ****         else
  85:level3.c      ****         { 
  86:level3.c      ****        	    valid_data_flag = 0x00;
 116               		.stabn 68,0,86,.LM9-main_receiver
 117               	.LM9:
 118 002a 1092 0000 		sts valid_data_flag,__zero_reg__
  87:level3.c      ****       	    SendByte( 0x55 );                  //response to PC;
 119               		.stabn 68,0,87,.LM10-main_receiver
 120               	.LM10:
 121 002e 85E5      		ldi r24,lo8(85)
 122 0030 00D0      		rcall SendByte
  88:level3.c      ****       	    SendByte( 0xAA );
 123               		.stabn 68,0,88,.LM11-main_receiver
 124               	.LM11:
 125 0032 8AEA      		ldi r24,lo8(-86)
 126 0034 00D0      		rcall SendByte
  89:level3.c      ****       	    SendByte( 0x01 );
 127               		.stabn 68,0,89,.LM12-main_receiver
 128               	.LM12:
 129 0036 81E0      		ldi r24,lo8(1)
 130 0038 00D0      		rcall SendByte
  90:level3.c      ****       	    SendByte( 0x02 );
 131               		.stabn 68,0,90,.LM13-main_receiver
 132               	.LM13:
 133 003a 82E0      		ldi r24,lo8(2)
 134 003c 00D0      		rcall SendByte
  91:level3.c      ****       	    Beep( 1 );
 135               		.stabn 68,0,91,.LM14-main_receiver
 136               	.LM14:
 137 003e 81E0      		ldi r24,lo8(1)
GAS LISTING C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccqgcaaa.s 			page 5


 138 0040 00D0      		rcall Beep
  92:level3.c      ****       	    Parse_Command( uart_in_command , uart_in_param ); 
 139               		.stabn 68,0,92,.LM15-main_receiver
 140               	.LM15:
 141 0042 6091 0000 		lds r22,uart_in_param
 142 0046 8091 0000 		lds r24,uart_in_command
 143 004a 00D0      		rcall Parse_Command
 144               	.L6:
  93:level3.c      ****         } 
  94:level3.c      ****         
  95:level3.c      ****         Alarm_Check_And_Process( );   
 145               		.stabn 68,0,95,.LM16-main_receiver
 146               	.LM16:
 147 004c CFD1      		rcall Alarm_Check_And_Process
  96:level3.c      ****                                         
  97:level3.c      ****         expectedResponseLen = 0x60;
 148               		.stabn 68,0,97,.LM17-main_receiver
 149               	.LM17:
 150 004e 80E6      		ldi r24,lo8(96)
 151 0050 8093 0000 		sts expectedResponseLen,r24
  98:level3.c      ****         cmd_message_len = 5;
 152               		.stabn 68,0,98,.LM18-main_receiver
 153               	.LM18:
 154 0054 85E0      		ldi r24,lo8(5)
 155 0056 8093 0000 		sts cmd_message_len,r24
  99:level3.c      ****         cmd_message[ 0 ] = 0x26;
 156               		.stabn 68,0,99,.LM19-main_receiver
 157               	.LM19:
 158 005a 96E2      		ldi r25,lo8(38)
 159 005c 9093 0000 		sts cmd_message,r25
 100:level3.c      ****         cmd_message[ 1 ] = 0x01;
 160               		.stabn 68,0,100,.LM20-main_receiver
 161               	.LM20:
 162 0060 C1E0      		ldi r28,lo8(1)
 163 0062 C093 0000 		sts cmd_message+1,r28
 101:level3.c      ****         cmd_message[ 2 ] = 0x00;
 164               		.stabn 68,0,101,.LM21-main_receiver
 165               	.LM21:
 166 0066 1092 0000 		sts cmd_message+2,__zero_reg__
 102:level3.c      ****         cmd_message[ 3 ] = 0xF6;
 167               		.stabn 68,0,102,.LM22-main_receiver
 168               	.LM22:
 169 006a 86EF      		ldi r24,lo8(-10)
 170 006c 8093 0000 		sts cmd_message+3,r24
 103:level3.c      ****         cmd_message[ 4 ] = 0x0A;
 171               		.stabn 68,0,103,.LM23-main_receiver
 172               	.LM23:
 173 0070 8AE0      		ldi r24,lo8(10)
 174 0072 8093 0000 		sts cmd_message+4,r24
 104:level3.c      ****         message_flags = cmd_message[ 0 ];
 175               		.stabn 68,0,104,.LM24-main_receiver

⌨️ 快捷键说明

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