1
1
use core:: marker;
2
2
3
+ /// Raw register type (`u8`, `u16`, `u32`, ...)
3
4
pub trait RawReg :
4
5
Copy
5
6
+ Default
@@ -8,7 +9,9 @@ pub trait RawReg:
8
9
+ core:: ops:: Not < Output = Self >
9
10
+ core:: ops:: Shl < u8 , Output = Self >
10
11
{
12
+ /// Mask for bits of width `WI`
11
13
fn mask < const WI : u8 > ( ) -> Self ;
14
+ /// Mask for bits of width 1
12
15
fn one ( ) -> Self ;
13
16
}
14
17
@@ -549,6 +552,7 @@ where
549
552
unsafe { self . bits ( variant. into ( ) ) }
550
553
}
551
554
}
555
+
552
556
impl < ' a , U , REG , N , FI , const WI : u8 , const OF : u8 > FieldWriterSafe < ' a , U , REG , N , FI , WI , OF >
553
557
where
554
558
REG : Writable + RegisterSpec < Ux = U > ,
@@ -569,13 +573,15 @@ where
569
573
self . bits ( variant. into ( ) )
570
574
}
571
575
}
576
+
572
577
impl_bit_proxy ! ( BitWriter ) ;
573
578
impl_bit_proxy ! ( BitWriter1S ) ;
574
579
impl_bit_proxy ! ( BitWriter0C ) ;
575
580
impl_bit_proxy ! ( BitWriter1C ) ;
576
581
impl_bit_proxy ! ( BitWriter0S ) ;
577
582
impl_bit_proxy ! ( BitWriter1T ) ;
578
583
impl_bit_proxy ! ( BitWriter0T ) ;
584
+
579
585
impl < ' a , U , REG , FI , const OF : u8 > BitWriter < ' a , U , REG , FI , OF >
580
586
where
581
587
REG : Writable + RegisterSpec < Ux = U > ,
@@ -594,6 +600,7 @@ where
594
600
self . bit ( false )
595
601
}
596
602
}
603
+
597
604
impl < ' a , U , REG , FI , const OF : u8 > BitWriter1S < ' a , U , REG , FI , OF >
598
605
where
599
606
REG : Writable + RegisterSpec < Ux = U > ,
@@ -607,6 +614,7 @@ where
607
614
self . bit ( true )
608
615
}
609
616
}
617
+
610
618
impl < ' a , U , REG , FI , const OF : u8 > BitWriter0C < ' a , U , REG , FI , OF >
611
619
where
612
620
REG : Writable + RegisterSpec < Ux = U > ,
@@ -620,6 +628,7 @@ where
620
628
self . bit ( false )
621
629
}
622
630
}
631
+
623
632
impl < ' a , U , REG , FI , const OF : u8 > BitWriter1C < ' a , U , REG , FI , OF >
624
633
where
625
634
REG : Writable + RegisterSpec < Ux = U > ,
@@ -633,6 +642,7 @@ where
633
642
self . bit ( true )
634
643
}
635
644
}
645
+
636
646
impl < ' a , U , REG , FI , const OF : u8 > BitWriter0S < ' a , U , REG , FI , OF >
637
647
where
638
648
REG : Writable + RegisterSpec < Ux = U > ,
@@ -646,6 +656,7 @@ where
646
656
self . bit ( false )
647
657
}
648
658
}
659
+
649
660
impl < ' a , U , REG , FI , const OF : u8 > BitWriter1T < ' a , U , REG , FI , OF >
650
661
where
651
662
REG : Writable + RegisterSpec < Ux = U > ,
@@ -659,6 +670,7 @@ where
659
670
self . bit ( true )
660
671
}
661
672
}
673
+
662
674
impl < ' a , U , REG , FI , const OF : u8 > BitWriter0T < ' a , U , REG , FI , OF >
663
675
where
664
676
REG : Writable + RegisterSpec < Ux = U > ,
0 commit comments