2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-19 00:16:29 +08:00

firmware: support i2c restart

This commit is contained in:
Sebastien Bourdeauducq 2017-01-05 14:49:24 +01:00
parent 082fdaf450
commit 6c685205ce

View File

@ -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);