diff options
| author | Dario Nieuwenhuis <[email protected]> | 2021-04-14 16:37:52 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2021-04-14 17:04:40 +0200 |
| commit | f292647066d2b693c1529faf409bbde060c26e12 (patch) | |
| tree | ce1a82f00b18f2772140888a766b94aba38f44fd | |
| parent | c15411d1bdbc54caa0e9879ea1de8c43025f2090 (diff) | |
Remove Pin from I2c
| -rw-r--r-- | embassy-traits/src/i2c.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/embassy-traits/src/i2c.rs b/embassy-traits/src/i2c.rs index 704203885..abe932d9c 100644 --- a/embassy-traits/src/i2c.rs +++ b/embassy-traits/src/i2c.rs | |||
| @@ -67,7 +67,6 @@ | |||
| 67 | //! ``` | 67 | //! ``` |
| 68 | 68 | ||
| 69 | use core::future::Future; | 69 | use core::future::Future; |
| 70 | use core::pin::Pin; | ||
| 71 | 70 | ||
| 72 | mod private { | 71 | mod private { |
| 73 | pub trait Sealed {} | 72 | pub trait Sealed {} |
| @@ -117,7 +116,7 @@ pub trait I2c<A: AddressMode = SevenBitAddress> { | |||
| 117 | /// - `MAK` = master acknowledge | 116 | /// - `MAK` = master acknowledge |
| 118 | /// - `NMAK` = master no acknowledge | 117 | /// - `NMAK` = master no acknowledge |
| 119 | /// - `SP` = stop condition | 118 | /// - `SP` = stop condition |
| 120 | fn read<'a>(self: Pin<&'a mut Self>, address: A, buffer: &mut [u8]) -> Self::ReadFuture<'a>; | 119 | fn read<'a>(&'a mut self, address: A, buffer: &mut [u8]) -> Self::ReadFuture<'a>; |
| 121 | 120 | ||
| 122 | /// Sends bytes to slave with address `address` | 121 | /// Sends bytes to slave with address `address` |
| 123 | /// | 122 | /// |
| @@ -135,7 +134,7 @@ pub trait I2c<A: AddressMode = SevenBitAddress> { | |||
| 135 | /// - `SAK` = slave acknowledge | 134 | /// - `SAK` = slave acknowledge |
| 136 | /// - `Bi` = ith byte of data | 135 | /// - `Bi` = ith byte of data |
| 137 | /// - `SP` = stop condition | 136 | /// - `SP` = stop condition |
| 138 | fn write<'a>(self: Pin<&'a mut Self>, address: A, bytes: &[u8]) -> Self::WriteFuture<'a>; | 137 | fn write<'a>(&'a mut self, address: A, bytes: &[u8]) -> Self::WriteFuture<'a>; |
| 139 | 138 | ||
| 140 | /// Sends bytes to slave with address `address` and then reads enough bytes to fill `buffer` *in a | 139 | /// Sends bytes to slave with address `address` and then reads enough bytes to fill `buffer` *in a |
| 141 | /// single transaction* | 140 | /// single transaction* |
| @@ -160,7 +159,7 @@ pub trait I2c<A: AddressMode = SevenBitAddress> { | |||
| 160 | /// - `NMAK` = master no acknowledge | 159 | /// - `NMAK` = master no acknowledge |
| 161 | /// - `SP` = stop condition | 160 | /// - `SP` = stop condition |
| 162 | fn write_read<'a>( | 161 | fn write_read<'a>( |
| 163 | self: Pin<&'a mut Self>, | 162 | &'a mut self, |
| 164 | address: A, | 163 | address: A, |
| 165 | bytes: &[u8], | 164 | bytes: &[u8], |
| 166 | buffer: &mut [u8], | 165 | buffer: &mut [u8], |
