; At call On return
; State Idle/Reading-Wait Writing-Setup
; W slave number any
+ mov_wf xdebug+3
+ mov_ff st, xdebug+4
+ set_f xdebug+5
tst_f_ifnz st
bra m_write_start_busy
mov_fw slave_next
bra_z m_stop
; ok, we want to read another:
+ mov_wf xdebug+2
mov_wf slave
clr_f slave_next
bt_f_if0 st, st_writing ; because of i2cm_write_start ?
bs_f st, st_reading ; no, then we will want to read
bs_f SSPCON2, RSEN
+ set_f xdebug+0
bra m_start_or_restart
;----------
include program+externs.fin
include i2clib.inc
+ include variables+vars.fin
+
end
SS SSPSTAT,SSPCON1 ; s.,i., controller bad state
SK i2clib+panic:slave ; m. couldn't address slave (no ack)
SN i2clib+panic:slave ; improper slave number
+SO i2clib+panic:slave ; improper next slave number
SB i2clib+panic:st ; improper i2cm_{read,write}_start
SF i2clib+panic:st ; improper i2cmu_write_next_byte Z
SA i2clib+panic:st ; improper i2cm_read_another