X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=blobdiff_plain;f=detpic%2Fi2clib.inc;h=e91e31963f9ecdafd45d5fa945e6f2a660d8eed1;hb=90b5597ff17afd69dff55eb96d047299a22dc3d1;hp=5167a1329d09afc695f456520f227184c31b08a5;hpb=0633b396bd1defa069b6046e6ca1a5f2b0091245;p=trains.git diff --git a/detpic/i2clib.inc b/detpic/i2clib.inc index 5167a13..e91e319 100644 --- a/detpic/i2clib.inc +++ b/detpic/i2clib.inc @@ -131,21 +131,24 @@ ; // \ ,------------------<---. | | ; // \ | | | | ; VV VV | | | -; [Writing-Setup] [Reading-Busy]<---------. | | | -; | | | | | | -; write_next_byte| |read_got_byte | | | | -; must return NZ | | | | | | -; V V | | | | -; ,-->[Writing] [Reading-Wait] | | | | -; `-------' \ / || `.___________,' | | | -; write_next_byte \ / || read_another | | | -; returns NZ | / || | | | -; | / |`.__________________,' | | -; | | | read_start | | -; write_next_byte| | `._____________________,' | -; returns Z | | write_start | -; | |read_done | -; V V | +; [Writing-Setup] [Reading-Busy]<----------. | | | +; | | | | | | | +; | | | | | | | +; | slave_no_ack| | | | | | +; | (1st | | | | | | +; write_next_byte| byte / |read_got_byte | | | | +; must return NZ | only)/ | | | | | +; V / V | | | | +; ,-->[Writing] / [Reading-Wait] | | | | +; `-------' \ | / || `.___________,' | | | +; write_next_byte \ | / || read_another | | | +; returns NZ | | / || | | | +; | | / |`.__________________,' | | +; | | | | read_start | | +; write_next_byte| | | `._____________________,' | +; returns Z | | | write_start | +; | | |read_done | +; V V V | ; [Stopping] | ; | done | ; `-------------------------------------' @@ -157,14 +160,22 @@ ; been finished as requested. The i2c system is now available and ; i2cm_*_start can be called. ; -; (Note: If this arrangment means that main program ends up needing to -; keep track of whether the I2C is Idle or not, it would probably be -; straightforward to enhance the interface to be enhanced to make that -; unnecessary, since this information is already tracked by i2clib.) -; ; Beforehand At call ; State Stopping Idle +;-------------------- + extern i2cmu_slave_no_ack + +; Called to notify that the slave did not acknowledge its address when +; we attempted to read from it. The i2c system is now clearing down +; the i2c bus to prepare for another transaction. +; +; Beforehand At call +; State Reading-Busy* Stopping +; +; * only Reading-Busy reached by calling read_start; +; not Reading-Busy due to read_another. + ;======================================== ; MASTER - WRITES (ie, transmission of data to the slave)