forked from M-Labs/zynq-rs
i2c: fix comments
This commit is contained in:
parent
91445620ee
commit
88bda0cb7a
|
@ -190,7 +190,7 @@ impl I2c {
|
|||
self.scl_oe(false);
|
||||
self.half_period();
|
||||
self.scl_oe(true);
|
||||
while self.scl_i() {} // ensure SCL is low before start() returns
|
||||
while self.scl_i() {} // ensure SCL is low before toggling SDA
|
||||
}
|
||||
self.sda_oe(false);
|
||||
self.half_period();
|
||||
|
@ -199,7 +199,7 @@ impl I2c {
|
|||
// Read ack/nack
|
||||
let ack = !self.sda_i();
|
||||
self.scl_oe(true);
|
||||
while self.scl_i() {} // ensure SCL is low before start() returns
|
||||
while self.scl_i() {} // ensure SCL is low before toggling SDA
|
||||
self.sda_oe(true);
|
||||
// postcondition: SCL and SDA low
|
||||
|
||||
|
@ -219,7 +219,7 @@ impl I2c {
|
|||
self.half_period();
|
||||
if self.sda_i() { data |= 1 << bit }
|
||||
self.scl_oe(true);
|
||||
while self.scl_i() {} // ensure SCL is low before start() returns
|
||||
while self.scl_i() {} // ensure SCL is low so that slave can toggle SDA
|
||||
}
|
||||
// Send ack/nack
|
||||
self.sda_oe(ack);
|
||||
|
@ -227,7 +227,7 @@ impl I2c {
|
|||
self.scl_oe(false);
|
||||
self.half_period();
|
||||
self.scl_oe(true);
|
||||
while self.scl_i() {} // ensure SCL is low before start() returns
|
||||
while self.scl_i() {} // ensure SCL is low before toggling SDA
|
||||
self.sda_oe(true);
|
||||
// postcondition: SCL and SDA low
|
||||
|
||||
|
|
Loading…
Reference in New Issue