Subversion Repositories svnkaklik

Rev

Go to most recent revision | Details | Last modification | View Log

Rev Author Line No. Line
182 kaklik 1
GAS LISTING /tmp/ccZHfAgR.s 			page 1
174 kaklik 2
 
3
 
4
   1               		.file	"I2CInterface.c"
5
   2               		.arch atmega8
6
   3               	__SREG__ = 0x3f
7
   4               	__SP_H__ = 0x3e
8
   5               	__SP_L__ = 0x3d
9
   6               	__tmp_reg__ = 0
10
   7               	__zero_reg__ = 1
11
   8               		.global __do_copy_data
12
   9               		.global __do_clear_bss
13
  10               		.stabs	"/home/kaklik/projects/programy/Atmel_C/AVRcam/",100,0,2,.Ltext0
14
  11               		.stabs	"I2CInterface.c",100,0,2,.Ltext0
15
  12               		.text
16
  13               	.Ltext0:
17
  14               		.stabs	"gcc2_compiled.",60,0,0,0
18
  15               		.stabs	"int:t(0,1)=r(0,1);-32768;32767;",128,0,0,0
19
  16               		.stabs	"char:t(0,2)=@s8;r(0,2);0;255;",128,0,0,0
20
  17               		.stabs	"long int:t(0,3)=@s32;r(0,3);020000000000;017777777777;",128,0,0,0
21
  18               		.stabs	"unsigned int:t(0,4)=r(0,4);0;0177777;",128,0,0,0
22
  19               		.stabs	"long unsigned int:t(0,5)=@s32;r(0,5);0;037777777777;",128,0,0,0
23
  20               		.stabs	"long long int:t(0,6)=@s64;r(0,6);01000000000000000000000;0777777777777777777777;",128,0,0,
24
  21               		.stabs	"long long unsigned int:t(0,7)=@s64;r(0,7);0;01777777777777777777777;",128,0,0,0
25
  22               		.stabs	"short int:t(0,8)=r(0,8);-32768;32767;",128,0,0,0
26
  23               		.stabs	"short unsigned int:t(0,9)=r(0,9);0;0177777;",128,0,0,0
27
  24               		.stabs	"signed char:t(0,10)=@s8;r(0,10);-128;127;",128,0,0,0
28
  25               		.stabs	"unsigned char:t(0,11)=@s8;r(0,11);0;255;",128,0,0,0
29
  26               		.stabs	"float:t(0,12)=r(0,1);4;0;",128,0,0,0
30
  27               		.stabs	"double:t(0,13)=r(0,1);4;0;",128,0,0,0
31
  28               		.stabs	"long double:t(0,14)=r(0,1);4;0;",128,0,0,0
32
  29               		.stabs	"void:t(0,15)=(0,15)",128,0,0,0
33
  30               		.stabs	"/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/io.h",130,0,0,0
34
  31               		.stabs	"/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/sfr_defs.h",130,0,0,0
35
  32               		.stabs	"/usr/lib/gcc/avr/4.1.0/../../../../avr/include/inttypes.h",130,0,0,0
36
  33               		.stabs	"/usr/lib/gcc/avr/4.1.0/../../../../avr/include/stdint.h",130,0,0,0
37
  34               		.stabs	"int8_t:t(4,1)=(0,10)",128,0,116,0
38
  35               		.stabs	"uint8_t:t(4,2)=(0,11)",128,0,117,0
39
  36               		.stabs	"int16_t:t(4,3)=(0,1)",128,0,118,0
40
  37               		.stabs	"uint16_t:t(4,4)=(0,4)",128,0,119,0
41
  38               		.stabs	"int32_t:t(4,5)=(0,3)",128,0,120,0
42
  39               		.stabs	"uint32_t:t(4,6)=(0,5)",128,0,121,0
43
  40               		.stabs	"int64_t:t(4,7)=(0,6)",128,0,122,0
44
  41               		.stabs	"uint64_t:t(4,8)=(0,7)",128,0,123,0
45
  42               		.stabs	"intptr_t:t(4,9)=(4,3)",128,0,135,0
46
  43               		.stabs	"uintptr_t:t(4,10)=(4,4)",128,0,140,0
47
  44               		.stabs	"int_least8_t:t(4,11)=(4,1)",128,0,152,0
48
  45               		.stabs	"uint_least8_t:t(4,12)=(4,2)",128,0,157,0
49
  46               		.stabs	"int_least16_t:t(4,13)=(4,3)",128,0,162,0
50
  47               		.stabs	"uint_least16_t:t(4,14)=(4,4)",128,0,167,0
51
  48               		.stabs	"int_least32_t:t(4,15)=(4,5)",128,0,172,0
52
  49               		.stabs	"uint_least32_t:t(4,16)=(4,6)",128,0,177,0
53
  50               		.stabs	"int_least64_t:t(4,17)=(4,7)",128,0,182,0
54
  51               		.stabs	"uint_least64_t:t(4,18)=(4,8)",128,0,187,0
55
  52               		.stabs	"int_fast8_t:t(4,19)=(4,1)",128,0,200,0
56
  53               		.stabs	"uint_fast8_t:t(4,20)=(4,2)",128,0,205,0
57
  54               		.stabs	"int_fast16_t:t(4,21)=(4,3)",128,0,210,0
58
  55               		.stabs	"uint_fast16_t:t(4,22)=(4,4)",128,0,215,0
59
  56               		.stabs	"int_fast32_t:t(4,23)=(4,5)",128,0,220,0
60
  57               		.stabs	"uint_fast32_t:t(4,24)=(4,6)",128,0,225,0
182 kaklik 61
GAS LISTING /tmp/ccZHfAgR.s 			page 2
174 kaklik 62
 
63
 
64
  58               		.stabs	"int_fast64_t:t(4,25)=(4,7)",128,0,230,0
65
  59               		.stabs	"uint_fast64_t:t(4,26)=(4,8)",128,0,235,0
66
  60               		.stabs	"intmax_t:t(4,27)=(4,7)",128,0,249,0
67
  61               		.stabs	"uintmax_t:t(4,28)=(4,8)",128,0,254,0
68
  62               		.stabn	162,0,0,0
69
  63               		.stabs	"int_farptr_t:t(3,1)=(4,5)",128,0,76,0
70
  64               		.stabs	"uint_farptr_t:t(3,2)=(4,6)",128,0,80,0
71
  65               		.stabn	162,0,0,0
72
  66               		.stabn	162,0,0,0
73
  67               		.stabn	162,0,0,0
74
  68               		.stabs	"CamConfig.h",130,0,0,0
75
  69               		.stabs	"I2CInterface.h",130,0,0,0
76
  70               		.stabs	"CommonDefs.h",130,0,0,0
77
  71               		.stabs	"bool_t:t(7,1)=(0,11)",128,0,56,0
78
  72               		.stabn	162,0,0,0
79
  73               		.stabs	"i2cCmd_t:t(6,1)=(6,2)=s2configReg:(0,11),0,8;data:(0,11),8,8;;",128,0,53,0
80
  74               		.stabn	162,0,0,0
81
  75               		.stabn	162,0,0,0
82
  76               		.stabs	"I2CInt_init:F(0,15)",36,0,85,I2CInt_init
83
  77               	.global	I2CInt_init
84
  78               		.type	I2CInt_init, @function
