@@ -24,30 +24,26 @@ impl crate::Sealed for RegisterBlockUsart {}
2424// Implemented by all USART/UART instances
2525pub trait Instance :
2626 crate :: Sealed
27+ + crate :: Ptr < RB : RegisterBlockImpl >
28+ + crate :: Steal
29+ + core:: ops:: Deref < Target = Self :: RB >
2730 + rcc:: Enable
2831 + rcc:: Reset
2932 + rcc:: BusClock
3033 + CommonPins
31- + core:: ops:: Deref < Target = Self :: RegisterBlock >
3234{
33- type RegisterBlock : RegisterBlockImpl ;
34-
35- #[ doc( hidden) ]
36- fn ptr ( ) -> * const Self :: RegisterBlock ;
3735 #[ doc( hidden) ]
3836 fn set_stopbits ( & self , bits : config:: StopBits ) ;
3937 #[ doc( hidden) ]
4038 #[ inline( always) ]
4139 fn peri_address ( ) -> u32 {
4240 unsafe { & * Self :: ptr ( ) } . peri_address ( )
4341 }
44- #[ doc( hidden) ]
45- unsafe fn steal ( ) -> Self ;
4642}
4743
4844pub trait RegisterBlockImpl : crate :: Sealed {
4945 #[ allow( clippy:: new_ret_no_self) ]
50- fn new < UART : Instance < RegisterBlock = Self > , WORD > (
46+ fn new < UART : Instance + crate :: Ptr < RB = Self > , WORD > (
5147 uart : UART ,
5248 pins : ( impl Into < UART :: Tx < PushPull > > , impl Into < UART :: Rx < PushPull > > ) ,
5349 config : impl Into < config:: Config > ,
@@ -267,7 +263,7 @@ macro_rules! uartCommon {
267263}
268264
269265impl RegisterBlockImpl for RegisterBlockUsart {
270- fn new < UART : Instance < RegisterBlock = Self > , WORD > (
266+ fn new < UART : Instance + crate :: Ptr < RB = Self > , WORD > (
271267 uart : UART ,
272268 pins : ( impl Into < UART :: Tx < PushPull > > , impl Into < UART :: Rx < PushPull > > ) ,
273269 config : impl Into < config:: Config > ,
@@ -408,7 +404,7 @@ where {
408404
409405#[ cfg( feature = "uart4" ) ]
410406impl RegisterBlockImpl for RegisterBlockUart {
411- fn new < UART : Instance < RegisterBlock = Self > , WORD > (
407+ fn new < UART : Instance + crate :: Ptr < RB = Self > , WORD > (
412408 uart : UART ,
413409 pins : ( impl Into < UART :: Tx < PushPull > > , impl Into < UART :: Rx < PushPull > > ) ,
414410 config : impl Into < config:: Config > ,
0 commit comments