Skip to content

Commit c40bbc9

Browse files
Dirbaioeldruin
andauthored
Apply suggestions from code review
Co-authored-by: Diego Barrios Romero <[email protected]>
1 parent 6bf6b02 commit c40bbc9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

embedded-hal/src/i2c.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,16 @@
4040
//!
4141
//! # For driver authors
4242
//!
43-
//! Drivers can be generic over `I2c<SevenBitAddress>` or `I2c<TenBitAddress>` depending
44-
//! on the kind of address supported by the target device. If it can use either, the driver can
43+
//! Drivers can select the adequate address length with `I2c<SevenBitAddress>` or `I2c<TenBitAddress>` depending
44+
//! on the target device. If it can use either, the driver can
4545
//! be generic over the address kind as well, though this is rare.
4646
//!
4747
//! Drivers should take the `I2c` instance as an argument to `new()`, and store it in their
4848
//! struct. They **should not** take `&mut I2c`, the trait has a blanket impl for all `&mut T`
4949
//! so taking just `I2c` ensures the user can still pass a `&mut`, but is not forced to.
5050
//!
5151
//! Drivers **should not** try to enable bus sharing by taking `&mut I2c` at every method.
52-
//! This is much less ergonomic than owning the `I2c`, and allowing the user to pass an
52+
//! This is much less ergonomic than owning the `I2c`, which still allows the user to pass an
5353
//! implementation that does sharing behind the scenes
5454
//! (from [`embedded-hal-bus`](https://docs.rs/embedded-hal-bus), or others).
5555
//!
@@ -111,8 +111,8 @@
111111
//! supports sharing, such as Linux or some RTOSs.)
112112
//!
113113
//! Here is an example of an embedded-hal implementation of the `I2C` trait
114-
//! for both modes. All trait methods have have default implementations in terms of `transaction`,
115-
//! so that's the only one that requires implementing.
114+
//! for both addressing modes. All trait methods have have default implementations in terms of `transaction`.
115+
//! As such, that is the only method that requires implementation in the HAL.
116116
//!
117117
//! ```
118118
//! use embedded_hal::i2c::{self, SevenBitAddress, TenBitAddress, I2c, Operation};

0 commit comments

Comments
 (0)