comparison src/i2c.asm @ 429:4b93354b7738

hardware_flag handling
author heinrichsweikamp
date Thu, 16 Jun 2016 13:21:46 +0200
parents ceb1b7329dce
children aadfe9f2edaf
comparison
equal deleted inserted replaced
428:eccae727702f 429:4b93354b7738
496 rcall I2C_TX 496 rcall I2C_TX
497 movlw b'00000000' ; CTRL4 497 movlw b'00000000' ; CTRL4
498 rcall I2C_TX 498 rcall I2C_TX
499 movlw b'01100100' ; CTRL5 HIGH res, 6,25Hz 499 movlw b'01100100' ; CTRL5 HIGH res, 6,25Hz
500 rcall I2C_TX 500 rcall I2C_TX
501 init_compass1_common:
501 ;movlw b'01100000' ; CTRL6 Full scale (+/-12 Gauss -> 2730LSB/Gauss) 502 ;movlw b'01100000' ; CTRL6 Full scale (+/-12 Gauss -> 2730LSB/Gauss)
502 movlw b'00000000' ; CTRL6 (+/-2 Gauss) 503 movlw b'00000000' ; CTRL6 (+/-2 Gauss)
503 rcall I2C_TX 504 rcall I2C_TX
504 movlw b'00000000' ; CTRL7 Continuous Mode 505 movlw b'00000000' ; CTRL7 Continuous Mode
505 rcall I2C_TX 506 rcall I2C_TX
524 rcall I2C_TX 525 rcall I2C_TX
525 movlw b'00000000' ; CTRL4 526 movlw b'00000000' ; CTRL4
526 rcall I2C_TX 527 rcall I2C_TX
527 movlw b'01110100' ; CTRL5 HIGH res, 100Hz 528 movlw b'01110100' ; CTRL5 HIGH res, 100Hz
528 rcall I2C_TX 529 rcall I2C_TX
529 movlw b'01100000' ; CTRL6 Full scale (+/-12 Gauss -> 2730LSB/Gauss) 530 bra init_compass1_common
530 rcall I2C_TX
531 movlw b'00000000' ; CTRL7 Continuous Mode
532 rcall I2C_TX
533 bsf SSP1CON2,PEN ; Stop condition
534 rcall WaitMSSP
535 return
536 531
537 global I2C_sleep_compass 532 global I2C_sleep_compass
538 I2C_sleep_compass: 533 I2C_sleep_compass:
539 bcf compass_enabled 534 bcf compass_enabled
540 535