;called from mini uC (micro thats 6x slower)
docpucmd:
setb CLK
mov R7,#8h
b1:
jnb CLK,$
rlc A
mov DAT,C
clr CLK
nop
setb CLK
djnz R7,b1
setb DAT
mov R7,#8h
b2:
setb CLK
jb CLK,$
mov C,DAT
jnb CLK,$
clr CLK
rlc A
djnz R7,b2
setb CLK
ret
;incoming data (from slow uC to fast uC)
dgetcmd:
setb DAT
mov R7,#8h
gb2:
setb CLK
jb CLK,$
jnb CLK,$
clr CLK
mov C,DAT
rlc A
djnz R7,gb2
setb CLK
ret
;outgoing data (from fast uC to slow uC)
dputres:
setb CLK
mov R7,#8h
gb:
jnb CLK,$
rlc A
mov DAT,C
clr CLK
acall i2cdel
setb CLK
djnz R7,gb
ret
;delays
i2cdel:
nop
nop
nop
nop
ret