85
  79               	I2CInt_init:
86
  80               		.stabd	46,0,0
87
   1:I2CInterface.c **** /*
88
   2:I2CInterface.c ****     Copyright (C) 2004    John Orlando
89
   3:I2CInterface.c ****     
90
   4:I2CInterface.c ****    AVRcam: a small real-time image processing engine.
91
   5:I2CInterface.c **** 
92
   6:I2CInterface.c ****     This program is free software; you can redistribute it and/or
93
   7:I2CInterface.c ****     modify it under the terms of the GNU General Public
94
   8:I2CInterface.c ****     License as published by the Free Software Foundation; either
95
   9:I2CInterface.c ****     version 2 of the License, or (at your option) any later version.
96
  10:I2CInterface.c **** 
97
  11:I2CInterface.c ****     This program is distributed in the hope that it will be useful,
98
  12:I2CInterface.c ****     but WITHOUT ANY WARRANTY; without even the implied warranty of
99
  13:I2CInterface.c ****     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
100
  14:I2CInterface.c ****     General Public License for more details.
101
  15:I2CInterface.c **** 
102
  16:I2CInterface.c ****     You should have received a copy of the GNU General Public
103
  17:I2CInterface.c ****     License along with this program; if not, write to the Free Software
104
  18:I2CInterface.c ****     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
105
  19:I2CInterface.c **** 
106
  20:I2CInterface.c ****    For more information on the AVRcam, please contact:
107
  21:I2CInterface.c **** 
108
  22:I2CInterface.c ****    john@jrobot.net
109
  23:I2CInterface.c **** 
110
  24:I2CInterface.c ****    or go to www.jrobot.net for more details regarding the system.
111
  25:I2CInterface.c **** */
112
  26:I2CInterface.c **** /***********************************************************
113
  27:I2CInterface.c **** 	Module Name: I2CInterface.c
114
  28:I2CInterface.c **** 	Module Date: 4/10/2004
115
  29:I2CInterface.c **** 	Module Auth: John Orlando
116
  30:I2CInterface.c **** 	
117
  31:I2CInterface.c **** 	Description: This module is responsible for providing a
118
  32:I2CInterface.c **** 	low-level interface to the I2C hardware resident on the
119
  33:I2CInterface.c **** 	mega8 processor (also known as the Two-Wire Interface,
120
  34:I2CInterface.c **** 	or TWI).  The interface is needed to configure the
182 kaklik 121
GAS LISTING /tmp/ccZHfAgR.s 			page 3
174 kaklik 122
 
123
 
124
  35:I2CInterface.c **** 	needed registers in the OV6620 camera.  This interface
125
  36:I2CInterface.c **** 	is interrupt-driven based on the events that should
126
  37:I2CInterface.c **** 	occur upon successful writing of an I2C register.
127
  38:I2CInterface.c ****     
128
  39:I2CInterface.c ****     Revision History:
129
  40:I2CInterface.c ****     Date        Rel Ver.    Notes
130
  41:I2CInterface.c ****     4/10/2004      0.1     Module created
131
  42:I2CInterface.c ****     6/30/2004      1.0     Initial release for Circuit Cellar
132
  43:I2CInterface.c ****                            contest.
133
  44:I2CInterface.c **** 
134
  45:I2CInterface.c **** ***********************************************************/
135
  46:I2CInterface.c **** 
136
  47:I2CInterface.c **** /*	Includes */
137
  48:I2CInterface.c **** #include <avr/io.h>
138
  49:I2CInterface.c **** #include <util/twi.h>
139
  50:I2CInterface.c **** #include <avr/interrupt.h>
140
  51:I2CInterface.c **** #include "CamConfig.h"
141
  52:I2CInterface.c **** #include "CommonDefs.h"
142
  53:I2CInterface.c **** 
143
  54:I2CInterface.c **** /*  Local Variables */
144
  55:I2CInterface.c **** 
145
  56:I2CInterface.c **** /* These variables are used as storage space for the current
146
  57:I2CInterface.c ****    I2C command being sent over the interface.  They need to
147
  58:I2CInterface.c ****    be volatile since they are dealt with an the TWI ISR */
148
  59:I2CInterface.c **** volatile static unsigned char twi_address;
149
  60:I2CInterface.c **** volatile static unsigned char *twi_data;
150
  61:I2CInterface.c **** volatile static unsigned char twi_ddr;
151
  62:I2CInterface.c **** volatile static unsigned char twi_bytes;
152
  63:I2CInterface.c **** volatile static unsigned char status;
153
  64:I2CInterface.c **** volatile static unsigned char retry_cnt;
154
  65:I2CInterface.c **** 
155
  66:I2CInterface.c **** /* 	Local Structures and Typedefs */
156
  67:I2CInterface.c **** 
157
  68:I2CInterface.c **** /*  Extern Variables */
158
  69:I2CInterface.c **** 
159
  70:I2CInterface.c **** /*  Definitions */
160
  71:I2CInterface.c **** /* Bit definitions for the tw_status register */
161
  72:I2CInterface.c **** #define MAX_TWI_RETRIES 2
162
  73:I2CInterface.c **** #define BUSY 7
163
  74:I2CInterface.c **** 
164
  75:I2CInterface.c **** /***********************************************************
165
  76:I2CInterface.c **** 	Function Name: I2CInt_init
166
  77:I2CInterface.c **** 	Function Description: This function is responsible
167
  78:I2CInterface.c **** 	for setting up the registers needed for the TWI 
168
  79:I2CInterface.c **** 	interface
169
  80:I2CInterface.c **** 	
170
  81:I2CInterface.c **** 	Inputs:  none
171
  82:I2CInterface.c **** 	Outputs: none
172
  83:I2CInterface.c **** ***********************************************************/	
173
  84:I2CInterface.c **** void I2CInt_init(void)
174
  85:I2CInterface.c **** {
175
  81               		.stabn	68,0,85,.LM0-I2CInt_init
176
  82               	.LM0:
177
  83               	/* prologue: frame size=0 */
178
  84               	/* prologue end (size=0) */
179
  86:I2CInterface.c **** 	TWSR = 0;
180
  85               		.stabn	68,0,86,.LM1-I2CInt_init
182 kaklik 181
GAS LISTING /tmp/ccZHfAgR.s 			page 4
174 kaklik 182
 
183
 
184
  86               	.LM1:
185
  87 0000 11B8      		out 33-0x20,__zero_reg__
186
  87:I2CInterface.c ****     
187
  88:I2CInterface.c **** 	/* init the speed of the I2C interface, running at
188
  89:I2CInterface.c ****     100 Kbps */
189
  90:I2CInterface.c **** 	TWBR = (FOSC / I2C_SPEED - 16)/2;
190
  88               		.stabn	68,0,90,.LM2-I2CInt_init
191
  89               	.LM2:
192
  90 0002 88E4      		ldi r24,lo8(72)
193
  91 0004 80B9      		out 32-0x20,r24
194
  92               	/* epilogue: frame size=0 */
195
  93 0006 0895      		ret
196
  94               	/* epilogue end (size=1) */
197
  95               	/* function I2CInt_init size 4 (3) */
198
  96               		.size	I2CInt_init, .-I2CInt_init
199
  97               	.Lscope0:
200
  98               		.stabs	"",36,0,0,.Lscope0-I2CInt_init
201
  99               		.stabd	78,0,0
202
 100               		.stabs	"I2CInt_writeData:F(0,15)",36,0,108,I2CInt_writeData
203
 101               		.stabs	"address:P(0,11)",64,0,107,25
204
 102               		.stabs	"data:P(0,16)=*(0,11)",64,0,107,22
205
 103               		.stabs	"bytes:P(0,11)",64,0,107,20
206
 104               	.global	I2CInt_writeData
207
 105               		.type	I2CInt_writeData, @function
208
 106               	I2CInt_writeData:
209
 107               		.stabd	46,0,0
210
  91:I2CInterface.c **** }
