File tree 1 file changed +23
-0
lines changed
1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -104,3 +104,26 @@ pub mod write_iter {
104
104
}
105
105
}
106
106
}
107
+
108
+ /// Operation for transactional SPI trait
109
+ ///
110
+ /// This allows composition of SPI operations into a single bus transaction
111
+ #[ cfg( feature = "unproven" ) ]
112
+ #[ derive( Debug , PartialEq ) ]
113
+ pub enum Operation < ' a , W : ' static > {
114
+ /// Write data from the provided buffer, discarding read data
115
+ Write ( & ' a [ W ] ) ,
116
+ /// Write data out while reading data into the provided buffer
117
+ Transfer ( & ' a mut [ W ] ) ,
118
+ }
119
+
120
+ /// Transactional trait allows multiple actions to be executed
121
+ /// as part of a single SPI transaction
122
+ #[ cfg( feature = "unproven" ) ]
123
+ pub trait Transactional < W : ' static > {
124
+ /// Associated error type
125
+ type Error ;
126
+
127
+ /// Execute the provided transactions
128
+ fn exec < ' a > ( & mut self , operations : & mut [ Operation < ' a , W > ] ) -> Result < ( ) , Self :: Error > ;
129
+ }
You can’t perform that action at this time.
0 commit comments