@@ -59,20 +59,14 @@ pub trait FieldSpec: Sized {
5959/// Trait implemented by readable registers to enable the `read` method. 
6060/// 
6161/// Registers marked with `Writable` can be also be `modify`'ed. 
62- pub  trait  Readable :  RegisterSpec  { 
63-     /// Result from a call to `read` and argument to `modify`. 
64- type  Reader :  From < R < Self > >  + core:: ops:: Deref < Target  = R < Self > > ; 
65- } 
62+ pub  trait  Readable :  RegisterSpec  { } 
6663
6764/// Trait implemented by writeable registers. 
6865/// 
6966/// This enables the  `write`, `write_with_zero` and `reset` methods. 
7067/// 
7168/// Registers marked with `Readable` can be also be `modify`'ed. 
7269pub  trait  Writable :  RegisterSpec  { 
73-     /// Writer type argument to `write`, et al. 
74- type  Writer :  From < W < Self > >  + core:: ops:: DerefMut < Target  = W < Self > > ; 
75- 
7670    /// Specifies the register bits that are not changed if you pass `1` and are changed if you pass `0` 
7771const  ZERO_TO_MODIFY_FIELDS_BITMAP :  Self :: Ux ; 
7872
@@ -130,11 +124,11 @@ impl<REG: Readable> Reg<REG> {
130124/// let flag = reader.field2().bit_is_set(); 
131125/// ``` 
132126#[ inline( always) ]  
133-     pub  fn  read ( & self )  -> REG :: Reader  { 
134-         REG :: Reader :: from ( R  { 
127+     pub  fn  read ( & self )  -> R < REG >  { 
128+         R  { 
135129            bits :  self . register . get ( ) , 
136130            _reg :  marker:: PhantomData , 
137-         } ) 
131+         } 
138132    } 
139133} 
140134
@@ -173,14 +167,14 @@ impl<REG: Resettable + Writable> Reg<REG> {
173167#[ inline( always) ]  
174168    pub  fn  write < F > ( & self ,  f :  F ) 
175169    where 
176-         F :  FnOnce ( & mut  REG :: Writer )  -> & mut  W < REG > , 
170+         F :  FnOnce ( & mut  W < REG > )  -> & mut  W < REG > , 
177171    { 
178172        self . register . set ( 
179-             f ( & mut  REG :: Writer :: from ( W  { 
173+             f ( & mut  W  { 
180174                bits :  REG :: RESET_VALUE  &  !REG :: ONE_TO_MODIFY_FIELDS_BITMAP 
181175                    | REG :: ZERO_TO_MODIFY_FIELDS_BITMAP , 
182176                _reg :  marker:: PhantomData , 
183-             } ) ) 
177+             } ) 
184178            . bits , 
185179        ) ; 
186180    } 
@@ -197,13 +191,13 @@ impl<REG: Writable> Reg<REG> {
197191#[ inline( always) ]  
198192    pub  unsafe  fn  write_with_zero < F > ( & self ,  f :  F ) 
199193    where 
200-         F :  FnOnce ( & mut  REG :: Writer )  -> & mut  W < REG > , 
194+         F :  FnOnce ( & mut  W < REG > )  -> & mut  W < REG > , 
201195    { 
202196        self . register . set ( 
203-             f ( & mut  REG :: Writer :: from ( W  { 
197+             f ( & mut  W  { 
204198                bits :  REG :: Ux :: default ( ) , 
205199                _reg :  marker:: PhantomData , 
206-             } ) ) 
200+             } ) 
207201            . bits , 
208202        ) ; 
209203    } 
@@ -238,20 +232,20 @@ impl<REG: Readable + Writable> Reg<REG> {
238232#[ inline( always) ]  
239233    pub  fn  modify < F > ( & self ,  f :  F ) 
240234    where 
241-         for < ' w >  F :  FnOnce ( & REG :: Reader ,  & ' w  mut  REG :: Writer )  -> & ' w  mut  W < REG > , 
235+         for < ' w >  F :  FnOnce ( & R < REG > ,  & ' w  mut  W < REG > )  -> & ' w  mut  W < REG > , 
242236    { 
243237        let  bits = self . register . get ( ) ; 
244238        self . register . set ( 
245239            f ( 
246-                 & REG :: Reader :: from ( R  { 
240+                 & R  { 
247241                    bits, 
248242                    _reg :  marker:: PhantomData , 
249-                 } ) , 
250-                 & mut  REG :: Writer :: from ( W  { 
243+                 } , 
244+                 & mut  W  { 
251245                    bits :  bits &  !REG :: ONE_TO_MODIFY_FIELDS_BITMAP 
252246                        | REG :: ZERO_TO_MODIFY_FIELDS_BITMAP , 
253247                    _reg :  marker:: PhantomData , 
254-                 } ) , 
248+                 } , 
255249            ) 
256250            . bits , 
257251        ) ; 
@@ -414,7 +408,7 @@ where
414408    REG :  Writable  + RegisterSpec , 
415409    FI :  FieldSpec , 
416410{ 
417-     pub ( crate )  w :  & ' a  mut  REG :: Writer , 
411+     pub ( crate )  w :  & ' a  mut  W < REG > , 
418412    _field :  marker:: PhantomData < ( FI ,  Safety ) > , 
419413} 
420414
@@ -427,7 +421,7 @@ where
427421    /// Creates a new instance of the writer 
428422#[ allow( unused) ]  
429423    #[ inline( always) ]  
430-     pub ( crate )  fn  new ( w :  & ' a  mut  REG :: Writer )  -> Self  { 
424+     pub ( crate )  fn  new ( w :  & ' a  mut  W < REG > )  -> Self  { 
431425        Self  { 
432426            w, 
433427            _field :  marker:: PhantomData , 
@@ -441,7 +435,7 @@ where
441435    REG :  Writable  + RegisterSpec , 
442436    bool :  From < FI > , 
443437{ 
444-     pub ( crate )  w :  & ' a  mut  REG :: Writer , 
438+     pub ( crate )  w :  & ' a  mut  W < REG > , 
445439    _field :  marker:: PhantomData < ( FI ,  M ) > , 
446440} 
447441
@@ -453,7 +447,7 @@ where
453447    /// Creates a new instance of the writer 
454448#[ allow( unused) ]  
455449    #[ inline( always) ]  
456-     pub ( crate )  fn  new ( w :  & ' a  mut  REG :: Writer )  -> Self  { 
450+     pub ( crate )  fn  new ( w :  & ' a  mut  W < REG > )  -> Self  { 
457451        Self  { 
458452            w, 
459453            _field :  marker:: PhantomData , 
@@ -514,14 +508,14 @@ macro_rules! impl_bit_proxy {
514508        { 
515509            /// Writes bit to the field 
516510[ inline( always) ] 
517-             pub  fn  bit( self ,  value:  bool )  -> & ' a mut  REG :: Writer  { 
511+             pub  fn  bit( self ,  value:  bool )  -> & ' a mut  W < REG >  { 
518512                self . w. bits &= !( REG :: Ux :: one( )  << OF ) ; 
519513                self . w. bits |= ( REG :: Ux :: from( value)  &  REG :: Ux :: one( ) )  << OF ; 
520514                self . w
521515            } 
522516            /// Writes `variant` to the field 
523517[ inline( always) ] 
524-             pub  fn  variant( self ,  variant:  FI )  -> & ' a mut  REG :: Writer  { 
518+             pub  fn  variant( self ,  variant:  FI )  -> & ' a mut  W < REG >  { 
525519                self . bit( bool :: from( variant) ) 
526520            } 
527521        } 
@@ -548,14 +542,14 @@ where
548542/// 
549543/// Passing incorrect value can cause undefined behaviour. See reference manual 
550544#[ inline( always) ]  
551-     pub  unsafe  fn  bits ( self ,  value :  FI :: Ux )  -> & ' a  mut  REG :: Writer  { 
545+     pub  unsafe  fn  bits ( self ,  value :  FI :: Ux )  -> & ' a  mut  W < REG >  { 
552546        self . w . bits  &= !( REG :: Ux :: mask :: < WI > ( )  << OF ) ; 
553547        self . w . bits  |= ( REG :: Ux :: from ( value)  &  REG :: Ux :: mask :: < WI > ( ) )  << OF ; 
554548        self . w 
555549    } 
556550    /// Writes `variant` to the field 
557551#[ inline( always) ]  
558-     pub  fn  variant ( self ,  variant :  FI )  -> & ' a  mut  REG :: Writer  { 
552+     pub  fn  variant ( self ,  variant :  FI )  -> & ' a  mut  W < REG >  { 
559553        unsafe  {  self . bits ( FI :: Ux :: from ( variant) )  } 
560554    } 
561555} 
@@ -567,14 +561,14 @@ where
567561{ 
568562    /// Writes raw bits to the field 
569563#[ inline( always) ]  
570-     pub  fn  bits ( self ,  value :  FI :: Ux )  -> & ' a  mut  REG :: Writer  { 
564+     pub  fn  bits ( self ,  value :  FI :: Ux )  -> & ' a  mut  W < REG >  { 
571565        self . w . bits  &= !( REG :: Ux :: mask :: < WI > ( )  << OF ) ; 
572566        self . w . bits  |= ( REG :: Ux :: from ( value)  &  REG :: Ux :: mask :: < WI > ( ) )  << OF ; 
573567        self . w 
574568    } 
575569    /// Writes `variant` to the field 
576570#[ inline( always) ]  
577-     pub  fn  variant ( self ,  variant :  FI )  -> & ' a  mut  REG :: Writer  { 
571+     pub  fn  variant ( self ,  variant :  FI )  -> & ' a  mut  W < REG >  { 
578572        self . bits ( FI :: Ux :: from ( variant) ) 
579573    } 
580574} 
@@ -594,13 +588,13 @@ where
594588{ 
595589    /// Sets the field bit 
596590#[ inline( always) ]  
597-     pub  fn  set_bit ( self )  -> & ' a  mut  REG :: Writer  { 
591+     pub  fn  set_bit ( self )  -> & ' a  mut  W < REG >  { 
598592        self . w . bits  |= REG :: Ux :: one ( )  << OF ; 
599593        self . w 
600594    } 
601595    /// Clears the field bit 
602596#[ inline( always) ]  
603-     pub  fn  clear_bit ( self )  -> & ' a  mut  REG :: Writer  { 
597+     pub  fn  clear_bit ( self )  -> & ' a  mut  W < REG >  { 
604598        self . w . bits  &= !( REG :: Ux :: one ( )  << OF ) ; 
605599        self . w 
606600    } 
@@ -613,7 +607,7 @@ where
613607{ 
614608    /// Sets the field bit 
615609#[ inline( always) ]  
616-     pub  fn  set_bit ( self )  -> & ' a  mut  REG :: Writer  { 
610+     pub  fn  set_bit ( self )  -> & ' a  mut  W < REG >  { 
617611        self . w . bits  |= REG :: Ux :: one ( )  << OF ; 
618612        self . w 
619613    } 
@@ -626,7 +620,7 @@ where
626620{ 
627621    /// Clears the field bit 
628622#[ inline( always) ]  
629-     pub  fn  clear_bit ( self )  -> & ' a  mut  REG :: Writer  { 
623+     pub  fn  clear_bit ( self )  -> & ' a  mut  W < REG >  { 
630624        self . w . bits  &= !( REG :: Ux :: one ( )  << OF ) ; 
631625        self . w 
632626    } 
@@ -639,7 +633,7 @@ where
639633{ 
640634    ///Clears the field bit by passing one 
641635#[ inline( always) ]  
642-     pub  fn  clear_bit_by_one ( self )  -> & ' a  mut  REG :: Writer  { 
636+     pub  fn  clear_bit_by_one ( self )  -> & ' a  mut  W < REG >  { 
643637        self . w . bits  |= REG :: Ux :: one ( )  << OF ; 
644638        self . w 
645639    } 
@@ -652,7 +646,7 @@ where
652646{ 
653647    ///Sets the field bit by passing zero 
654648#[ inline( always) ]  
655-     pub  fn  set_bit_by_zero ( self )  -> & ' a  mut  REG :: Writer  { 
649+     pub  fn  set_bit_by_zero ( self )  -> & ' a  mut  W < REG >  { 
656650        self . w . bits  &= !( REG :: Ux :: one ( )  << OF ) ; 
657651        self . w 
658652    } 
@@ -665,7 +659,7 @@ where
665659{ 
666660    ///Toggle the field bit by passing one 
667661#[ inline( always) ]  
668-     pub  fn  toggle_bit ( self )  -> & ' a  mut  REG :: Writer  { 
662+     pub  fn  toggle_bit ( self )  -> & ' a  mut  W < REG >  { 
669663        self . w . bits  |= REG :: Ux :: one ( )  << OF ; 
670664        self . w 
671665    } 
@@ -678,7 +672,7 @@ where
678672{ 
679673    ///Toggle the field bit by passing zero 
680674#[ inline( always) ]  
681-     pub  fn  toggle_bit ( self )  -> & ' a  mut  REG :: Writer  { 
675+     pub  fn  toggle_bit ( self )  -> & ' a  mut  W < REG >  { 
682676        self . w . bits  &= !( REG :: Ux :: one ( )  << OF ) ; 
683677        self . w 
684678    } 
0 commit comments