mirror of
https://github.com/m-labs/artiq.git
synced 2024-12-20 08:56:28 +08:00
firmware: support i2c restart
This commit is contained in:
parent
082fdaf450
commit
6c685205ce
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user