211
  92:I2CInterface.c **** 
212
  93:I2CInterface.c **** /***********************************************************
213
  94:I2CInterface.c **** 	Function Name: I2CInt_writeData
214
  95:I2CInterface.c **** 	Function Description: This function is responsible for
215
  96:I2CInterface.c **** 	initiating the process of writing a sequence of bytes
216
  97:I2CInterface.c **** 	an I2C slave address.  This function will try to write
217
  98:I2CInterface.c **** 	the data three times before giving up.
218
  99:I2CInterface.c **** 	Inputs: address: the address of the I2C slave device
219
 100:I2CInterface.c **** 			data: a pointer to the data to be written 
220
 101:I2CInterface.c **** 				  to the slave...for camera interfacing,
221
 102:I2CInterface.c **** 				  the data follows a <register #><data>
222
 103:I2CInterface.c **** 				  format
223
 104:I2CInterface.c **** 			bytes: the number of bytes to write 
224
 105:I2CInterface.c **** 	Outputs: none
225
 106:I2CInterface.c **** ***********************************************************/
226
 107:I2CInterface.c **** void I2CInt_writeData(unsigned char address, unsigned char *data, unsigned char bytes)
227
 108:I2CInterface.c **** {
228
 108               		.stabn	68,0,108,.LM3-I2CInt_writeData
229
 109               	.LM3:
230
 110               	/* prologue: frame size=0 */
231
 111               	/* prologue end (size=0) */
232
 112 0008 982F      		mov r25,r24
233
 113               	.L5:
234
 109:I2CInterface.c **** 	while(status & (1<<BUSY));		/* Bus is busy wait (or exit with error code) */
235
 114               		.stabn	68,0,109,.LM4-I2CInt_writeData
236
 115               	.LM4:
237
 116 000a 8091 0000 		lds r24,status
238
 117 000e 8823      		tst r24
239
 118 0010 E4F3      		brlt .L5
240
 119               	.L9:
182 kaklik 241
GAS LISTING /tmp/ccZHfAgR.s 			page 5
174 kaklik 242
 
243
 
244
 110:I2CInterface.c **** 	while(TWCR & (1<<TWSTO));
245
 120               		.stabn	68,0,110,.LM5-I2CInt_writeData
246
 121               	.LM5:
247
 122 0012 06B6      		in __tmp_reg__,86-0x20
248
 123 0014 04FC      		sbrc __tmp_reg__,4
249
 124 0016 FDCF      		rjmp .L9
250
 111:I2CInterface.c **** 	
251
 112:I2CInterface.c **** 	/* copy the needed data and state info to our local I2C command structure */
252
 113:I2CInterface.c **** 	twi_address = address;
253
 125               		.stabn	68,0,113,.LM6-I2CInt_writeData
254
 126               	.LM6:
255
 127 0018 9093 0000 		sts twi_address,r25
256
 114:I2CInterface.c **** 	twi_data = data;
257
 128               		.stabn	68,0,114,.LM7-I2CInt_writeData
258
 129               	.LM7:
259
 130 001c 7093 0000 		sts (twi_data)+1,r23
260
 131 0020 6093 0000 		sts twi_data,r22
261
 115:I2CInterface.c **** 	twi_bytes = bytes;
262
 132               		.stabn	68,0,115,.LM8-I2CInt_writeData
263
 133               	.LM8:
264
 134 0024 4093 0000 		sts twi_bytes,r20
265
 116:I2CInterface.c **** 	twi_ddr = TW_WRITE;
266
 135               		.stabn	68,0,116,.LM9-I2CInt_writeData
267
 136               	.LM9:
268
 137 0028 1092 0000 		sts twi_ddr,__zero_reg__
269
 117:I2CInterface.c **** 
270
 118:I2CInterface.c **** 	retry_cnt = 0;
271
 138               		.stabn	68,0,118,.LM10-I2CInt_writeData
272
 139               	.LM10:
273
 140 002c 1092 0000 		sts retry_cnt,__zero_reg__
274
 119:I2CInterface.c **** 	
275
 120:I2CInterface.c **** 	/* Generate start condition, the remainder of the transfer is interrupt driven and
276
 121:I2CInterface.c **** 	   will be performed in the background */
277
 122:I2CInterface.c **** 	TWCR = (1<<TWINT)|(1<<TWSTA)|(1<<TWEN)|(1<<TWIE);
278
 141               		.stabn	68,0,122,.LM11-I2CInt_writeData
279
 142               	.LM11:
280
 143 0030 85EA      		ldi r24,lo8(-91)
281
 144 0032 86BF      		out 86-0x20,r24
282
 123:I2CInterface.c **** 	
283
 124:I2CInterface.c **** 	status |= (1<<BUSY);
284
 145               		.stabn	68,0,124,.LM12-I2CInt_writeData
285
 146               	.LM12:
286
 147 0034 8091 0000 		lds r24,status
287
 148 0038 8068      		ori r24,lo8(-128)
288
 149 003a 8093 0000 		sts status,r24
289
 150               	/* epilogue: frame size=0 */
290
 151 003e 0895      		ret
291
 152               	/* epilogue end (size=1) */
292
 153               	/* function I2CInt_writeData size 28 (27) */
293
 154               		.size	I2CInt_writeData, .-I2CInt_writeData
294
 155               	.Lscope1:
295
 156               		.stabs	"",36,0,0,.Lscope1-I2CInt_writeData
296
 157               		.stabd	78,0,0
297
 158               		.stabs	"I2CInt_readData:F(0,15)",36,0,138,I2CInt_readData
298
 159               		.stabs	"address:P(0,11)",64,0,137,25
299
 160               		.stabs	"data:P(0,16)",64,0,137,22
300
 161               		.stabs	"bytes:P(0,11)",64,0,137,20
182 kaklik 301
GAS LISTING /tmp/ccZHfAgR.s 			page 6
174 kaklik 302
 
303
 
304
 162               	.global	I2CInt_readData
305
 163               		.type	I2CInt_readData, @function
306
 164               	I2CInt_readData:
307
 165               		.stabd	46,0,0
308
 125:I2CInterface.c **** }
309
 126:I2CInterface.c **** 
310
 127:I2CInterface.c **** /***********************************************************
311
 128:I2CInterface.c **** 	Function Name: I2CInt_readData
312
 129:I2CInterface.c **** 	Function Description: This funcion is responsible for
313
 130:I2CInterface.c **** 	reading the specified number of bytes from a slave
314
 131:I2CInterface.c **** 	device.
315
 132:I2CInterface.c **** 	Inputs:  address: the slave address to read from
316
 133:I2CInterface.c **** 			 data: a pointer to where the data will be stored
317
 134:I2CInterface.c **** 			 bytes: the number of bytes to read
318
 135:I2CInterface.c **** 	Outputs: none
319
 136:I2CInterface.c **** ***********************************************************/
