@@ -272,15 +272,22 @@ macro_rules! uartCommon {
272
272
pub trait RBFlowControlImpl {
273
273
fn enable_rts ( & self , state : bool ) ;
274
274
fn enable_cts ( & self , state : bool ) ;
275
+ fn listen_cts ( & self , state : bool ) ;
275
276
}
276
277
277
278
impl RBFlowControlImpl for RegisterBlockUsart {
279
+ #[ inline( always) ]
278
280
fn enable_rts ( & self , state : bool ) {
279
281
self . cr3 ( ) . modify ( |_, w| w. rtse ( ) . bit ( state) ) ;
280
282
}
283
+ #[ inline( always) ]
281
284
fn enable_cts ( & self , state : bool ) {
282
285
self . cr3 ( ) . modify ( |_, w| w. ctse ( ) . bit ( state) ) ;
283
286
}
287
+ #[ inline( always) ]
288
+ fn listen_cts ( & self , state : bool ) {
289
+ self . cr3 ( ) . modify ( |_, w| w. ctsie ( ) . bit ( state) )
290
+ }
284
291
}
285
292
286
293
impl RegisterBlockImpl for RegisterBlockUsart {
@@ -573,6 +580,12 @@ where
573
580
pub fn disable_clear_to_send ( & mut self ) {
574
581
self . tx . usart . enable_cts ( false ) ;
575
582
}
583
+ pub fn listen_clear_to_send ( & mut self ) {
584
+ self . tx . usart . listen_cts ( true )
585
+ }
586
+ pub fn unlisten_clear_to_send ( & mut self ) {
587
+ self . tx . usart . listen_cts ( false )
588
+ }
576
589
}
577
590
578
591
impl < UART : Instance , WORD > RxISR for Serial < UART , WORD >
0 commit comments