@@ -3,7 +3,7 @@ use core::marker;
33/// Raw register type (`u8`, `u16`, `u32`, ...)
44pub trait RawReg :
55 Copy
6- + Default
6+ + num_traits :: ConstZero
77 + From < bool >
88 + core:: ops:: BitOr < Output = Self >
99 + core:: ops:: BitAnd < Output = Self >
@@ -74,10 +74,10 @@ pub trait Writable: RegisterSpec {
7474 type Safety ;
7575
7676 /// Specifies the register bits that are not changed if you pass `1` and are changed if you pass `0`
77- const ZERO_TO_MODIFY_FIELDS_BITMAP : Self :: Ux ;
77+ const ZERO_TO_MODIFY_FIELDS_BITMAP : Self :: Ux = Self :: Ux :: ZERO ;
7878
7979 /// Specifies the register bits that are not changed if you pass `0` and are changed if you pass `1`
80- const ONE_TO_MODIFY_FIELDS_BITMAP : Self :: Ux ;
80+ const ONE_TO_MODIFY_FIELDS_BITMAP : Self :: Ux = Self :: Ux :: ZERO ;
8181}
8282
8383/// Reset value of the register.
@@ -86,7 +86,7 @@ pub trait Writable: RegisterSpec {
8686/// register by using the `reset` method.
8787pub trait Resettable : RegisterSpec {
8888 /// Reset value of the register.
89- const RESET_VALUE : Self :: Ux ;
89+ const RESET_VALUE : Self :: Ux = Self :: Ux :: ZERO ;
9090
9191 /// Reset value of the register.
9292 #[ inline( always) ]
@@ -247,7 +247,10 @@ impl<REG: Writable> W<REG> {
247247 self
248248 }
249249}
250- impl < REG > W < REG > where REG : Writable < Safety = Safe > {
250+ impl < REG > W < REG >
251+ where
252+ REG : Writable < Safety = Safe > ,
253+ {
251254 /// Writes raw bits to the register.
252255 #[ inline( always) ]
253256 pub fn set ( & mut self , bits : REG :: Ux ) -> & mut Self {
@@ -335,7 +338,8 @@ pub struct RangeFrom<const MIN: u64>;
335338pub struct RangeTo < const MAX : u64 > ;
336339
337340/// Write field Proxy
338- pub type FieldWriter < ' a , REG , const WI : u8 , FI = u8 , Safety = Unsafe > = raw:: FieldWriter < ' a , REG , WI , FI , Safety > ;
341+ pub type FieldWriter < ' a , REG , const WI : u8 , FI = u8 , Safety = Unsafe > =
342+ raw:: FieldWriter < ' a , REG , WI , FI , Safety > ;
339343
340344impl < ' a , REG , const WI : u8 , FI , Safety > FieldWriter < ' a , REG , WI , FI , Safety >
341345where
@@ -390,7 +394,8 @@ where
390394 }
391395}
392396
393- impl < ' a , REG , const WI : u8 , FI , const MIN : u64 , const MAX : u64 > FieldWriter < ' a , REG , WI , FI , Range < MIN , MAX > >
397+ impl < ' a , REG , const WI : u8 , FI , const MIN : u64 , const MAX : u64 >
398+ FieldWriter < ' a , REG , WI , FI , Range < MIN , MAX > >
394399where
395400 REG : Writable + RegisterSpec ,
396401 FI : FieldSpec ,
@@ -478,7 +483,7 @@ macro_rules! bit_proxy {
478483 pub const fn width( & self ) -> u8 {
479484 Self :: WIDTH
480485 }
481-
486+
482487 /// Field offset
483488 #[ inline( always) ]
484489 pub const fn offset( & self ) -> u8 {
0 commit comments