320
 137:I2CInterface.c **** void I2CInt_readData(unsigned char address, unsigned char *data, unsigned char bytes)
321
 138:I2CInterface.c **** {
322
 166               		.stabn	68,0,138,.LM13-I2CInt_readData
323
 167               	.LM13:
324
 168               	/* prologue: frame size=0 */
325
 169               	/* prologue end (size=0) */
326
 170 0040 982F      		mov r25,r24
327
 171               	.L15:
328
 139:I2CInterface.c ****     /* Bus is busy wait (or exit with error code) */
329
 140:I2CInterface.c **** 	while(status & (1<<BUSY));									
330
 172               		.stabn	68,0,140,.LM14-I2CInt_readData
331
 173               	.LM14:
332
 174 0042 8091 0000 		lds r24,status
333
 175 0046 8823      		tst r24
334
 176 0048 E4F3      		brlt .L15
335
 141:I2CInterface.c **** 
336
 142:I2CInterface.c **** 	twi_address = address;
337
 177               		.stabn	68,0,142,.LM15-I2CInt_readData
338
 178               	.LM15:
339
 179 004a 9093 0000 		sts twi_address,r25
340
 143:I2CInterface.c **** 	twi_data = data;
341
 180               		.stabn	68,0,143,.LM16-I2CInt_readData
342
 181               	.LM16:
343
 182 004e 7093 0000 		sts (twi_data)+1,r23
344
 183 0052 6093 0000 		sts twi_data,r22
345
 144:I2CInterface.c **** 	twi_bytes = bytes;
346
 184               		.stabn	68,0,144,.LM17-I2CInt_readData
347
 185               	.LM17:
348
 186 0056 4093 0000 		sts twi_bytes,r20
349
 145:I2CInterface.c **** 	twi_ddr = TW_READ;
350
 187               		.stabn	68,0,145,.LM18-I2CInt_readData
351
 188               	.LM18:
352
 189 005a 81E0      		ldi r24,lo8(1)
353
 190 005c 8093 0000 		sts twi_ddr,r24
354
 146:I2CInterface.c **** 
355
 147:I2CInterface.c **** 	retry_cnt = 0;
356
 191               		.stabn	68,0,147,.LM19-I2CInt_readData
357
 192               	.LM19:
358
 193 0060 1092 0000 		sts retry_cnt,__zero_reg__
359
 148:I2CInterface.c **** 	
360
 149:I2CInterface.c **** 	/* Generate start condition, the remainder of the transfer is interrupt driven and
182 kaklik 361
GAS LISTING /tmp/ccZHfAgR.s 			page 7
174 kaklik 362
 
363
 
364
 150:I2CInterface.c **** 	   will be performed in the background */
365
 151:I2CInterface.c **** 	TWCR = (1<<TWINT)|(1<<TWSTA)|(1<<TWEN)|(1<<TWIE);
366
 194               		.stabn	68,0,151,.LM20-I2CInt_readData
367
 195               	.LM20:
368
 196 0064 85EA      		ldi r24,lo8(-91)
369
 197 0066 86BF      		out 86-0x20,r24
370
 152:I2CInterface.c **** 	
371
 153:I2CInterface.c **** 	status |= (1<<BUSY);
372
 198               		.stabn	68,0,153,.LM21-I2CInt_readData
373
 199               	.LM21:
374
 200 0068 8091 0000 		lds r24,status
375
 201 006c 8068      		ori r24,lo8(-128)
376
 202 006e 8093 0000 		sts status,r24
377
 203               	/* epilogue: frame size=0 */
378
 204 0072 0895      		ret
379
 205               	/* epilogue end (size=1) */
380
 206               	/* function I2CInt_readData size 26 (25) */
381
 207               		.size	I2CInt_readData, .-I2CInt_readData
382
 208               	.Lscope2:
383
 209               		.stabs	"",36,0,0,.Lscope2-I2CInt_readData
384
 210               		.stabd	78,0,0
385
 211               		.stabs	"I2CInt_isI2cBusy:F(7,1)",36,0,166,I2CInt_isI2cBusy
386
 212               	.global	I2CInt_isI2cBusy
387
 213               		.type	I2CInt_isI2cBusy, @function
388
 214               	I2CInt_isI2cBusy:
389
 215               		.stabd	46,0,0
390
 154:I2CInterface.c **** }
391
 155:I2CInterface.c **** 
392
 156:I2CInterface.c **** /***********************************************************
393
 157:I2CInterface.c **** 	Function Name: I2CInt_isI2cBusy
394
 158:I2CInterface.c **** 	Function Description: This funcion is responsible for
395
 159:I2CInterface.c **** 	indicating if the I2C bus is currently busy to external
396
 160:I2CInterface.c **** 	modules.
397
 161:I2CInterface.c **** 	device.
398
 162:I2CInterface.c **** 	Inputs:  none
399
 163:I2CInterface.c **** 	Outputs: bool_t - indicating if bus is busy
400
 164:I2CInterface.c **** ***********************************************************/
401
 165:I2CInterface.c **** bool_t I2CInt_isI2cBusy(void)
402
 166:I2CInterface.c **** {
403
 216               		.stabn	68,0,166,.LM22-I2CInt_isI2cBusy
404
 217               	.LM22:
405
 218               	/* prologue: frame size=0 */
406
 219               	/* prologue end (size=0) */
407
 167:I2CInterface.c **** 	bool_t retVal = FALSE;
408
 168:I2CInterface.c **** 	if ( (status & (1<<BUSY)) != 0)
409
 220               		.stabn	68,0,168,.LM23-I2CInt_isI2cBusy
410
 221               	.LM23:
411
 222 0074 8091 0000 		lds r24,status
412
 223 0078 881F      		rol r24
413
 224 007a 8827      		clr r24
414
 225 007c 881F      		rol r24
415
 169:I2CInterface.c **** 	{
416
 170:I2CInterface.c **** 		retVal = TRUE;
417
 171:I2CInterface.c **** 	}
418
 172:I2CInterface.c **** 	
419
 173:I2CInterface.c **** 	return(retVal);
420
 174:I2CInterface.c **** }
182 kaklik 421
GAS LISTING /tmp/ccZHfAgR.s 			page 8
174 kaklik 422
 
423
 
424
 226               		.stabn	68,0,174,.LM24-I2CInt_isI2cBusy
425
 227               	.LM24:
426
 228 007e 9927      		clr r25
427
 229               	/* epilogue: frame size=0 */
428
 230 0080 0895      		ret
429
 231               	/* epilogue end (size=1) */
430
 232               	/* function I2CInt_isI2cBusy size 7 (6) */
431
 233               		.size	I2CInt_isI2cBusy, .-I2CInt_isI2cBusy
432
 234               	.Lscope3:
433
 235               		.stabs	"",36,0,0,.Lscope3-I2CInt_isI2cBusy
434
 236               		.stabd	78,0,0
435
 237               		.stabs	"__vector_17:F(0,15)",36,0,185,__vector_17
436
 238               	.global	__vector_17
437
 239               		.type	__vector_17, @function
438
 240               	__vector_17:
439
 241               		.stabd	46,0,0
440
 175:I2CInterface.c **** 
