@@ -268,15 +268,22 @@ macro_rules! uartCommon {
268268pub trait RBFlowControlImpl {
269269 fn enable_rts ( & self , state : bool ) ;
270270 fn enable_cts ( & self , state : bool ) ;
271+ fn listen_cts ( & self , state : bool ) ;
271272}
272273
273274impl RBFlowControlImpl for RegisterBlockUsart {
275+ #[ inline( always) ]
274276 fn enable_rts ( & self , state : bool ) {
275277 self . cr3 ( ) . modify ( |_, w| w. rtse ( ) . bit ( state) ) ;
276278 }
279+ #[ inline( always) ]
277280 fn enable_cts ( & self , state : bool ) {
278281 self . cr3 ( ) . modify ( |_, w| w. ctse ( ) . bit ( state) ) ;
279282 }
283+ #[ inline( always) ]
284+ fn listen_cts ( & self , state : bool ) {
285+ self . cr3 ( ) . modify ( |_, w| w. ctsie ( ) . bit ( state) )
286+ }
280287}
281288
282289impl RegisterBlockImpl for RegisterBlockUsart {
@@ -545,7 +552,7 @@ where {
545552
546553impl < UART : Instance + SerialFlowControl , WORD > Serial < UART , WORD >
547554where
548- UART :: RegisterBlock : RBFlowControlImpl ,
555+ UART :: RB : RBFlowControlImpl ,
549556{
550557 pub fn with_rts ( self , rts : impl Into < UART :: Rts > ) -> Self {
551558 self . rx . usart . enable_rts ( true ) ;
@@ -569,6 +576,12 @@ where
569576 pub fn disable_clear_to_send ( & mut self ) {
570577 self . tx . usart . enable_cts ( false ) ;
571578 }
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+ }
572585}
573586
574587impl < UART : Instance , WORD > RxISR for Serial < UART , WORD >
0 commit comments