@@ -4,6 +4,7 @@ use core::marker;
4
4
pub trait RawReg :
5
5
Copy
6
6
+ Default
7
+ + From < bool >
7
8
+ core:: ops:: BitOr < Output = Self >
8
9
+ core:: ops:: BitAnd < Output = Self >
9
10
+ core:: ops:: BitOrAssign
@@ -503,7 +504,6 @@ macro_rules! impl_bit_proxy {
503
504
where
504
505
REG : Writable + RegisterSpec <Ux = U >,
505
506
U : RawReg ,
506
- U : From <bool >,
507
507
FI : Into <bool >,
508
508
{
509
509
/// Writes bit to the field
@@ -533,8 +533,7 @@ bit_proxy!(BitWriter0T, Bit0T);
533
533
impl < ' a , U , REG , N , FI , const WI : u8 , const OF : u8 > FieldWriter < ' a , U , REG , N , FI , WI , OF >
534
534
where
535
535
REG : Writable + RegisterSpec < Ux = U > ,
536
- U : RawReg ,
537
- N : Into < U > ,
536
+ U : RawReg + From < N > ,
538
537
FI : Into < N > ,
539
538
{
540
539
/// Writes raw bits to the field
@@ -545,7 +544,7 @@ where
545
544
#[ inline( always) ]
546
545
pub unsafe fn bits ( self , value : N ) -> & ' a mut REG :: Writer {
547
546
self . w . bits &= !( U :: mask :: < WI > ( ) << { OF } ) ;
548
- self . w . bits |= ( value . into ( ) & U :: mask :: < WI > ( ) ) << { OF } ;
547
+ self . w . bits |= ( U :: from ( value ) & U :: mask :: < WI > ( ) ) << { OF } ;
549
548
self . w
550
549
}
551
550
/// Writes `variant` to the field
@@ -557,15 +556,14 @@ where
557
556
impl < ' a , U , REG , N , FI , const WI : u8 , const OF : u8 > FieldWriterSafe < ' a , U , REG , N , FI , WI , OF >
558
557
where
559
558
REG : Writable + RegisterSpec < Ux = U > ,
560
- U : RawReg ,
561
- N : Into < U > ,
559
+ U : RawReg + From < N > ,
562
560
FI : Into < N > ,
563
561
{
564
562
/// Writes raw bits to the field
565
563
#[ inline( always) ]
566
564
pub fn bits ( self , value : N ) -> & ' a mut REG :: Writer {
567
565
self . w . bits &= !( U :: mask :: < WI > ( ) << { OF } ) ;
568
- self . w . bits |= ( value . into ( ) & U :: mask :: < WI > ( ) ) << { OF } ;
566
+ self . w . bits |= ( U :: from ( value ) & U :: mask :: < WI > ( ) ) << { OF } ;
569
567
self . w
570
568
}
571
569
/// Writes `variant` to the field
@@ -587,7 +585,6 @@ impl<'a, U, REG, FI, const OF: u8> BitWriter<'a, U, REG, FI, OF>
587
585
where
588
586
REG : Writable + RegisterSpec < Ux = U > ,
589
587
U : RawReg ,
590
- U : From < bool > ,
591
588
FI : Into < bool > ,
592
589
{
593
590
/// Sets the field bit
@@ -606,7 +603,6 @@ impl<'a, U, REG, FI, const OF: u8> BitWriter1S<'a, U, REG, FI, OF>
606
603
where
607
604
REG : Writable + RegisterSpec < Ux = U > ,
608
605
U : RawReg ,
609
- U : From < bool > ,
610
606
FI : Into < bool > ,
611
607
{
612
608
/// Sets the field bit
@@ -620,7 +616,6 @@ impl<'a, U, REG, FI, const OF: u8> BitWriter0C<'a, U, REG, FI, OF>
620
616
where
621
617
REG : Writable + RegisterSpec < Ux = U > ,
622
618
U : RawReg ,
623
- U : From < bool > ,
624
619
FI : Into < bool > ,
625
620
{
626
621
/// Clears the field bit
@@ -634,7 +629,6 @@ impl<'a, U, REG, FI, const OF: u8> BitWriter1C<'a, U, REG, FI, OF>
634
629
where
635
630
REG : Writable + RegisterSpec < Ux = U > ,
636
631
U : RawReg ,
637
- U : From < bool > ,
638
632
FI : Into < bool > ,
639
633
{
640
634
///Clears the field bit by passing one
@@ -648,7 +642,6 @@ impl<'a, U, REG, FI, const OF: u8> BitWriter0S<'a, U, REG, FI, OF>
648
642
where
649
643
REG : Writable + RegisterSpec < Ux = U > ,
650
644
U : RawReg ,
651
- U : From < bool > ,
652
645
FI : Into < bool > ,
653
646
{
654
647
///Sets the field bit by passing zero
@@ -662,7 +655,6 @@ impl<'a, U, REG, FI, const OF: u8> BitWriter1T<'a, U, REG, FI, OF>
662
655
where
663
656
REG : Writable + RegisterSpec < Ux = U > ,
664
657
U : RawReg ,
665
- U : From < bool > ,
666
658
FI : Into < bool > ,
667
659
{
668
660
///Toggle the field bit by passing one
@@ -676,7 +668,6 @@ impl<'a, U, REG, FI, const OF: u8> BitWriter0T<'a, U, REG, FI, OF>
676
668
where
677
669
REG : Writable + RegisterSpec < Ux = U > ,
678
670
U : RawReg ,
679
- U : From < bool > ,
680
671
FI : Into < bool > ,
681
672
{
682
673
///Toggle the field bit by passing zero
0 commit comments