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/).
1313- Add new feature ` feature_group ` which will generate cfg attribute for
1414 every group name when it is on
1515- Sort fields by offset before process
16- - advanced comments
16+ - Updated docs for ` write ` / ` modify `
1717
1818## [ v0.24.1] - 2022-07-04
1919
Original file line number Diff line number Diff line change @@ -99,6 +99,14 @@ impl<REG: Resettable + Writable> Reg<REG> {
9999 /// .field3().variant(VARIANT)
100100 /// );
101101 /// ```
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+ /// ```
102110 /// In the latter case, other fields will be set to their reset value.
103111 #[ inline( always) ]
104112 pub fn write < F > ( & self , f : F )
@@ -154,6 +162,14 @@ impl<REG: Readable + Writable> Reg<REG> {
154162 /// .field3().variant(VARIANT)
155163 /// );
156164 /// ```
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+ /// ```
157173 /// Other fields will have the value they had before the call to `modify`.
158174 #[ inline( always) ]
159175 pub fn modify < F > ( & self , f : F )
You can’t perform that action at this time.
0 commit comments