Skip to content

Commit 6afe71a

Browse files
committed
Move register writer bits method to end and add doc comment
1 parent 3919651 commit 6afe71a

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/generate/register.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,6 @@ pub fn render(
8080
#[doc = #desc]
8181
pub struct W(crate::W<#name_pc>);
8282

83-
impl W {
84-
pub unsafe fn bits(&mut self, bits: #rty) -> &mut Self {
85-
self.0.bits(bits);
86-
self
87-
}
88-
}
89-
9083
impl core::ops::Deref for W {
9184
type Target = crate::W<#name_pc>;
9285

@@ -172,6 +165,14 @@ pub fn render(
172165

173166
mod_items.extend(w_impl_items);
174167

168+
mod_items.extend(quote! {
169+
#[doc = "Writes raw bits to the register."]
170+
pub unsafe fn bits(&mut self, bits: #rty) -> &mut Self {
171+
self.0.bits(bits);
172+
self
173+
}
174+
});
175+
175176
close.to_tokens(&mut mod_items);
176177
}
177178

0 commit comments

Comments
 (0)