Skip to content

Commit

Permalink
Update i2c timeout docs
Browse files Browse the repository at this point in the history
  • Loading branch information
9names committed Jan 11, 2024
1 parent 42572e1 commit dcd6c9f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/i2c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,11 @@ where

/// I2C peripheral operating in master mode supporting seven bit addressing
pub struct I2c<I2C, PINS> {
/// i2c peripheral instance
i2c: I2C,
/// sda and scl pins for this i2c interface
pins: PINS,
/// timeout (in milliseconds)
timeout: u16,
}

Expand Down Expand Up @@ -175,8 +178,7 @@ where
(self.i2c, self.pins)
}

/// Set the timeout when waiting for fifo (rx and tx).
/// It's not a time unit but the number of cycles to wait.
/// Set the timeout (in milliseconds) when waiting for fifo (rx and tx).
/// This defaults to 2048
pub fn set_timeout(&mut self, timeout: u16) {
self.timeout = timeout;
Expand Down

0 comments on commit dcd6c9f

Please sign in to comment.