forked from M-Labs/artiq
1
0
Fork 0

firmware: support i2c restart

This commit is contained in:
Sebastien Bourdeauducq 2017-01-05 14:49:24 +01:00
parent 082fdaf450
commit 6c685205ce
1 changed files with 10 additions and 0 deletions

View File

@ -70,6 +70,16 @@ pub fn start(busno: u32) {
half_period(); 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) { pub fn stop(busno: u32) {
// First, make sure SCL is low, so that the target releases the SDA line // First, make sure SCL is low, so that the target releases the SDA line
scl_o(busno, false); scl_o(busno, false);