📄 i2cinterface.lst
字号:
271 00d8 8834 cpi r24,72
272 00da 9105 cpc r25,__zero_reg__
273 00dc 09F4 brne .+2
274 00de 48C0 rjmp .L22
275 00e0 8934 cpi r24,73
276 00e2 9105 cpc r25,__zero_reg__
277 00e4 4CF4 brge .L36
278 00e6 8033 cpi r24,48
279 00e8 9105 cpc r25,__zero_reg__
280 00ea 09F4 brne .+2
281 00ec 73C0 rjmp .L26
282 00ee 8034 cpi r24,64
283 00f0 9105 cpc r25,__zero_reg__
284 00f2 09F4 brne .+2
285 00f4 7AC0 rjmp .L27
286 00f6 C4C0 rjmp .L15
287 .L36:
288 00f8 8035 cpi r24,80
289 00fa 9105 cpc r25,__zero_reg__
290 00fc 09F4 brne .+2
291 00fe 8AC0 rjmp .L30
292 0100 8835 cpi r24,88
293 0102 9105 cpc r25,__zero_reg__
294 0104 09F4 brne .+2
295 0106 ABC0 rjmp .L33
296 0108 BBC0 rjmp .L15
297 .L18:
167:I2CInterface.c **** {
168:I2CInterface.c **** case TW_START: /* Start condition */
169:I2CInterface.c **** case TW_REP_START: /* Repeated start condition */
170:I2CInterface.c **** if(retry_cnt > MAX_TWI_RETRIES)
299 .LM32:
300 010a 8091 0000 lds r24,retry_cnt
301 010e 8330 cpi r24,lo8(3)
302 0110 58F0 brlo .L19
171:I2CInterface.c **** {
172:I2CInterface.c **** /* generate stop condition if we've reached our retry limit */
173:I2CInterface.c **** TWCR |= (1<<TWINT)|(1<<TWSTO);
304 .LM33:
305 0112 8091 7400 lds r24,116
306 0116 8069 ori r24,lo8(-112)
307 0118 8093 7400 sts 116,r24
174:I2CInterface.c **** status &= ~(1<<BUSY);
309 .LM34:
310 011c 8091 0000 lds r24,status
311 0120 8F77 andi r24,lo8(127)
312 0122 8093 0000 sts status,r24
175:I2CInterface.c **** return;
314 .LM35:
315 0126 ACC0 rjmp .L15
316 .L19:
176:I2CInterface.c **** }
177:I2CInterface.c **** /* indicate read or write */
178:I2CInterface.c **** TWDR = (twi_address<<1) + twi_ddr;
318 .LM36:
319 0128 8091 0000 lds r24,twi_address
320 012c 982F mov r25,r24
321 012e 990F lsl r25
322 0130 8091 0000 lds r24,twi_ddr
323 0134 890F add r24,r25
324 0136 8093 7300 sts 115,r24
179:I2CInterface.c **** /* TWSTA must be cleared...also clears TWINT */
180:I2CInterface.c **** TWCR &= ~(1<<TWSTA);
326 .LM37:
327 013a 8091 7400 lds r24,116
328 013e 8F7D andi r24,lo8(-33)
329 0140 8093 7400 sts 116,r24
181:I2CInterface.c **** break;
331 .LM38:
332 0144 9DC0 rjmp .L15
333 .L20:
182:I2CInterface.c ****
183:I2CInterface.c **** case TW_MT_SLA_ACK: /* Slave acknowledged address, */
184:I2CInterface.c **** retry_cnt = 0;
335 .LM39:
336 0146 1092 0000 sts retry_cnt,__zero_reg__
185:I2CInterface.c **** /* tx the data, and increment the data pointer */
186:I2CInterface.c **** TWDR = *twi_data;
338 .LM40:
339 014a E091 0000 lds r30,twi_data
340 014e F091 0000 lds r31,(twi_data)+1
341 0152 8081 ld r24,Z
342 0154 8093 7300 sts 115,r24
187:I2CInterface.c **** twi_data++;
344 .LM41:
345 0158 CF01 movw r24,r30
346 015a 0196 adiw r24,1
347 015c 9093 0000 sts (twi_data)+1,r25
348 0160 8093 0000 sts twi_data,r24
188:I2CInterface.c ****
189:I2CInterface.c **** /* clear the int to continue */
190:I2CInterface.c **** TWCR |= (1<<TWINT);
350 .LM42:
351 0164 8091 7400 lds r24,116
352 0168 8068 ori r24,lo8(-128)
353 016a 8093 7400 sts 116,r24
191:I2CInterface.c **** break;
355 .LM43:
356 016e 88C0 rjmp .L15
357 .L22:
192:I2CInterface.c ****
193:I2CInterface.c **** case TW_MT_SLA_NACK: /* Slave didn't acknowledge address, */
194:I2CInterface.c **** case TW_MR_SLA_NACK:
195:I2CInterface.c **** retry_cnt++;
359 .LM44:
360 0170 8091 0000 lds r24,retry_cnt
361 0174 8F5F subi r24,lo8(-(1))
362 0176 8093 0000 sts retry_cnt,r24
196:I2CInterface.c ****
197:I2CInterface.c **** /* retry...*/
198:I2CInterface.c **** TWCR |= (1<<TWINT)|(1<<TWSTA)|(1<<TWSTO);
364 .LM45:
365 017a 8091 7400 lds r24,116
366 017e 806B ori r24,lo8(-80)
367 0180 8093 7400 sts 116,r24
199:I2CInterface.c **** break;
369 .LM46:
370 0184 7DC0 rjmp .L15
371 .L23:
200:I2CInterface.c ****
201:I2CInterface.c **** case TW_MT_DATA_ACK: /* Slave Acknowledged data, */
202:I2CInterface.c **** if(--twi_bytes > 0)
373 .LM47:
374 0186 8091 0000 lds r24,twi_bytes
375 018a 8150 subi r24,lo8(-(-1))
376 018c 8093 0000 sts twi_bytes,r24
377 0190 8091 0000 lds r24,twi_bytes
378 0194 8823 tst r24
379 0196 99F0 breq .L24
203:I2CInterface.c **** {
204:I2CInterface.c **** /* more data to send, so send it */
205:I2CInterface.c **** TWDR = *twi_data;
381 .LM48:
382 0198 E091 0000 lds r30,twi_data
383 019c F091 0000 lds r31,(twi_data)+1
384 01a0 8081 ld r24,Z
385 01a2 8093 7300 sts 115,r24
206:I2CInterface.c **** twi_data++;
387 .LM49:
388 01a6 CF01 movw r24,r30
389 01a8 0196 adiw r24,1
390 01aa 9093 0000 sts (twi_data)+1,r25
391 01ae 8093 0000 sts twi_data,r24
207:I2CInterface.c **** TWCR |= (1<<TWINT);
393 .LM50:
394 01b2 8091 7400 lds r24,116
395 01b6 8068 ori r24,lo8(-128)
396 01b8 8093 7400 sts 116,r24
397 01bc 61C0 rjmp .L15
398 .L24:
208:I2CInterface.c **** }
209:I2CInterface.c **** else
210:I2CInterface.c **** {
211:I2CInterface.c **** /* generate the stop condition if needed */
212:I2CInterface.c **** TWCR |= (1<<TWSTO)|(1<<TWINT);
400 .LM51:
401 01be 8091 7400 lds r24,116
402 01c2 8069 ori r24,lo8(-112)
403 01c4 8093 7400 sts 116,r24
213:I2CInterface.c **** status &= ~(1<<BUSY);
405 .LM52:
406 01c8 8091 0000 lds r24,status
407 01cc 8F77 andi r24,lo8(127)
408 01ce 8093 0000 sts status,r24
214:I2CInterface.c **** }
215:I2CInterface.c **** break;
410 .LM53:
411 01d2 56C0 rjmp .L15
412 .L26:
216:I2CInterface.c ****
217:I2CInterface.c **** case TW_MT_DATA_NACK: /* Slave didn't acknowledge data */
218:I2CInterface.c **** /* send the stop condition */
219:I2CInterface.c **** TWCR |= (1<<TWINT)|(1<<TWSTO);
414 .LM54:
415 01d4 8091 7400 lds r24,116
416 01d8 8069 ori r24,lo8(-112)
417 01da 8093 7400 sts 116,r24
220:I2CInterface.c **** status &= ~(1<<BUSY);
419 .LM55:
420 01de 8091 0000 lds r24,status
421 01e2 8F77 andi r24,lo8(127)
422 01e4 8093 0000 sts status,r24
221:I2CInterface.c **** break;
424 .LM56:
425 01e8 4BC0 rjmp .L15
426 .L27:
222:I2CInterface.c ****
223:I2CInterface.c **** case TW_MR_SLA_ACK: /* Slave acknowledged address */
224:I2CInterface.c **** if(--twi_bytes > 0)
428 .LM57:
429 01ea 8091 0000 lds r24,twi_bytes
430 01ee 8150 subi r24,lo8(-(-1))
431 01f0 8093 0000 sts twi_bytes,r24
432 01f4 8091 0000 lds r24,twi_bytes
433 01f8 8823 tst r24
434 01fa 31F0 breq .L28
225:I2CInterface.c **** {
226:I2CInterface.c **** /* if there is more than one byte to read, acknowledge */
227:I2CInterface.c **** TWCR |= (1<<TWEA)|(1<<TWINT);
436 .LM58:
437 01fc 8091 7400 lds r24,116
438 0200 806C ori r24,lo8(-64)
439 0202 8093 7400 sts 116,r24
440 0206 3CC0 rjmp .L15
441 .L28:
228:I2CInterface.c **** }
229:I2CInterface.c **** else
230:I2CInterface.c **** {
231:I2CInterface.c **** /* no acknowledge */
232:I2CInterface.c **** TWCR |= (1<<TWINT);
443 .LM59:
444 0208 8091 7400 lds r24,116
445 020c 8068 ori r24,lo8(-128)
446 020e 8093 7400 sts 116,r24
233:I2CInterface.c **** }
234:I2CInterface.c **** break;
448 .LM60:
449 0212 36C0 rjmp .L15
450 .L30:
235:I2CInterface.c ****
236:I2CInterface.c **** case TW_MR_DATA_ACK: /* Master acknowledged data */
237:I2CInterface.c ****
238:I2CInterface.c **** /* grab the received data */
239:I2CInterface.c **** *twi_data = TWDR;
452 .LM61:
453 0214 E091 0000 lds r30,twi_data
454 0218 F091 0000 lds r31,(twi_data)+1
455 021c 8091 7300 lds r24,115
456 0220 8083 st Z,r24
240:I2CInterface.c **** twi_data++;
458 .LM62:
459 0222 8091 0000 lds r24,twi_data
460 0226 9091 0000 lds r25,(twi_data)+1
461 022a 0196 adiw r24,1
462 022c 9093 0000 sts (twi_data)+1,r25
463 0230 8093 0000 sts twi_data,r24
241:I2CInterface.c **** if(--twi_bytes > 0)
465 .LM63:
466 0234 8091 0000 lds r24,twi_bytes
467 0238 8150 subi r24,lo8(-(-1))
468 023a 8093 0000 sts twi_bytes,r24
469 023e 8091 0000 lds r24,twi_bytes
470 0242 8823 tst r24
471 0244 31F0 breq .L31
242:I2CInterface.c **** {
243:I2CInterface.c **** /* get the next data byte and ack */
244:I2CInterface.c **** TWCR |= (1<<TWEA)|(1<<TWINT);
473 .LM64:
474 0246 8091 7400 lds r24,116
475 024a 806C ori r24,lo8(-64)
476 024c 8093 7400 sts 116,r24
477 0250 17C0 rjmp .L15
478 .L31:
245:I2CInterface.c **** }
246:I2CInterface.c **** else
247:I2CInterface.c **** {
248:I2CInterface.c **** /* clear out the enable acknowledge bit */
249:I2CInterface.c **** TWCR &= ~(1<<TWEA);
480 .LM65:
481 0252 8091 7400 lds r24,116
482 0256 8F7B andi r24,lo8(-65)
483 0258 8093 7400 sts 116,r24
250:I2CInterface.c **** }
251:I2CInterface.c **** break;
485 .LM66:
486 025c 11C0 rjmp .L15
487 .L33:
252:I2CInterface.c ****
253:I2CInterface.c **** case TW_MR_DATA_NACK: /* Master didn't acknowledge data -> end of read process */
254:I2CInterface.c **** /* read data, and generate the stop condition */
255:I2CInterface.c **** *twi_data = TWDR;
489 .LM67:
490 025e E091 0000 lds r30,twi_data
491 0262 F091 0000 lds r31,(twi_data)+1
492 0266 8091 7300 lds r24,115
493 026a 8083 st Z,r24
256:I2CInterface.c **** TWCR |= (1<<TWSTO)|(1<<TWINT);
495 .LM68:
496 026c 8091 7400 lds r24,116
497 0270 8069 ori r24,lo8(-112)
498 0272 8093 7400 sts 116,r24
257:I2CInterface.c **** status &= ~(1<<BUSY);
500 .LM69:
501 0276 8091 0000 lds r24,status
502 027a 8F77 andi r24,lo8(127)
503 027c 8093 0000 sts status,r24
504 .L15:
505 /* epilogue: frame size=0 */
506 0280 FF91 pop r31
507 0282 EF91 pop r30
508 0284 9F91 pop r25
509 0286 8F91 pop r24
510 0288 0F90 pop __tmp_reg__
511 028a 0FBE out __SREG__,__tmp_reg__
512 028c 0F90 pop __tmp_reg__
513 028e 1F90 pop __zero_reg__
514 0290 1895 reti
515 /* epilogue end (size=9) */
516 /* function __vector_33 size 259 (241) */
521 .Lscope4:
522 .lcomm twi_address,1
523 .lcomm twi_data,2
524 .lcomm twi_ddr,1
525 .lcomm twi_bytes,1
526 .lcomm status,1
527 .lcomm retry_cnt,1
534 .text
536 Letext:
537 /* File "I2CInterface.c": code 333 = 0x014d ( 311), prologues 9, epilogues 13 */
DEFINED SYMBOLS
*ABS*:00000000 I2CInterface.c
*ABS*:0000003f __SREG__
*ABS*:0000003e __SP_H__
*ABS*:0000003d __SP_L__
*ABS*:00000000 __tmp_reg__
*ABS*:00000001 __zero_reg__
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/cciSaaaa.s:64 .text:00000000 I2CInt_init
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/cciSaaaa.s:88 .text:0000000c I2CInt_writeData
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/cciSaaaa.s:525 .bss:00000005 status
.bss:00000000 twi_address
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/cciSaaaa.s:522 .bss:00000001 twi_data
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/cciSaaaa.s:524 .bss:00000004 twi_bytes
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/cciSaaaa.s:523 .bss:00000003 twi_ddr
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/cciSaaaa.s:526 .bss:00000006 retry_cnt
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/cciSaaaa.s:143 .text:00000048 I2CInt_readData
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/cciSaaaa.s:190 .text:0000007e I2CInt_isI2cBusy
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/cciSaaaa.s:223 .text:00000090 __vector_33
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/cciSaaaa.s:536 .text:00000292 Letext
UNDEFINED SYMBOLS
__do_copy_data
__do_clear_bss
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -