📄 ecp_i2c_hw.lst
字号:
355 00027C 0E11 rra R14
356 00027E 0E11 rra R14
357 000280 0E11 rra R14
358 000282 3EF0FF00 and #0x00FF,R14
; Clear upper bits
359 000286 443C jmp I2CReadProcessed
; We are done
360 000288
361 000288 1440.... ReadOffset0x16 mov IRReadIndex,R4
; Get
the read
offset
362 00028C 1640.... mov IRWriteIndex,R6
; Get
the write
offset
363 000290 0684 sub R4,R6
; Get the
difference
364 000292 0611 rra R6
; Divide by 2
365 000294 36F01F00 and #0x001F,R6
; Offsets are only 6 bits
366 000298
; Word count is 5 bits
367 000298 0E46 mov R6,R14
; Return
count
368 00029A 3A3C jmp I2CReadProcessed
; We are done
369 00029C
370 00029C 3440.... ReadOffset0x17 mov #IRBuffer,R4
; Get
the IR buffer
ptr
371 0002A0 1640.... mov IRReadIndex,R6
; Get
the Read
Index
372 0002A4 1E40.... mov IRWriteIndex,R14
; Get
the Write
Index
373 0002A8 0E96 cmp R6,R14
; See if indexs
are same
374 0002AA 0D24 jeq IRReadOverrunHigh
; No data to read
375 0002AC 0654 add R4,R6
; Add to
pointer
376 0002AE 2E46 mov 0(R6),R14
; Get the IR
data
377 0002B0 0E11 rra R14
; Right shift 8x
378 0002B2 0E11 rra R14
379 0002B4 0E11 rra R14
380 0002B6 0E11 rra R14
381 0002B8 0E11 rra R14
382 0002BA 0E11 rra R14
383 0002BC 0E11 rra R14
384 0002BE 0E11 rra R14
385 0002C0 3EF0FF00 and #0x00FF,R14
; Only the lower 8 bits
386 0002C4 253C jmp I2CReadProcessed
; We are done
387 0002C6 3E40DE00 IRReadOverrunHigh mov #0x00DE,R14
; Indicate bogus data
388 0002CA 223C jmp I2CReadProcessed
; We are done
389 0002CC
390 0002CC 3440.... ReadOffset0x18 mov #IRBuffer,R4
; Get
the IR buffer
ptr
391 0002D0 1640.... mov IRReadIndex,R6
; Get
the Read
Index
392 0002D4 1E40.... mov IRWriteIndex,R14
; Get
the Write
Index
393 0002D8 0E96 cmp R6,R14
; See if indexs
are same
394 0002DA 1024 jeq IRReadOverrunLow
; No data to read
395 0002DC 0654 add R4,R6
; Add to
pointer
396 0002DE 2E46 mov 0(R6),R14
; Get the IR
data
397 0002E0 3EF0FF00 and #0x00FF,R14
; Only the lower 8 bits
398 0002E4 1640.... mov IRReadIndex,R6
; Get
the read
index
399 0002E8 2653 add #0x0002,R6
; Add 2
400 0002EA 36F03F00 and #0x003F,R6
; Index is 6 bits
401 0002EE 8046.... mov R6,IRReadIndex
; Store the
read index
402 0002F2 1440.... mov IRWriteIndex,R4
; Get
the Write
Index
403 0002F6 0694 cmp R4,R6
; Are the equal
now?
404 0002F8 0424 jeq IRBufferEmpty
; Is the buffer empty?
405 0002FA 0A3C jmp I2CReadProcessed
; We are done
406 0002FC 3E40AD00 IRReadOverrunLow mov #0x00AD,R14
; Indicate bogus data
407 000300 073C jmp I2CReadProcessed
; We are done
408 000302 54423000 IRBufferEmpty mov.b &P5IN,R4
; Get port
5
409 000306 74D02000 bis.b #MSP430_INT,R4
; Clear MSP430 INT
410 00030A C2443100 mov.b R4,&P5OUT
; Write Port
5
411 00030E 003C jmp I2CReadProcessed
; We are done
412 000310
413 000310 3641 I2CReadProcessed pop R6 ; Restore
R6
414 000312 3441 pop R4 ; Restore
R4
415 000314 3041 ret
416 000316
417 000316 ; **********************************************
******************************
418 000316 ; Function: ProcessI2CWrite
419 000316 ;
420 000316 ; Purpose: Carries out the I2C write command
recieved from the master
421 000316 ;
422 000316 ; Inputs: R4 - Contains the offset to the
register that was written to
423 000316 ; R5 - Contains the data to write
424 000316 ;
425 000316 ; Returns: R15 - Nonzero if offset is
bad
426 000316 ; **********************************************
******************************
427 000316 B012.... ProcessI2CWrite call #ValidateECPOffset ;
Make sure offset is good
428 00031A 0F93 cmp #0x0000,R15 ;
R15 = 0 on good offset
429 00031C 0124 jeq WriteOffsetValid ;
Offset is okay
430 00031E 3041 ret ;
Offset is bad, abort
431 000320 0412 WriteOffsetValid push R4 ;
Save R4
432 000322 0512 push R5 ;
Save R5
433 000324 0612 push R6 ;
Save R6
434 000326 0712 push R7 ;
Save R7
435 000328 0454 add R4,R4 ;
Multiply the
offset by 2
436 00032A 0054 add R4,PC ;
and jump to offset
routine
437 00032C 183C jmp WriteOffset0x00
438 00032E 443C jmp WriteOffset0x01
439 000330 473C jmp WriteOffset0x02
440 000332 6D3C jmp WriteOffset0x03
441 000334 6F3C jmp WriteOffset0x04
442 000336 783C jmp WriteOffset0x05
443 000338 783C jmp WriteOffset0x06
444 00033A 783C jmp WriteOffset0x07
445 00033C 783C jmp WriteOffset0x08
446 00033E 813C jmp WriteOffset0x09
447 000340 813C jmp WriteOffset0x0A
448 000342 813C jmp WriteOffset0x0B
449 000344 813C jmp WriteOffset0x0C
450 000346 813C jmp WriteOffset0x0D
451 000348 813C jmp WriteOffset0x0E
452 00034A 813C jmp WriteOffset0x0F
453 00034C 813C jmp WriteOffset0x10
454 00034E 813C jmp WriteOffset0x11
455 000350 813C jmp WriteOffset0x12
456 000352 863C jmp WriteOffset0x13
457 000354 933C jmp WriteOffset0x14
458 000356 983C jmp WriteOffset0x15
459 000358 A53C jmp WriteOffset0x16
460 00035A A53C jmp WriteOffset0x17
461 00035C A53C jmp WriteOffset0x18
462 00035E
463 00035E ; Offset 0x00 - ECP Command Register
464 00035E B012.... WriteOffset0x00 call #ValidateECPCMD ;
Make sure cmd is good
465 000362 0F93 cmp #0x0000,R15 ;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -