File tree Expand file tree Collapse file tree 1 file changed +6
-25
lines changed Expand file tree Collapse file tree 1 file changed +6
-25
lines changed Original file line number Diff line number Diff line change @@ -47,33 +47,14 @@ pub trait Send<Word> {
4747
4848/// Write (master mode)
4949#[ 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 , E > Send < W > for FullDuplex < W , Error = E > {
51+ type Error = E ;
52+ fn send ( & mut self , word : W ) -> nb:: Result < ( ) , Self :: Error > {
53+ self . send ( word)
6154 }
6255
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- }
56+ fn completed ( & mut self ) -> nb:: Result < ( ) , Self :: Error > {
57+ self . read ( ) . map ( |_| ( ) )
7758 }
7859}
7960
You can’t perform that action at this time.
0 commit comments