1
1
//! Serial Peripheral Interface
2
2
3
- use core:: { future:: Future , mem :: MaybeUninit } ;
3
+ use core:: future:: Future ;
4
4
5
5
/// Async transfer
6
- pub trait Transfer < Word : ' static > {
6
+ pub trait Transfer < W : ' static > {
7
7
/// Error type
8
8
type Error ;
9
9
@@ -14,11 +14,11 @@ pub trait Transfer<Word: 'static> {
14
14
15
15
/// Writes `words` to the slave from the `write` buffer. Puts the words returned in the `read` buffer.
16
16
/// This method uses separate `write` and `read` buffers.
17
- fn transfer < ' a > ( & ' a mut self , write : & ' a [ Word ] , read : & ' a mut [ MaybeUninit < Word > ] ) -> Self :: TransferFuture < ' a > ;
17
+ fn transfer < ' a > ( & ' a mut self , write : & ' a [ W ] , read : & ' a mut [ W ] ) -> Self :: TransferFuture < ' a > ;
18
18
}
19
19
20
20
/// Async transfer in place.
21
- pub trait TransferInPlace < Word : ' static > {
21
+ pub trait TransferInPlace < W : ' static > {
22
22
/// Error type
23
23
type Error ;
24
24
@@ -31,11 +31,11 @@ pub trait TransferInPlace<Word: 'static> {
31
31
/// This method uses a single `readwrite` buffer.
32
32
///
33
33
/// The returned buffer is the initialized `readwrite` buffer.
34
- fn transfer_inplace < ' a > ( & ' a mut self , readwrite : & ' a mut [ Word ] ) -> Self :: TransferInPlaceFuture < ' a > ;
34
+ fn transfer_inplace < ' a > ( & ' a mut self , readwrite : & ' a mut [ W ] ) -> Self :: TransferInPlaceFuture < ' a > ;
35
35
}
36
36
37
37
/// Async write
38
- pub trait Write < Word > {
38
+ pub trait Write < W > {
39
39
/// Error type
40
40
type Error ;
41
41
@@ -45,11 +45,11 @@ pub trait Write<Word> {
45
45
Self : ' a ;
46
46
47
47
/// Writes `words` to the slave, ignoring all the incoming words
48
- fn write < ' a > ( & ' a mut self , words : & ' a [ Word ] ) -> Self :: WriteFuture < ' a > ;
48
+ fn write < ' a > ( & ' a mut self , words : & ' a [ W ] ) -> Self :: WriteFuture < ' a > ;
49
49
}
50
50
51
51
/// Async read
52
- pub trait Read < Word : ' static > {
52
+ pub trait Read < W : ' static > {
53
53
/// Error type
54
54
type Error ;
55
55
@@ -63,5 +63,5 @@ pub trait Read<Word: 'static> {
63
63
/// by this trait. Some hardware can configure what values (e.g. 0x00, 0xFF), some cannot.
64
64
///
65
65
/// The returned buffer is the initialized `words` buffer.
66
- fn read < ' a > ( & ' a mut self , words : & ' a mut [ MaybeUninit < Word > ] ) -> Self :: ReadFuture < ' a > ;
66
+ fn read < ' a > ( & ' a mut self , words : & ' a mut [ W ] ) -> Self :: ReadFuture < ' a > ;
67
67
}
0 commit comments