@@ -272,15 +272,22 @@ macro_rules! uartCommon {
272272pub trait RBFlowControlImpl {
273273 fn enable_rts ( & self , state : bool ) ;
274274 fn enable_cts ( & self , state : bool ) ;
275+ fn listen_cts ( & self , state : bool ) ;
275276}
276277
277278impl RBFlowControlImpl for RegisterBlockUsart {
279+ #[ inline( always) ]
278280 fn enable_rts ( & self , state : bool ) {
279281 self . cr3 ( ) . modify ( |_, w| w. rtse ( ) . bit ( state) ) ;
280282 }
283+ #[ inline( always) ]
281284 fn enable_cts ( & self , state : bool ) {
282285 self . cr3 ( ) . modify ( |_, w| w. ctse ( ) . bit ( state) ) ;
283286 }
287+ #[ inline( always) ]
288+ fn listen_cts ( & self , state : bool ) {
289+ self . cr3 ( ) . modify ( |_, w| w. ctsie ( ) . bit ( state) )
290+ }
284291}
285292
286293impl RegisterBlockImpl for RegisterBlockUsart {
@@ -573,6 +580,12 @@ where
573580 pub fn disable_clear_to_send ( & mut self ) {
574581 self . tx . usart . enable_cts ( false ) ;
575582 }
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+ }
576589}
577590
578591impl < UART : Instance , WORD > RxISR for Serial < UART , WORD >
0 commit comments