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.scl_oe(false);
|
||||||
self.half_period();
|
self.half_period();
|
||||||
self.scl_oe(true);
|
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.sda_oe(false);
|
||||||
self.half_period();
|
self.half_period();
|
||||||
|
@ -199,7 +199,7 @@ impl I2c {
|
||||||
// Read ack/nack
|
// Read ack/nack
|
||||||
let ack = !self.sda_i();
|
let ack = !self.sda_i();
|
||||||
self.scl_oe(true);
|
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);
|
self.sda_oe(true);
|
||||||
// postcondition: SCL and SDA low
|
// postcondition: SCL and SDA low
|
||||||
|
|
||||||
|
@ -219,7 +219,7 @@ impl I2c {
|
||||||
self.half_period();
|
self.half_period();
|
||||||
if self.sda_i() { data |= 1 << bit }
|
if self.sda_i() { data |= 1 << bit }
|
||||||
self.scl_oe(true);
|
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
|
// Send ack/nack
|
||||||
self.sda_oe(ack);
|
self.sda_oe(ack);
|
||||||
|
@ -227,7 +227,7 @@ impl I2c {
|
||||||
self.scl_oe(false);
|
self.scl_oe(false);
|
||||||
self.half_period();
|
self.half_period();
|
||||||
self.scl_oe(true);
|
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);
|
self.sda_oe(true);
|
||||||
// postcondition: SCL and SDA low
|
// postcondition: SCL and SDA low
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue