@@ -23,7 +23,7 @@ impl crate::Sealed for RegisterBlockUsart {}
23
23
24
24
// Implemented by all USART/UART instances
25
25
pub trait Instance : crate :: Sealed + rcc:: Enable + rcc:: Reset + rcc:: BusClock + CommonPins {
26
- type RegisterBlock ;
26
+ type RegisterBlock : RegisterBlockImpl ;
27
27
28
28
#[ doc( hidden) ]
29
29
fn ptr ( ) -> * const Self :: RegisterBlock ;
@@ -343,10 +343,7 @@ where
343
343
}
344
344
}
345
345
346
- impl < UART : Instance , WORD > RxISR for Rx < UART , WORD >
347
- where
348
- <UART as Instance >:: RegisterBlock : RegisterBlockImpl ,
349
- {
346
+ impl < UART : Instance , WORD > RxISR for Rx < UART , WORD > {
350
347
fn is_idle ( & self ) -> bool {
351
348
unsafe { ( * UART :: ptr ( ) ) . is_idle ( ) }
352
349
}
@@ -374,18 +371,14 @@ where
374
371
375
372
impl < UART : Instance , WORD > TxISR for Tx < UART , WORD >
376
373
where
377
- <UART as Instance >:: RegisterBlock : RegisterBlockImpl ,
378
374
UART : Deref < Target = <UART as Instance >:: RegisterBlock > ,
379
375
{
380
376
fn is_tx_empty ( & self ) -> bool {
381
377
self . usart . is_tx_empty ( )
382
378
}
383
379
}
384
380
385
- impl < UART : Instance , WORD > RxListen for Rx < UART , WORD >
386
- where
387
- <UART as Instance >:: RegisterBlock : RegisterBlockImpl ,
388
- {
381
+ impl < UART : Instance , WORD > RxListen for Rx < UART , WORD > {
389
382
fn listen ( & mut self ) {
390
383
unsafe { ( * UART :: ptr ( ) ) . listen_rxne ( ) }
391
384
}
@@ -405,7 +398,6 @@ where
405
398
406
399
impl < UART : Instance , WORD > TxListen for Tx < UART , WORD >
407
400
where
408
- <UART as Instance >:: RegisterBlock : RegisterBlockImpl ,
409
401
UART : Deref < Target = <UART as Instance >:: RegisterBlock > ,
410
402
{
411
403
fn listen ( & mut self ) {
@@ -419,7 +411,6 @@ where
419
411
420
412
impl < UART : Instance , WORD > crate :: ClearFlags for Serial < UART , WORD >
421
413
where
422
- <UART as Instance >:: RegisterBlock : RegisterBlockImpl ,
423
414
UART : Deref < Target = <UART as Instance >:: RegisterBlock > ,
424
415
{
425
416
type Flag = CFlag ;
@@ -432,7 +423,6 @@ where
432
423
433
424
impl < UART : Instance , WORD > crate :: ReadFlags for Serial < UART , WORD >
434
425
where
435
- <UART as Instance >:: RegisterBlock : RegisterBlockImpl ,
436
426
UART : Deref < Target = <UART as Instance >:: RegisterBlock > ,
437
427
{
438
428
type Flag = Flag ;
@@ -445,7 +435,6 @@ where
445
435
446
436
impl < UART : Instance , WORD > crate :: Listen for Serial < UART , WORD >
447
437
where
448
- <UART as Instance >:: RegisterBlock : RegisterBlockImpl ,
449
438
UART : Deref < Target = <UART as Instance >:: RegisterBlock > ,
450
439
{
451
440
type Event = Event ;
@@ -479,7 +468,6 @@ where
479
468
480
469
impl < UART : Instance > fmt:: Write for Tx < UART >
481
470
where
482
- <UART as Instance >:: RegisterBlock : RegisterBlockImpl ,
483
471
UART : Deref < Target = <UART as Instance >:: RegisterBlock > ,
484
472
{
485
473
fn write_str ( & mut self , s : & str ) -> fmt:: Result {
@@ -489,10 +477,7 @@ where
489
477
}
490
478
}
491
479
492
- impl < UART : Instance > SerialExt for UART
493
- where
494
- <UART as Instance >:: RegisterBlock : RegisterBlockImpl ,
495
- {
480
+ impl < UART : Instance > SerialExt for UART {
496
481
fn serial < WORD > (
497
482
self ,
498
483
pins : ( impl Into < Self :: Tx < PushPull > > , impl Into < Self :: Rx < PushPull > > ) ,
@@ -525,10 +510,7 @@ where
525
510
}
526
511
}
527
512
528
- impl < UART : Instance , WORD > Serial < UART , WORD >
529
- where
530
- <UART as Instance >:: RegisterBlock : RegisterBlockImpl ,
531
- {
513
+ impl < UART : Instance , WORD > Serial < UART , WORD > {
532
514
pub fn tx (
533
515
usart : UART ,
534
516
tx_pin : impl Into < UART :: Tx < PushPull > > ,
@@ -542,10 +524,7 @@ where
542
524
}
543
525
}
544
526
545
- impl < UART : Instance , WORD > Serial < UART , WORD >
546
- where
547
- <UART as Instance >:: RegisterBlock : RegisterBlockImpl ,
548
- {
527
+ impl < UART : Instance , WORD > Serial < UART , WORD > {
549
528
pub fn rx (
550
529
usart : UART ,
551
530
rx_pin : impl Into < UART :: Rx < PushPull > > ,
@@ -559,10 +538,7 @@ where
559
538
}
560
539
}
561
540
562
- unsafe impl < UART : Instance > PeriAddress for Rx < UART , u8 >
563
- where
564
- <UART as Instance >:: RegisterBlock : RegisterBlockImpl ,
565
- {
541
+ unsafe impl < UART : Instance > PeriAddress for Rx < UART , u8 > {
566
542
#[ inline( always) ]
567
543
fn address ( & self ) -> u32 {
568
544
unsafe { ( * UART :: ptr ( ) ) . peri_address ( ) }
@@ -580,7 +556,6 @@ where
580
556
581
557
unsafe impl < UART : Instance > PeriAddress for Tx < UART , u8 >
582
558
where
583
- <UART as Instance >:: RegisterBlock : RegisterBlockImpl ,
584
559
UART : Deref < Target = <UART as Instance >:: RegisterBlock > ,
585
560
{
586
561
#[ inline( always) ]
0 commit comments