Skip to content

Commit 5cc1bf8

Browse files
authored
Merge pull request #89 from chrysn-pull-requests/i2c-address-clarification
I2C docs: Explicitly state that addresses are 7-bit
2 parents 305bad9 + e3f715d commit 5cc1bf8

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/blocking/i2c.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
//! Blocking I2C API
2+
//!
3+
//! Slave addresses used by this API are 7-bit I2C addresses ranging from 0 to 127.
4+
//!
5+
//! Operations on 10-bit slave addresses are not supported by the API yet (but applications might
6+
//! be able to emulate some operations).
27
38
/// Blocking read
49
pub trait Read {
@@ -17,7 +22,7 @@ pub trait Read {
1722
/// Where
1823
///
1924
/// - `ST` = start condition
20-
/// - `SAD+R` = slave address with 8th bit set to 1
25+
/// - `SAD+R` = slave address followed by bit 1 to indicate reading
2126
/// - `SAK` = slave acknowledge
2227
/// - `Bi` = ith byte of data
2328
/// - `MAK` = master acknowledge
@@ -43,7 +48,7 @@ pub trait Write {
4348
/// Where
4449
///
4550
/// - `ST` = start condition
46-
/// - `SAD+W` = slave address with 8th bit set to 0
51+
/// - `SAD+W` = slave address followed by bit 0 to indicate writing
4752
/// - `SAK` = slave acknowledge
4853
/// - `Bi` = ith byte of data
4954
/// - `SP` = stop condition
@@ -68,11 +73,11 @@ pub trait WriteRead {
6873
/// Where
6974
///
7075
/// - `ST` = start condition
71-
/// - `SAD+W` = slave address with 8th bit set to 0
76+
/// - `SAD+W` = slave address followed by bit 0 to indicate writing
7277
/// - `SAK` = slave acknowledge
7378
/// - `Oi` = ith outgoing byte of data
7479
/// - `SR` = repeated start condition
75-
/// - `SAD+R` = slave address with 8th bit set to 1
80+
/// - `SAD+R` = slave address followed by bit 1 to indicate reading
7681
/// - `Ii` = ith incoming byte of data
7782
/// - `MAK` = master acknowledge
7883
/// - `NMAK` = master no acknowledge

0 commit comments

Comments
 (0)