File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
13
13
- Add new feature ` feature_group ` which will generate cfg attribute for
14
14
every group name when it is on
15
15
- Sort fields by offset before process
16
- - advanced comments
16
+ - Updated docs for ` write ` / ` modify `
17
17
18
18
## [ v0.24.1] - 2022-07-04
19
19
Original file line number Diff line number Diff line change @@ -99,6 +99,14 @@ impl<REG: Resettable + Writable> Reg<REG> {
99
99
/// .field3().variant(VARIANT)
100
100
/// );
101
101
/// ```
102
+ /// or an alternative way of saying the same:
103
+ /// ```ignore
104
+ /// periph.reg.write(|w| {
105
+ /// w.field1().bits(newfield1bits);
106
+ /// w.field2().set_bit();
107
+ /// w.field3().variant(VARIANT)
108
+ /// });
109
+ /// ```
102
110
/// In the latter case, other fields will be set to their reset value.
103
111
#[ inline( always) ]
104
112
pub fn write < F > ( & self , f : F )
@@ -154,6 +162,14 @@ impl<REG: Readable + Writable> Reg<REG> {
154
162
/// .field3().variant(VARIANT)
155
163
/// );
156
164
/// ```
165
+ /// or an alternative way of saying the same:
166
+ /// ```ignore
167
+ /// periph.reg.modify(|_, w| {
168
+ /// w.field1().bits(newfield1bits);
169
+ /// w.field2().set_bit();
170
+ /// w.field3().variant(VARIANT)
171
+ /// });
172
+ /// ```
157
173
/// Other fields will have the value they had before the call to `modify`.
158
174
#[ inline( always) ]
159
175
pub fn modify < F > ( & self , f : F )
You can’t perform that action at this time.
0 commit comments