Skip to content

Commit a61008b

Browse files
committed
Update spi trait names
1 parent 582ebad commit a61008b

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/futures/spi.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,36 @@
22
33
use core::{future::Future, mem::MaybeUninit};
44

5-
/// Async read + write
6-
pub trait ReadWrite<Word: 'static> {
5+
/// Async transfer
6+
pub trait Transfer<Word: 'static> {
77
/// Error type
88
type Error;
99

1010
/// Associated future for the `transfer` method.
11-
type ReadWriteFuture<'a>: Future<Output = Result<&'a [Word], Self::Error>> + 'a
11+
type TransferFuture<'a>: Future<Output = Result<(), Self::Error>> + 'a
1212
where
1313
Self: 'a;
1414

1515
/// Writes `words` to the slave from the `write` buffer. Puts the words returned in the `read` buffer.
1616
/// This method uses separate `write` and `read` buffers.
17-
fn readwrite<'a>(&'a mut self, write: &'a [Word], read: &'a mut [MaybeUninit<Word>]) -> Self::ReadWriteFuture<'a>;
17+
fn transfer<'a>(&'a mut self, write: &'a [Word], read: &'a mut [MaybeUninit<Word>]) -> Self::TransferFuture<'a>;
1818
}
1919

20-
/// Async read + write in place.
21-
pub trait ReadWriteInPlace<Word: 'static> {
20+
/// Async transfer in place.
21+
pub trait TransferInPlace<Word: 'static> {
2222
/// Error type
2323
type Error;
2424

25-
/// Associated future for the `transfer` method.
26-
type ReadWriteInPlaceFuture<'a>: Future<Output = Result<&'a [Word], Self::Error>> + 'a
25+
/// Associated future for the `transfer_inplace` method.
26+
type TransferInPlaceFuture<'a>: Future<Output = Result<(), Self::Error>> + 'a
2727
where
2828
Self: 'a;
2929

3030
/// Writes `words` to the slave from the `readwrite` buffer and reads words into the same buffer.
3131
/// This method uses a single `readwrite` buffer.
3232
///
3333
/// The returned buffer is the initialized `readwrite` buffer.
34-
fn readwrite_inplace<'a>(&'a mut self, readwrite: &'a mut [Word]) -> Self::ReadWriteInPlaceFuture<'a>;
34+
fn transfer_inplace<'a>(&'a mut self, readwrite: &'a mut [Word]) -> Self::TransferInPlaceFuture<'a>;
3535
}
3636

3737
/// Async write
@@ -54,7 +54,7 @@ pub trait Read<Word: 'static> {
5454
type Error;
5555

5656
/// Associated future for the `read` method.
57-
type ReadFuture<'a>: Future<Output = Result<&'a [Word], Self::Error>> + 'a
57+
type ReadFuture<'a>: Future<Output = Result<(), Self::Error>> + 'a
5858
where
5959
Self: 'a;
6060

0 commit comments

Comments
 (0)