summaryrefslogtreecommitdiff
path: root/software/ctr/i2c.inc
diff options
context:
space:
mode:
authorChristian Pointner <equinox@mur.at>2012-06-07 17:43:11 +0000
committerChristian Pointner <equinox@mur.at>2012-06-07 17:43:11 +0000
commit8bd7979da0b89b2757f2dcb3818f92189d05c8ae (patch)
treeeadb010f517b420f8f7ed408c2ea968d51e6227b /software/ctr/i2c.inc
parentimproved port pin definitions (diff)
improved port pin assigments
git-svn-id: https://svn.spreadspace.org/mur.sat@512 7de4ea59-55d0-425e-a1af-a3118ea81d4c
Diffstat (limited to 'software/ctr/i2c.inc')
-rw-r--r--software/ctr/i2c.inc56
1 files changed, 28 insertions, 28 deletions
diff --git a/software/ctr/i2c.inc b/software/ctr/i2c.inc
index 52c90e3..9643355 100644
--- a/software/ctr/i2c.inc
+++ b/software/ctr/i2c.inc
@@ -31,33 +31,33 @@
;; -------------------------------------
i2c_start
movlb .1
- bcf TRISB,I2C_SDA
+ bcf I2C_SDA
nop
- bcf TRISB,I2C_SCL
+ bcf I2C_SCL
movlb .0
return
;; ------------------
i2c_restart
movlb .1
- bsf TRISB,I2C_SDA
+ bsf I2C_SDA
nop
- bsf TRISB,I2C_SCL
+ bsf I2C_SCL
nop
nop
nop
- bcf TRISB,I2C_SDA
+ bcf I2C_SDA
nop
- bcf TRISB,I2C_SCL
+ bcf I2C_SCL
movlb .0
return
;; ------------------
i2c_stop
movlb .1
- bsf TRISB,I2C_SCL
+ bsf I2C_SCL
nop
- bsf TRISB,I2C_SDA
+ bsf I2C_SDA
movlb .0
return
@@ -69,27 +69,27 @@ i2c_send_byte
movlb .1
i2c_send_byte_next
btfss I2C_BYTE,7
- bcf TRISB,I2C_SDA
+ bcf I2C_SDA
btfsc I2C_BYTE,7
- bsf TRISB,I2C_SDA
+ bsf I2C_SDA
nop
- bsf TRISB,I2C_SCL
+ bsf I2C_SCL
nop
nop
- bcf TRISB,I2C_SCL
+ bcf I2C_SCL
rlf I2C_BYTE,f
decfsz I2C_BIT_CNT,f
goto i2c_send_byte_next
nop
nop
- bsf TRISB,I2C_SDA
- bsf TRISB,I2C_SCL
+ bsf I2C_SDA
+ bsf I2C_SCL
movlb .0
movf PORTB,w
movlb .1
- bcf TRISB,I2C_SCL
- bcf TRISB,I2C_SDA
+ bcf I2C_SCL
+ bcf I2C_SDA
movlb .0
andlw b'00010000'
movwf I2C_BYTE
@@ -102,18 +102,18 @@ i2c_recv_byte
movlw .8
movwf I2C_BIT_CNT
movlb .1
- bsf TRISB,I2C_SDA
+ bsf I2C_SDA
i2c_recv_byte_loop
- bsf TRISB,I2C_SCL
+ bsf I2C_SCL
movlb .0
- btfsc PORTB,I2C_SDA
+ btfsc I2C_SDA
bsf I2C_BYTE,0
movlb .1
- bcf TRISB,I2C_SCL
+ bcf I2C_SCL
decfsz I2C_BIT_CNT,f
goto i2c_recv_byte_next
- bcf TRISB,I2C_SDA
+ bcf I2C_SDA
movlb .0
return
@@ -125,23 +125,23 @@ i2c_recv_byte_next
;; ------------------
i2c_ack
movlb .1
- bcf TRISB,I2C_SDA
- bsf TRISB,I2C_SCL
+ bcf I2C_SDA
+ bsf I2C_SCL
nop
nop
- bcf TRISB,I2C_SCL
+ bcf I2C_SCL
movlb .0
return
;; ------------------
i2c_nack
movlb .1
- bsf TRISB,I2C_SDA
- bsf TRISB,I2C_SCL
+ bsf I2C_SDA
+ bsf I2C_SCL
nop
nop
- bcf TRISB,I2C_SCL
- bcf TRISB,I2C_SDA
+ bcf I2C_SCL
+ bcf I2C_SDA
movlb .0
return