Commit 4790ff4 1 parent ea02ce9 commit 4790ff4 Copy full SHA for 4790ff4
File tree 3 files changed +12
-1
lines changed
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/).
7
7
8
8
## [ Unreleased]
9
9
10
+ - Add unsafe ` write_bits ` to all writtable registers
10
11
- Revert #711
11
12
- Add ` defmt ` impls for ` TryFromInterruptError ` , riscv interrupt enums
12
13
- 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 {
478
478
pub const fn width( & self ) -> u8 {
479
479
Self :: WIDTH
480
480
}
481
-
481
+
482
482
/// Field offset
483
483
#[ inline( always) ]
484
484
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> {
179
179
180
180
result
181
181
}
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
+ }
182
192
}
183
193
184
194
impl < REG : Readable + Writable > Reg < REG > {
You can’t perform that action at this time.
0 commit comments