File tree Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
77
88## [ Unreleased]  
99
10+ -  Add unsafe ` write_bits `  to all writtable registers
1011-  Revert #711  
1112-  Add ` defmt `  impls for ` TryFromInterruptError ` , riscv interrupt enums
1213-  Fix calculating ` modifiedWriteValues `  bitmasks with field arrays
Original file line number Diff line number Diff line change @@ -478,7 +478,7 @@ macro_rules! bit_proxy {
478478            pub  const  fn  width( & self )  -> u8  { 
479479                Self :: WIDTH 
480480            } 
481-          
481+ 
482482            /// Field offset 
483483[ inline( always) ] 
484484            pub  const  fn  offset( & self )  -> u8  { 
Original file line number Diff line number Diff line change @@ -179,6 +179,16 @@ impl<REG: Writable> Reg<REG> {
179179
180180        result
181181    } 
182+ 
183+     /// Writes raw value to register. 
184+ /// 
185+ /// # Safety 
186+ /// 
187+ /// Unsafe as it passes value without checks. 
188+ #[ inline( always) ]  
189+     pub  unsafe  fn  write_bits ( & self ,  bits :  REG :: Ux )  { 
190+         self . register . set ( bits) ; 
191+     } 
182192} 
183193
184194impl < REG :  Readable  + Writable >  Reg < REG >  { 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments