Skip to content

Commit eecf646

Browse files
committed
Remove commented-out futures::spi::Transactional trait
1 parent 5cdd987 commit eecf646

File tree

1 file changed

+0
-58
lines changed

1 file changed

+0
-58
lines changed

src/futures/spi.rs

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -61,61 +61,3 @@ pub trait Read<W> {
6161
/// by this trait. Some hardware can configure what values (e.g. all zeroes, all ones), some cannot.
6262
fn read<'a>(&'a mut self, words: &'a mut [MaybeUninit<W>]) -> Self::ReadFuture<'a>;
6363
}
64-
65-
// /// Operation for transactional SPI trait
66-
// ///
67-
// /// This allows composition of SPI operations into a single bus transaction
68-
// #[derive(Debug, PartialEq)]
69-
// pub enum Operation<'a, W: 'static> {
70-
// /// Write data from the provided buffer, discarding read data
71-
// Write(&'a [W]),
72-
// /// Write data out while reading data into the provided buffer
73-
// Transfer(&'a mut [W]),
74-
// }
75-
76-
// /// Transactional trait allows multiple actions to be executed
77-
// /// as part of a single SPI transaction
78-
// pub trait Transactional<W: 'static> {
79-
// /// Associated error type
80-
// type Error;
81-
// /// Future associated with the `exec` method.
82-
// type ExecFuture<'a>: Future<Output = Result<(), Self::Error>> + 'a
83-
// where
84-
// Self: 'a;
85-
86-
// /// Execute the provided transactions
87-
// fn exec<'a>(&'a mut self, operations: &'a mut [Operation<'a, W>]) -> Self::ExecFuture<'a>;
88-
// }
89-
90-
// /// Blocking transactional impl over spi::Write and spi::Transfer
91-
// pub mod transactional {
92-
// use core::future::Future;
93-
94-
// use super::{Operation, Transfer, Write};
95-
96-
// /// Default implementation of `blocking::spi::Transactional<W>` for implementers of
97-
// /// `spi::Write<W>` and `spi::Transfer<W>`
98-
// pub trait Default<W: 'static>: Write<W> + Transfer<W> {}
99-
100-
// impl<W: 'static, E, S> super::Transactional<W> for S
101-
// where
102-
// S: self::Default<W> + Write<W, Error = E> + Transfer<W, Error = E>,
103-
// W: Copy + Clone,
104-
// {
105-
// type Error = E;
106-
// type ExecFuture<'a> where Self: 'a = impl Future<Output=Result<(), E>> + 'a;
107-
108-
// fn exec<'a>(&'a mut self, operations: &'a mut [super::Operation<'a, W>]) -> Self::ExecFuture<'a> {
109-
// async move {
110-
// for op in operations {
111-
// match op {
112-
// Operation::Write(w) => self.write(w).await?,
113-
// Operation::Transfer(t) => self.transfer(t).await.map(|_| ())?,
114-
// }
115-
// }
116-
117-
// Ok(())
118-
// }
119-
// }
120-
// }
121-
// }

0 commit comments

Comments
 (0)