Skip to content

Commit 7e9056a

Browse files
committed
docs
1 parent 383ab91 commit 7e9056a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/generate/register.rs

+13
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,11 @@ pub fn render(
5959
.ok_or_else(|| format!("Register {} has no reset value", register.name))?;
6060

6161
let desc = format!("Writer for register {}", register.name);
62+
let doc = format!("Register {} `reset()`'s with value {}", register.name, &rv);
6263
mod_items.push(quote! {
6364
#[doc = #desc]
6465
pub type W = crate::W<#rty, super::#name_pc>;
66+
#[doc = #doc]
6567
impl crate::ResetValue<#rty> for super::#name_pc {
6668
#[inline(always)]
6769
fn reset_value() -> #rty { #rv }
@@ -130,22 +132,33 @@ pub fn render(
130132
}
131133

132134
let mut out = vec![];
135+
let doc = if name_sc != "cfg" {
136+
format!("For information about avaliable fields see [{0}]({0}) module", &name_sc)
137+
} else {
138+
"".to_string()
139+
};
133140
out.push(quote! {
134141
#[doc = #description]
142+
///
143+
#[doc = #doc]
135144
pub type #name_pc = crate::Reg<#rty, #_name_pc>;
136145

137146
#[allow(missing_docs)]
138147
#[doc(hidden)]
139148
pub struct #_name_pc;
140149
});
141150

151+
let doc = format!("`read()` method returns [{0}::R]({0}::R) reader structure", &name_sc);
142152
if can_read {
143153
out.push(quote! {
154+
#[doc = #doc]
144155
impl crate::Readable for #name_pc {}
145156
});
146157
}
158+
let doc = format!("`write(|w| ..)` method takes [{0}::W]({0}::W) writer structure", &name_sc);
147159
if can_write {
148160
out.push(quote! {
161+
#[doc = #doc]
149162
impl crate::Writable for #name_pc {}
150163
});
151164
}

0 commit comments

Comments
 (0)