Skip to content

Commit 436908e

Browse files
committed
Rename I2C trait methods try_*
1 parent 50869c2 commit 436908e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/blocking/i2c.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub trait Read {
2828
/// - `MAK` = master acknowledge
2929
/// - `NMAK` = master no acknowledge
3030
/// - `SP` = stop condition
31-
fn read(&mut self, address: u8, buffer: &mut [u8]) -> Result<(), Self::Error>;
31+
fn try_read(&mut self, address: u8, buffer: &mut [u8]) -> Result<(), Self::Error>;
3232
}
3333

3434
/// Blocking write
@@ -52,7 +52,7 @@ pub trait Write {
5252
/// - `SAK` = slave acknowledge
5353
/// - `Bi` = ith byte of data
5454
/// - `SP` = stop condition
55-
fn write(&mut self, addr: u8, bytes: &[u8]) -> Result<(), Self::Error>;
55+
fn try_write(&mut self, addr: u8, bytes: &[u8]) -> Result<(), Self::Error>;
5656
}
5757

5858
/// Blocking write (iterator version)
@@ -66,7 +66,7 @@ pub trait WriteIter {
6666
/// # I2C Events (contract)
6767
///
6868
/// Same as `Write`
69-
fn write<B>(&mut self, addr: u8, bytes: B) -> Result<(), Self::Error>
69+
fn try_write<B>(&mut self, addr: u8, bytes: B) -> Result<(), Self::Error>
7070
where
7171
B: IntoIterator<Item = u8>;
7272
}
@@ -98,7 +98,7 @@ pub trait WriteRead {
9898
/// - `MAK` = master acknowledge
9999
/// - `NMAK` = master no acknowledge
100100
/// - `SP` = stop condition
101-
fn write_read(
101+
fn try_write_read(
102102
&mut self,
103103
address: u8,
104104
bytes: &[u8],
@@ -118,7 +118,7 @@ pub trait WriteIterRead {
118118
/// # I2C Events (contract)
119119
///
120120
/// Same as the `WriteRead` trait
121-
fn write_iter_read<B>(
121+
fn try_write_iter_read<B>(
122122
&mut self,
123123
address: u8,
124124
bytes: B,

0 commit comments

Comments
 (0)