@@ -36,8 +36,13 @@ pub trait Instance:
3636 fn set_stopbits ( & self , bits : config:: StopBits ) ;
3737 #[ doc( hidden) ]
3838 #[ inline( always) ]
39- fn peri_address ( ) -> u32 {
40- unsafe { & * Self :: ptr ( ) } . peri_address ( )
39+ fn tx_peri_address ( ) -> u32 {
40+ unsafe { & * Self :: ptr ( ) } . tx_peri_address ( )
41+ }
42+ #[ doc( hidden) ]
43+ #[ inline( always) ]
44+ fn rx_peri_address ( ) -> u32 {
45+ unsafe { & * Self :: ptr ( ) } . rx_peri_address ( )
4146 }
4247}
4348
@@ -143,8 +148,11 @@ pub trait RegisterBlockImpl: crate::Sealed {
143148 self . listen_event ( Some ( Event :: TxEmpty . into ( ) ) , None )
144149 }
145150
146- // PeriAddress
147- fn peri_address ( & self ) -> u32 ;
151+ // PeriAddress for transfer data
152+ fn tx_peri_address ( & self ) -> u32 ;
153+
154+ // PeriAddress for receive data
155+ fn rx_peri_address ( & self ) -> u32 ;
148156
149157 fn enable_dma ( & self , dc : config:: DmaConfig ) ;
150158
@@ -260,7 +268,11 @@ macro_rules! uartCommon {
260268 } ) ;
261269 }
262270
263- fn peri_address( & self ) -> u32 {
271+ fn tx_peri_address( & self ) -> u32 {
272+ self . dr( ) . as_ptr( ) as u32
273+ }
274+
275+ fn rx_peri_address( & self ) -> u32 {
264276 self . dr( ) . as_ptr( ) as u32
265277 }
266278
@@ -636,7 +648,7 @@ impl<UART: Instance, WORD> Serial<UART, WORD> {
636648unsafe impl < UART : Instance > PeriAddress for Rx < UART , u8 > {
637649 #[ inline( always) ]
638650 fn address ( & self ) -> u32 {
639- self . usart . peri_address ( )
651+ self . usart . rx_peri_address ( )
640652 }
641653
642654 type MemSize = u8 ;
@@ -652,7 +664,7 @@ where
652664unsafe impl < UART : Instance > PeriAddress for Tx < UART , u8 > {
653665 #[ inline( always) ]
654666 fn address ( & self ) -> u32 {
655- self . usart . peri_address ( )
667+ self . usart . tx_peri_address ( )
656668 }
657669
658670 type MemSize = u8 ;
0 commit comments