@@ -84,7 +84,7 @@ impl<T: Write<W>, W> Write<W> for &mut T {
84
84
}
85
85
}
86
86
87
- /// Operation for transactional SPI trait
87
+ /// Operation for ReadWrite::batch
88
88
///
89
89
/// This allows composition of SPI operations into a single bus transaction
90
90
#[ derive( Debug , PartialEq ) ]
@@ -116,8 +116,8 @@ pub trait ReadWrite<W>: Read<W> + Write<W> {
116
116
/// `words` buffer, overwriting it.
117
117
fn transfer_inplace ( & mut self , words : & mut [ W ] ) -> Result < ( ) , Self :: Error > ;
118
118
119
- /// Execute multiple actions as part of a single SPI transaction
120
- fn exec < ' a > ( & mut self , operations : & mut [ Operation < ' a , W > ] ) -> Result < ( ) , Self :: Error > {
119
+ /// Execute multiple operations as part of a single SPI transaction
120
+ fn batch < ' a > ( & mut self , operations : & mut [ Operation < ' a , W > ] ) -> Result < ( ) , Self :: Error > {
121
121
for op in operations {
122
122
match op {
123
123
Operation :: Read ( words) => self . read ( words) ?,
@@ -139,7 +139,7 @@ impl<T: ReadWrite<W>, W> ReadWrite<W> for &mut T {
139
139
T :: transfer_inplace ( self , words)
140
140
}
141
141
142
- fn exec < ' a > ( & mut self , operations : & mut [ Operation < ' a , W > ] ) -> Result < ( ) , Self :: Error > {
143
- T :: exec ( self , operations)
142
+ fn batch < ' a > ( & mut self , operations : & mut [ Operation < ' a , W > ] ) -> Result < ( ) , Self :: Error > {
143
+ T :: batch ( self , operations)
144
144
}
145
145
}
0 commit comments