diff --git a/artiq/firmware/libboard/i2c.rs b/artiq/firmware/libboard/i2c.rs index 1c6b8181e..811f065bd 100644 --- a/artiq/firmware/libboard/i2c.rs +++ b/artiq/firmware/libboard/i2c.rs @@ -70,6 +70,16 @@ pub fn start(busno: u32) { half_period(); } +pub fn restart(busno: u32) { + // Set SCL low then SDA high */ + scl_o(busno, false); + half_period(); + sda_oe(busno, false); + half_period(); + // Do a regular start + start(busno); +} + pub fn stop(busno: u32) { // First, make sure SCL is low, so that the target releases the SDA line scl_o(busno, false);