@@ -95,9 +95,9 @@ pub unsafe trait Destination<E: Element> {
9595/// A DMA transfer that receives data from hardware
9696///
9797/// The future resolves when the peripheral has provided all
98- /// expected data. Use [`receive ()`](crate::peripheral::receive ) to construct
98+ /// expected data. Use [`read ()`](crate::peripheral::read ) to construct
9999/// this future.
100- pub struct Rx < ' a , S , E >
100+ pub struct Read < ' a , S , E >
101101where
102102 S : Source < E > ,
103103 E : Element ,
@@ -108,7 +108,7 @@ where
108108 _elem : PhantomData < & ' a mut E > ,
109109}
110110
111- impl < S , E > Future for Rx < ' _ , S , E >
111+ impl < S , E > Future for Read < ' _ , S , E >
112112where
113113 S : Source < E > ,
114114 E : Element ,
@@ -120,7 +120,7 @@ where
120120 }
121121}
122122
123- impl < S , E > Drop for Rx < ' _ , S , E >
123+ impl < S , E > Drop for Read < ' _ , S , E >
124124where
125125 S : Source < E > ,
126126 E : Element ,
@@ -132,7 +132,7 @@ where
132132 }
133133}
134134
135- fn prepare_receive < S , E > ( channel : & mut Channel , source : & mut S , buffer : & mut [ E ] )
135+ fn prepare_read < S , E > ( channel : & mut Channel , source : & mut S , buffer : & mut [ E ] )
136136where
137137 S : Source < E > ,
138138 E : Element ,
@@ -191,24 +191,24 @@ where
191191///
192192/// let mut buffer = [0u8; 32];
193193///
194- /// peripheral::receive (
194+ /// peripheral::read (
195195/// &mut channel_7,
196196/// &mut lpuart,
197197/// &mut buffer,
198198/// ).await?;
199199/// # Ok(()) }
200200/// ```
201- pub fn receive < ' a , S , E > (
201+ pub fn read < ' a , S , E > (
202202 channel : & ' a mut Channel ,
203203 source : & ' a mut S ,
204204 buffer : & ' a mut [ E ] ,
205- ) -> Rx < ' a , S , E >
205+ ) -> Read < ' a , S , E >
206206where
207207 S : Source < E > ,
208208 E : Element ,
209209{
210- prepare_receive ( channel, source, buffer) ;
211- Rx {
210+ prepare_read ( channel, source, buffer) ;
211+ Read {
212212 channel,
213213 // Safety: transfer is correctly defined
214214 transfer : unsafe { Transfer :: new ( channel) } ,
@@ -220,8 +220,8 @@ where
220220/// A DMA transfer that sends data to hardware
221221///
222222/// The future resolves when the device has sent all provided data.
223- /// Use [`transfer ()`](crate::peripheral::transfer ) to construct this future.
224- pub struct Tx < ' a , D , E >
223+ /// Use [`write ()`](crate::peripheral::write ) to construct this future.
224+ pub struct Write < ' a , D , E >
225225where
226226 D : Destination < E > ,
227227 E : Element ,
@@ -232,7 +232,7 @@ where
232232 _elem : PhantomData < & ' a E > ,
233233}
234234
235- impl < D , E > Future for Tx < ' _ , D , E >
235+ impl < D , E > Future for Write < ' _ , D , E >
236236where
237237 D : Destination < E > ,
238238 E : Element ,
@@ -244,7 +244,7 @@ where
244244 }
245245}
246246
247- impl < D , E > Drop for Tx < ' _ , D , E >
247+ impl < D , E > Drop for Write < ' _ , D , E >
248248where
249249 D : Destination < E > ,
250250 E : Element ,
@@ -256,7 +256,7 @@ where
256256 }
257257}
258258
259- fn prepare_transfer < D , E > ( channel : & mut Channel , buffer : & [ E ] , destination : & mut D )
259+ fn prepare_write < D , E > ( channel : & mut Channel , buffer : & [ E ] , destination : & mut D )
260260where
261261 D : Destination < E > ,
262262 E : Element ,
@@ -315,24 +315,24 @@ where
315315///
316316/// let buffer = [4u8, 5, 6, 7, 8];
317317///
318- /// peripheral::transfer (
318+ /// peripheral::write (
319319/// &mut channel_7,
320320/// &buffer,
321321/// &mut lpuart,
322322/// ).await?;
323323/// # Ok(()) }
324324/// ```
325- pub fn transfer < ' a , D , E > (
325+ pub fn write < ' a , D , E > (
326326 channel : & ' a mut Channel ,
327327 buffer : & ' a [ E ] ,
328328 destination : & ' a mut D ,
329- ) -> Tx < ' a , D , E >
329+ ) -> Write < ' a , D , E >
330330where
331331 D : Destination < E > ,
332332 E : Element ,
333333{
334- prepare_transfer ( channel, buffer, destination) ;
335- Tx {
334+ prepare_write ( channel, buffer, destination) ;
335+ Write {
336336 channel,
337337 destination,
338338 // Safety: transfer is correctly defined
@@ -447,8 +447,8 @@ where
447447 P : Bidirectional < E > ,
448448 E : Element ,
449449{
450- prepare_transfer ( tx_channel, buffer, peripheral) ;
451- prepare_receive ( rx_channel, peripheral, buffer) ;
450+ prepare_write ( tx_channel, buffer, peripheral) ;
451+ prepare_read ( rx_channel, peripheral, buffer) ;
452452
453453 FullDuplex {
454454 rx_channel,
0 commit comments