Skip to content

Commit c71d771

Browse files
Merge #79
79: Minor improvements to top-level module documentation r=eldruin a=kevinmehall Co-authored-by: Kevin Mehall <[email protected]>
2 parents 987143a + f1c65e0 commit c71d771

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/lib.rs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,14 @@
99
//! # i2cdev
1010
//!
1111
//! The `i2cdev` crate provides a safe interface for interface
12-
//! with i2c devices under Linux. The API wraps the Linux
13-
//! kernel interface for interacting with i2c in userspace:
14-
//! https://www.kernel.org/doc/Documentation/i2c/dev-interface
12+
//! with i2c devices under Linux. The API wraps the [Linux
13+
//! kernel interface for interacting with i2c in userspace][kernel-doc].
14+
//!
15+
//! [kernel-doc]: https://www.kernel.org/doc/Documentation/i2c/dev-interface
16+
//!
17+
//! ## Examples
18+
//!
19+
//! ### Using the SMBus methods to read from a Wii Nunchuk
1520
//! ```rust,no_run
1621
//! extern crate i2cdev;
1722
//!
@@ -42,12 +47,10 @@
4247
//! }
4348
//! ```
4449
//!
50+
//! ### Using the `transfer` API with an individual device
4551
//! ```rust,no_run
4652
//! extern crate i2cdev;
4753
//!
48-
//! use std::thread;
49-
//! use std::time::Duration;
50-
//!
5154
//! use i2cdev::core::*;
5255
//! use i2cdev::linux::{LinuxI2CDevice, LinuxI2CError, LinuxI2CMessage};
5356
//!
@@ -68,12 +71,10 @@
6871
//! }
6972
//! ```
7073
//!
74+
//! ### Using `transfer` with `LinuxI2CBus`
7175
//! ```rust,no_run
7276
//! extern crate i2cdev;
7377
//!
74-
//! use std::thread;
75-
//! use std::time::Duration;
76-
//!
7778
//! use i2cdev::core::*;
7879
//! use i2cdev::linux::{LinuxI2CBus, LinuxI2CError, LinuxI2CMessage};
7980
//!

0 commit comments

Comments
 (0)