@@ -268,15 +268,22 @@ macro_rules! uartCommon {
268
268
pub trait RBFlowControlImpl {
269
269
fn enable_rts ( & self , state : bool ) ;
270
270
fn enable_cts ( & self , state : bool ) ;
271
+ fn listen_cts ( & self , state : bool ) ;
271
272
}
272
273
273
274
impl RBFlowControlImpl for RegisterBlockUsart {
275
+ #[ inline( always) ]
274
276
fn enable_rts ( & self , state : bool ) {
275
277
self . cr3 ( ) . modify ( |_, w| w. rtse ( ) . bit ( state) ) ;
276
278
}
279
+ #[ inline( always) ]
277
280
fn enable_cts ( & self , state : bool ) {
278
281
self . cr3 ( ) . modify ( |_, w| w. ctse ( ) . bit ( state) ) ;
279
282
}
283
+ #[ inline( always) ]
284
+ fn listen_cts ( & self , state : bool ) {
285
+ self . cr3 ( ) . modify ( |_, w| w. ctsie ( ) . bit ( state) )
286
+ }
280
287
}
281
288
282
289
impl RegisterBlockImpl for RegisterBlockUsart {
@@ -545,7 +552,7 @@ where {
545
552
546
553
impl < UART : Instance + SerialFlowControl , WORD > Serial < UART , WORD >
547
554
where
548
- UART :: RegisterBlock : RBFlowControlImpl ,
555
+ UART :: RB : RBFlowControlImpl ,
549
556
{
550
557
pub fn with_rts ( self , rts : impl Into < UART :: Rts > ) -> Self {
551
558
self . rx . usart . enable_rts ( true ) ;
@@ -569,6 +576,12 @@ where
569
576
pub fn disable_clear_to_send ( & mut self ) {
570
577
self . tx . usart . enable_cts ( false ) ;
571
578
}
579
+ pub fn listen_clear_to_send ( & mut self ) {
580
+ self . tx . usart . listen_cts ( true )
581
+ }
582
+ pub fn unlisten_clear_to_send ( & mut self ) {
583
+ self . tx . usart . listen_cts ( false )
584
+ }
572
585
}
573
586
574
587
impl < UART : Instance , WORD > RxISR for Serial < UART , WORD >
0 commit comments