441
 176:I2CInterface.c **** /***********************************************************
442
 177:I2CInterface.c **** 	Function Name: <interrupt handler for I2C>
443
 178:I2CInterface.c **** 	Function Description: This function is responsible for
444
 179:I2CInterface.c **** 	implementing the control logic needed to perform a
445
 180:I2CInterface.c **** 	read or write operation with an I2C slave.
446
 181:I2CInterface.c **** 	Inputs:  none
447
 182:I2CInterface.c **** 	Outputs: none
448
 183:I2CInterface.c **** ***********************************************************/
449
 184:I2CInterface.c **** SIGNAL(SIG_2WIRE_SERIAL)
450
 185:I2CInterface.c **** {
451
 242               		.stabn	68,0,185,.LM25-__vector_17
452
 243               	.LM25:
453
 244               	/* prologue: frame size=0 */
454
 245 0082 1F92      		push __zero_reg__
455
 246 0084 0F92      		push __tmp_reg__
456
 247 0086 0FB6      		in __tmp_reg__,__SREG__
457
 248 0088 0F92      		push __tmp_reg__
458
 249 008a 1124      		clr __zero_reg__
459
 250 008c 8F93      		push r24
460
 251 008e 9F93      		push r25
461
 252 0090 AF93      		push r26
462
 253 0092 BF93      		push r27
463
 254 0094 EF93      		push r30
464
 255 0096 FF93      		push r31
465
 256               	/* prologue end (size=11) */
466
 186:I2CInterface.c **** 	unsigned char TWI_status = TWSR & TW_STATUS_MASK;   /* grab just the status bits */
467
 257               		.stabn	68,0,186,.LM26-__vector_17
468
 258               	.LM26:
469
 259 0098 81B1      		in r24,33-0x20
470
 187:I2CInterface.c **** 	
471
 188:I2CInterface.c ****     /* the entire I2C handler is state-based...determine
472
 189:I2CInterface.c ****     what needs to be done based on TWI_status */
473
 190:I2CInterface.c **** 	switch(TWI_status) 
474
 260               		.stabn	68,0,190,.LM27-__vector_17
475
 261               	.LM27:
476
 262 009a 9927      		clr r25
477
 263 009c AA27      		clr r26
478
 264 009e BB27      		clr r27
479
 265 00a0 887F      		andi r24,lo8(248)
480
 266 00a2 9070      		andi r25,hi8(248)
182 kaklik 481
GAS LISTING /tmp/ccZHfAgR.s 			page 9
174 kaklik 482
 
483
 
484
 267 00a4 A070      		andi r26,hlo8(248)
485
 268 00a6 B070      		andi r27,hhi8(248)
486
 269 00a8 FC01      		movw r30,r24
487
 270 00aa 3897      		sbiw r30,8
488
 271 00ac E135      		cpi r30,81
489
 272 00ae F105      		cpc r31,__zero_reg__
490
 273 00b0 08F0      		brlo .+2
491
 274 00b2 9AC0      		rjmp .L42
492
 275               		.stabn	68,0,190,.LM28-__vector_17
493
 276               	.LM28:
494
 277 00b4 E050      		subi r30,lo8(-(pm(.L33)))
495
 278 00b6 F040      		sbci r31,hi8(-(pm(.L33)))
496
 279 00b8 0994      		ijmp
497
 280               		.data
498
 281               		.section .progmem.gcc_sw_table, "ax", @progbits
499
 282               		.p2align 1
500
 283               	.L33:
501
 284               		.data
502
 285               		.section .progmem.gcc_sw_table, "ax", @progbits
503
 286               		.p2align 1
504
 287 0000 00C0      		rjmp .L25
505
 288 0002 00C0      		rjmp .L42
506
 289 0004 00C0      		rjmp .L42
507
 290 0006 00C0      		rjmp .L42
508
 291 0008 00C0      		rjmp .L42
509
 292 000a 00C0      		rjmp .L42
510
 293 000c 00C0      		rjmp .L42
511
 294 000e 00C0      		rjmp .L42
512
 295 0010 00C0      		rjmp .L25
513
 296 0012 00C0      		rjmp .L42
514
 297 0014 00C0      		rjmp .L42
515
 298 0016 00C0      		rjmp .L42
516
 299 0018 00C0      		rjmp .L42
517
 300 001a 00C0      		rjmp .L42
518
 301 001c 00C0      		rjmp .L42
519
 302 001e 00C0      		rjmp .L42
520
 303 0020 00C0      		rjmp .L26
521
 304 0022 00C0      		rjmp .L42
522
 305 0024 00C0      		rjmp .L42
523
 306 0026 00C0      		rjmp .L42
524
 307 0028 00C0      		rjmp .L42
525
 308 002a 00C0      		rjmp .L42
526
 309 002c 00C0      		rjmp .L42
527
 310 002e 00C0      		rjmp .L42
528
 311 0030 00C0      		rjmp .L27
529
 312 0032 00C0      		rjmp .L42
530
 313 0034 00C0      		rjmp .L42
531
 314 0036 00C0      		rjmp .L42
532
 315 0038 00C0      		rjmp .L42
533
 316 003a 00C0      		rjmp .L42
534
 317 003c 00C0      		rjmp .L42
535
 318 003e 00C0      		rjmp .L42
536
 319 0040 00C0      		rjmp .L28
537
 320 0042 00C0      		rjmp .L42
538
 321 0044 00C0      		rjmp .L42
539
 322 0046 00C0      		rjmp .L42
540
 323 0048 00C0      		rjmp .L42
182 kaklik 541
GAS LISTING /tmp/ccZHfAgR.s 			page 10
174 kaklik 542
 
543
 
544
 324 004a 00C0      		rjmp .L42
545
 325 004c 00C0      		rjmp .L42
546
 326 004e 00C0      		rjmp .L42
547
 327 0050 00C0      		rjmp .L29
548
 328 0052 00C0      		rjmp .L42
549
 329 0054 00C0      		rjmp .L42
550
 330 0056 00C0      		rjmp .L42
551
 331 0058 00C0      		rjmp .L42
552
 332 005a 00C0      		rjmp .L42
553
 333 005c 00C0      		rjmp .L42
554
 334 005e 00C0      		rjmp .L42
555
 335 0060 00C0      		rjmp .L42
556
 336 0062 00C0      		rjmp .L42
557
 337 0064 00C0      		rjmp .L42
558
 338 0066 00C0      		rjmp .L42
559
 339 0068 00C0      		rjmp .L42
560
 340 006a 00C0      		rjmp .L42
561
 341 006c 00C0      		rjmp .L42
562
 342 006e 00C0      		rjmp .L42
563
 343 0070 00C0      		rjmp .L30
564
 344 0072 00C0      		rjmp .L42
565
 345 0074 00C0      		rjmp .L42
566
 346 0076 00C0      		rjmp .L42
567
 347 0078 00C0      		rjmp .L42
568
 348 007a 00C0      		rjmp .L42
569
 349 007c 00C0      		rjmp .L42
570
 350 007e 00C0      		rjmp .L42
571
 351 0080 00C0      		rjmp .L27
572
 352 0082 00C0      		rjmp .L42
573
 353 0084 00C0      		rjmp .L42
574
 354 0086 00C0      		rjmp .L42
575
 355 0088 00C0      		rjmp .L42
576
 356 008a 00C0      		rjmp .L42
577
 357 008c 00C0      		rjmp .L42
578
 358 008e 00C0      		rjmp .L42
579
 359 0090 00C0      		rjmp .L31
580
 360 0092 00C0      		rjmp .L42
581
 361 0094 00C0      		rjmp .L42
582
 362 0096 00C0      		rjmp .L42
583
 363 0098 00C0      		rjmp .L42
584
 364 009a 00C0      		rjmp .L42
585
 365 009c 00C0      		rjmp .L42
586
 366 009e 00C0      		rjmp .L42
587
 367 00a0 00C0      		rjmp .L32
588
 368               		.text
589
 369               	.L25:
590
 191:I2CInterface.c ****     {
591
 192:I2CInterface.c ****         case TW_START:									/* Start condition */
592
 193:I2CInterface.c ****         case TW_REP_START:								/* Repeated start condition */
593
 194:I2CInterface.c ****             if(retry_cnt > MAX_TWI_RETRIES) 
594
 370               		.stabn	68,0,194,.LM29-__vector_17
595
 371               	.LM29:
596
 372 00ba 8091 0000 		lds r24,retry_cnt
597
 373 00be 8330      		cpi r24,lo8(3)
598
 374 00c0 48F0      		brlo .L34
599
 195:I2CInterface.c ****             {
600
 196:I2CInterface.c ****                 /* generate stop condition if we've reached our retry limit */
182 kaklik 601
GAS LISTING /tmp/ccZHfAgR.s 			page 11
174 kaklik 602
 
603
 
604
 197:I2CInterface.c ****                 TWCR |= (1<<TWINT)|(1<<TWSTO);					
605
 375               		.stabn	68,0,197,.LM30-__vector_17
606
 376               	.LM30:
607
 377 00c2 86B7      		in r24,86-0x20
608
 378 00c4 8069      		ori r24,lo8(-112)
609
 379 00c6 86BF      		out 86-0x20,r24
610
 198:I2CInterface.c ****                 status &= ~(1<<BUSY);								
611
 380               		.stabn	68,0,198,.LM31-__vector_17
612
 381               	.LM31:
613
 382 00c8 8091 0000 		lds r24,status
614
 383 00cc 8F77      		andi r24,lo8(127)
615
 384 00ce 8093 0000 		sts status,r24
616
 385 00d2 8AC0      		rjmp .L42
617
 386               	.L34:
618
 199:I2CInterface.c ****                 return;												
619
 200:I2CInterface.c ****             }
620
 201:I2CInterface.c ****             /* indicate read or write */
621
 202:I2CInterface.c ****             TWDR = (twi_address<<1) + twi_ddr;	
622
 387               		.stabn	68,0,202,.LM32-__vector_17
623
 388               	.LM32:
624
 389 00d4 8091 0000 		lds r24,twi_address
625
 390 00d8 9091 0000 		lds r25,twi_ddr
626
 391 00dc 880F      		lsl r24
627
 392 00de 890F      		add r24,r25
628
 393 00e0 83B9      		out 35-0x20,r24
629
 203:I2CInterface.c ****             /* TWSTA must be cleared...also clears TWINT */
630
 204:I2CInterface.c ****             TWCR &= ~(1<<TWSTA);
631
 394               		.stabn	68,0,204,.LM33-__vector_17
632
 395               	.LM33:
633
 396 00e2 86B7      		in r24,86-0x20
634
 397 00e4 8F7D      		andi r24,lo8(-33)
635
 398 00e6 86BF      		out 86-0x20,r24
636
 399 00e8 7FC0      		rjmp .L42
637
 400               	.L26:
638
 205:I2CInterface.c ****             break;
639
 206:I2CInterface.c **** 
640
 207:I2CInterface.c ****         case TW_MT_SLA_ACK:							/* Slave acknowledged address, */
641
 208:I2CInterface.c ****             retry_cnt = 0;					
642
 401               		.stabn	68,0,208,.LM34-__vector_17
643
 402               	.LM34:
644
 403 00ea 1092 0000 		sts retry_cnt,__zero_reg__
645
 209:I2CInterface.c ****             /* tx the data, and increment the data pointer */
646
 210:I2CInterface.c ****             TWDR = *twi_data;										
647
 404               		.stabn	68,0,210,.LM35-__vector_17
648
 405               	.LM35:
649
 406 00ee E091 0000 		lds r30,twi_data
650
 407 00f2 F091 0000 		lds r31,(twi_data)+1
651
 408 00f6 8081      		ld r24,Z
652
 409 00f8 83B9      		out 35-0x20,r24
653
 211:I2CInterface.c ****             twi_data++;			
654
 410               		.stabn	68,0,211,.LM36-__vector_17
655
 411               	.LM36:
656
 412 00fa 3196      		adiw r30,1
657
 413 00fc F093 0000 		sts (twi_data)+1,r31
658
 414 0100 E093 0000 		sts twi_data,r30
659
 212:I2CInterface.c **** 
660
 213:I2CInterface.c ****             /* clear the int to continue */
182 kaklik 661
GAS LISTING /tmp/ccZHfAgR.s 			page 12
174 kaklik 662
 
663
 
664
 214:I2CInterface.c ****             TWCR |= (1<<TWINT);						
665
 415               		.stabn	68,0,214,.LM37-__vector_17
666
 416               	.LM37:
667
 417 0104 86B7      		in r24,86-0x20
668
 418 0106 8068      		ori r24,lo8(-128)
669
 419 0108 86BF      		out 86-0x20,r24
670
 420 010a 6EC0      		rjmp .L42
671
 421               	.L27:
672
 215:I2CInterface.c ****             break;
673
 216:I2CInterface.c **** 
674
 217:I2CInterface.c ****         case TW_MT_SLA_NACK:							/* Slave didn't acknowledge address, */
675
 218:I2CInterface.c ****         case TW_MR_SLA_NACK:
676
 219:I2CInterface.c ****             retry_cnt++;		
677
 422               		.stabn	68,0,219,.LM38-__vector_17
678
 423               	.LM38:
679
 424 010c 8091 0000 		lds r24,retry_cnt
680
 425 0110 8F5F      		subi r24,lo8(-(1))
681
 426 0112 8093 0000 		sts retry_cnt,r24
682
 220:I2CInterface.c **** 
683
 221:I2CInterface.c ****             /* retry...*/
684
 222:I2CInterface.c ****             TWCR |= (1<<TWINT)|(1<<TWSTA)|(1<<TWSTO);	
685
 427               		.stabn	68,0,222,.LM39-__vector_17
686
 428               	.LM39:
687
 429 0116 86B7      		in r24,86-0x20
688
 430 0118 806B      		ori r24,lo8(-80)
689
 431 011a 86BF      		out 86-0x20,r24
690
 432 011c 65C0      		rjmp .L42
691
 433               	.L28:
692
 223:I2CInterface.c ****             break;
693
 224:I2CInterface.c **** 
694
 225:I2CInterface.c ****         case TW_MT_DATA_ACK:							/* Slave Acknowledged data, */
695
 226:I2CInterface.c ****             if(--twi_bytes > 0) 
696
 434               		.stabn	68,0,226,.LM40-__vector_17
697
 435               	.LM40:
698
 436 011e 8091 0000 		lds r24,twi_bytes
699
 437 0122 8150      		subi r24,lo8(-(-1))
700
 438 0124 8093 0000 		sts twi_bytes,r24
701
 439 0128 8091 0000 		lds r24,twi_bytes
702
 440 012c 8823      		tst r24
703
 441 012e 79F0      		breq .L36
704
 227:I2CInterface.c ****             {						
705
 228:I2CInterface.c ****                 /* more data to send, so send it */
706
 229:I2CInterface.c ****                 TWDR = *twi_data;									
707
 442               		.stabn	68,0,229,.LM41-__vector_17
708
 443               	.LM41:
709
 444 0130 E091 0000 		lds r30,twi_data
710
 445 0134 F091 0000 		lds r31,(twi_data)+1
711
 446 0138 8081      		ld r24,Z
712
 447 013a 83B9      		out 35-0x20,r24
713
 230:I2CInterface.c ****                 twi_data++;											
714
 448               		.stabn	68,0,230,.LM42-__vector_17
715
 449               	.LM42:
716
 450 013c 3196      		adiw r30,1
717
 451 013e F093 0000 		sts (twi_data)+1,r31
718
 452 0142 E093 0000 		sts twi_data,r30
719
 231:I2CInterface.c ****                 TWCR |= (1<<TWINT);								
720
 453               		.stabn	68,0,231,.LM43-__vector_17
182 kaklik 721
GAS LISTING /tmp/ccZHfAgR.s 			page 13
174 kaklik 722
 
723
 
724
 454               	.LM43:
725
 455 0146 86B7      		in r24,86-0x20
726
 456 0148 8068      		ori r24,lo8(-128)
727
 457 014a 86BF      		out 86-0x20,r24
728
 458 014c 4DC0      		rjmp .L42
729
 459               	.L36:
730
 232:I2CInterface.c ****             }
731
 233:I2CInterface.c ****             else 
732
 234:I2CInterface.c ****             {
733
 235:I2CInterface.c ****                 /* generate the stop condition if needed */
734
 236:I2CInterface.c ****                 TWCR |= (1<<TWSTO)|(1<<TWINT);					
735
 460               		.stabn	68,0,236,.LM44-__vector_17
736
 461               	.LM44:
737
 462 014e 86B7      		in r24,86-0x20
738
 463 0150 8069      		ori r24,lo8(-112)
739
 464 0152 86BF      		out 86-0x20,r24
740
 237:I2CInterface.c ****                 status &= ~(1<<BUSY);								
741
 465               		.stabn	68,0,237,.LM45-__vector_17
742
 466               	.LM45:
743
 467 0154 8091 0000 		lds r24,status
744
 468 0158 8F77      		andi r24,lo8(127)
745
 469 015a 8093 0000 		sts status,r24
746
 470 015e 44C0      		rjmp .L42
747
 471               	.L29:
748
 238:I2CInterface.c ****             }
749
 239:I2CInterface.c ****             break;
750
 240:I2CInterface.c **** 
751
 241:I2CInterface.c ****         case TW_MT_DATA_NACK:							/* Slave didn't acknowledge data */
752
 242:I2CInterface.c ****             /* send the stop condition */
753
 243:I2CInterface.c ****             TWCR |= (1<<TWINT)|(1<<TWSTO);						
754
 472               		.stabn	68,0,243,.LM46-__vector_17
755
 473               	.LM46:
756
 474 0160 86B7      		in r24,86-0x20
757
 475 0162 8069      		ori r24,lo8(-112)
758
 476 0164 86BF      		out 86-0x20,r24
759
 244:I2CInterface.c ****             status &= ~(1<<BUSY);									
760
 477               		.stabn	68,0,244,.LM47-__vector_17
761
 478               	.LM47:
762
 479 0166 8091 0000 		lds r24,status
763
 480 016a 8F77      		andi r24,lo8(127)
764
 481 016c 8093 0000 		sts status,r24
765
 482 0170 3BC0      		rjmp .L42
766
 483               	.L30:
767
 245:I2CInterface.c ****             break;
768
 246:I2CInterface.c **** 
769
 247:I2CInterface.c ****         case TW_MR_SLA_ACK:                             /* Slave acknowledged address */
770
 248:I2CInterface.c ****             if(--twi_bytes > 0) 
771
 484               		.stabn	68,0,248,.LM48-__vector_17
772
 485               	.LM48:
773
 486 0172 8091 0000 		lds r24,twi_bytes
774
 487 0176 8150      		subi r24,lo8(-(-1))
775
 488 0178 8093 0000 		sts twi_bytes,r24
776
 489 017c 8091 0000 		lds r24,twi_bytes
777
 490 0180 8823      		tst r24
778
 491 0182 21F0      		breq .L38
779
 249:I2CInterface.c ****             {
780
 250:I2CInterface.c ****                 /* if there is more than one byte to read, acknowledge */
182 kaklik 781
GAS LISTING /tmp/ccZHfAgR.s 			page 14
174 kaklik 782
 
783
 
784
 251:I2CInterface.c ****                 TWCR |= (1<<TWEA)|(1<<TWINT);	
785
 492               		.stabn	68,0,251,.LM49-__vector_17
786
 493               	.LM49:
787
 494 0184 86B7      		in r24,86-0x20
788
 495 0186 806C      		ori r24,lo8(-64)
789
 496 0188 86BF      		out 86-0x20,r24
790
 497 018a 2EC0      		rjmp .L42
791
 498               	.L38:
792
 252:I2CInterface.c ****             }
793
 253:I2CInterface.c **** 			else
794
 254:I2CInterface.c ****             {
795
 255:I2CInterface.c ****                 /* no acknowledge */
796
 256:I2CInterface.c ****                 TWCR |= (1<<TWINT);					
797
 499               		.stabn	68,0,256,.LM50-__vector_17
798
 500               	.LM50:
799
 501 018c 86B7      		in r24,86-0x20
800
 502 018e 8068      		ori r24,lo8(-128)
801
 503 0190 86BF      		out 86-0x20,r24
802
 504 0192 2AC0      		rjmp .L42
803
 505               	.L31:
804
 257:I2CInterface.c ****             }
805
 258:I2CInterface.c ****             break;
806
 259:I2CInterface.c **** 
807
 260:I2CInterface.c ****         case TW_MR_DATA_ACK: 							/* Master acknowledged data */
808
 261:I2CInterface.c ****         
809
 262:I2CInterface.c ****             /* grab the received data */
810
 263:I2CInterface.c ****             *twi_data = TWDR;										
811
 506               		.stabn	68,0,263,.LM51-__vector_17
812
 507               	.LM51:
813
 508 0194 E091 0000 		lds r30,twi_data
814
 509 0198 F091 0000 		lds r31,(twi_data)+1
815
 510 019c 83B1      		in r24,35-0x20
816
 511 019e 8083      		st Z,r24
817
 264:I2CInterface.c ****             twi_data++;											
818
 512               		.stabn	68,0,264,.LM52-__vector_17
819
 513               	.LM52:
820
 514 01a0 3196      		adiw r30,1
821
 515 01a2 F093 0000 		sts (twi_data)+1,r31
822
 516 01a6 E093 0000 		sts twi_data,r30
823
 265:I2CInterface.c ****             if(--twi_bytes > 0) 
824
 517               		.stabn	68,0,265,.LM53-__vector_17
825
 518               	.LM53:
826
 519 01aa 8091 0000 		lds r24,twi_bytes
827
 520 01ae 8150      		subi r24,lo8(-(-1))
828
 521 01b0 8093 0000 		sts twi_bytes,r24
829
 522 01b4 8091 0000 		lds r24,twi_bytes
830
 523 01b8 8823      		tst r24
831
 524 01ba 21F0      		breq .L40
832
 266:I2CInterface.c ****             {
833
 267:I2CInterface.c ****                 /* get the next data byte and ack */
834
 268:I2CInterface.c ****                 TWCR |= (1<<TWEA)|(1<<TWINT);	
835
 525               		.stabn	68,0,268,.LM54-__vector_17
836
 526               	.LM54:
837
 527 01bc 86B7      		in r24,86-0x20
838
 528 01be 806C      		ori r24,lo8(-64)
839
 529 01c0 86BF      		out 86-0x20,r24
840
 530 01c2 12C0      		rjmp .L42
182 kaklik 841
GAS LISTING /tmp/ccZHfAgR.s 			page 15
174 kaklik 842
 
843
 
844
 531               	.L40:
845
 269:I2CInterface.c ****             }
846
 270:I2CInterface.c ****             else
847
 271:I2CInterface.c ****             {
848
 272:I2CInterface.c ****                 /* clear out the enable acknowledge bit */
849
 273:I2CInterface.c ****                 TWCR &= ~(1<<TWEA);							
850
 532               		.stabn	68,0,273,.LM55-__vector_17
851
 533               	.LM55:
852
 534 01c4 86B7      		in r24,86-0x20
853
 535 01c6 8F7B      		andi r24,lo8(-65)
854
 536 01c8 86BF      		out 86-0x20,r24
855
 537 01ca 0EC0      		rjmp .L42
856
 538               	.L32:
857
 274:I2CInterface.c ****             }
858
 275:I2CInterface.c ****             break;
859
 276:I2CInterface.c **** 
860
 277:I2CInterface.c ****         case TW_MR_DATA_NACK:						/* Master didn't acknowledge data -> end of read process */
861
 278:I2CInterface.c ****             /* read data, and generate the stop condition */
862
 279:I2CInterface.c ****             *twi_data = TWDR;										
863
 539               		.stabn	68,0,279,.LM56-__vector_17
864
 540               	.LM56:
865
 541 01cc E091 0000 		lds r30,twi_data
866
 542 01d0 F091 0000 		lds r31,(twi_data)+1
867
 543 01d4 83B1      		in r24,35-0x20
868
 544 01d6 8083      		st Z,r24
869
 280:I2CInterface.c ****             TWCR |= (1<<TWSTO)|(1<<TWINT); 						
870
 545               		.stabn	68,0,280,.LM57-__vector_17
871
 546               	.LM57:
872
 547 01d8 86B7      		in r24,86-0x20
873
 548 01da 8069      		ori r24,lo8(-112)
874
 549 01dc 86BF      		out 86-0x20,r24
875
 281:I2CInterface.c ****             status &= ~(1<<BUSY);											
876
 550               		.stabn	68,0,281,.LM58-__vector_17
877
 551               	.LM58:
878
 552 01de 8091 0000 		lds r24,status
879
 553 01e2 8F77      		andi r24,lo8(127)
880
 554 01e4 8093 0000 		sts status,r24
881
 555               	.L42:
882
 556               	/* epilogue: frame size=0 */
883
 557 01e8 FF91      		pop r31
884
 558 01ea EF91      		pop r30
885
 559 01ec BF91      		pop r27
886
 560 01ee AF91      		pop r26
887
 561 01f0 9F91      		pop r25
888
 562 01f2 8F91      		pop r24
889
 563 01f4 0F90      		pop __tmp_reg__
890
 564 01f6 0FBE      		out __SREG__,__tmp_reg__
891
 565 01f8 0F90      		pop __tmp_reg__
892
 566 01fa 1F90      		pop __zero_reg__
893
 567 01fc 1895      		reti
894
 568               	/* epilogue end (size=11) */
895
 569               	/* function __vector_17 size 271 (249) */
896
 570               		.size	__vector_17, .-__vector_17
897
 571               	.Lscope4:
898
 572               		.stabs	"",36,0,0,.Lscope4-__vector_17
899
 573               		.stabd	78,0,0
900
 574               		.lcomm twi_address,1
182 kaklik 901
GAS LISTING /tmp/ccZHfAgR.s 			page 16
174 kaklik 902
 
903
 
904
 575               		.lcomm twi_data,2
905
 576               		.lcomm twi_ddr,1
906
 577               		.lcomm twi_bytes,1
907
 578               		.lcomm status,1
908
 579               		.lcomm retry_cnt,1
909
 580               		.stabs	"twi_address:S(0,17)=B(0,11)",40,0,59,twi_address
910
 581               		.stabs	"twi_data:S(0,18)=*(0,17)",40,0,60,twi_data
911
 582               		.stabs	"twi_ddr:S(0,17)",40,0,61,twi_ddr
912
 583               		.stabs	"twi_bytes:S(0,17)",40,0,62,twi_bytes
913
 584               		.stabs	"status:S(0,17)",40,0,63,status
914
 585               		.stabs	"retry_cnt:S(0,17)",40,0,64,retry_cnt
915
 586               		.stabs	"",100,0,0,.Letext0
916
 587               	.Letext0:
917
 588               	/* File "I2CInterface.c": code  336 = 0x0150 ( 310), prologues  11, epilogues  15 */
182 kaklik 918
GAS LISTING /tmp/ccZHfAgR.s 			page 17
174 kaklik 919
 
920
 
921
DEFINED SYMBOLS
922
                            *ABS*:00000000 I2CInterface.c
182 kaklik 923
     /tmp/ccZHfAgR.s:3      *ABS*:0000003f __SREG__
924
     /tmp/ccZHfAgR.s:4      *ABS*:0000003e __SP_H__
925
     /tmp/ccZHfAgR.s:5      *ABS*:0000003d __SP_L__
926
     /tmp/ccZHfAgR.s:6      *ABS*:00000000 __tmp_reg__
927
     /tmp/ccZHfAgR.s:7      *ABS*:00000001 __zero_reg__
928
     /tmp/ccZHfAgR.s:79     .text:00000000 I2CInt_init
929
     /tmp/ccZHfAgR.s:106    .text:00000008 I2CInt_writeData
930
     /tmp/ccZHfAgR.s:577    .bss:00000005 status
174 kaklik 931
                             .bss:00000000 twi_address
182 kaklik 932
     /tmp/ccZHfAgR.s:574    .bss:00000001 twi_data
933
     /tmp/ccZHfAgR.s:576    .bss:00000004 twi_bytes
934
     /tmp/ccZHfAgR.s:575    .bss:00000003 twi_ddr
935
     /tmp/ccZHfAgR.s:578    .bss:00000006 retry_cnt
936
     /tmp/ccZHfAgR.s:164    .text:00000040 I2CInt_readData
937
     /tmp/ccZHfAgR.s:214    .text:00000074 I2CInt_isI2cBusy
938
     /tmp/ccZHfAgR.s:240    .text:00000082 __vector_17
174 kaklik 939
 
940
UNDEFINED SYMBOLS
941
__do_copy_data
942
__do_clear_bss