File tree 1 file changed +5
-25
lines changed
1 file changed +5
-25
lines changed Original file line number Diff line number Diff line change @@ -47,33 +47,13 @@ pub trait Send<Word> {
47
47
48
48
/// Write (master mode)
49
49
#[ cfg( feature = "unproven" ) ]
50
- pub mod full_duplex {
51
- /// Default implementation of `spi::FullDuplex<W>` for implementers of
52
- /// `spi::Send<W>`
53
- ///
54
- /// Also needs a `send` method to return the byte read during the last send
55
- pub trait Default < W > : :: spi:: Send < W > {
56
- /// Reads the word stored in the shift register
57
- ///
58
- /// **NOTE** A word must be sent to the slave before attempting to call this
59
- /// method.
60
- fn read ( & mut self ) -> nb:: Result < W , Self :: Error > ;
50
+ impl < W > Send < W > for FullDuplex < W > {
51
+ fn send ( & mut self , word : W ) -> nb:: Result < ( ) , Self :: Error > {
52
+ self . send ( word)
61
53
}
62
54
63
- impl < W , S > :: spi:: FullDuplex < W > for S
64
- where
65
- S : Default < W > ,
66
- W : Clone ,
67
- {
68
- type Error = S :: Error ;
69
-
70
- fn read ( & mut self ) -> nb:: Result < W , Self :: Error > {
71
- self . read ( )
72
- }
73
-
74
- fn send ( & mut self , word : W ) -> nb:: Result < ( ) , Self :: Error > {
75
- self . send ( word)
76
- }
55
+ fn completed ( & mut self ) -> nb:: Result < ( ) , Self :: Error > {
56
+ self . read ( ) . map ( |_| ( ) )
77
57
}
78
58
}
79
59
You can’t perform that action at this time.
0 commit comments