@@ -21,7 +21,7 @@ pub fn render(
21
21
let name = util:: name_of ( register) ;
22
22
let span = Span :: call_site ( ) ;
23
23
let name_pc = Ident :: new ( & name. to_sanitized_upper_case ( ) , span) ;
24
- let u_name_pc = Ident :: new ( & format ! ( "_{} " , & name. to_sanitized_upper_case( ) ) , span) ;
24
+ let name_uc_spec = Ident :: new ( & format ! ( "{}_SPEC " , & name. to_sanitized_upper_case( ) ) , span) ;
25
25
let name_sc = Ident :: new ( & name. to_sanitized_snake_case ( ) , span) ;
26
26
let rsize = register
27
27
. size
@@ -57,7 +57,7 @@ pub fn render(
57
57
let desc = format ! ( "Reader of register {}" , register. name) ;
58
58
mod_items. extend ( quote ! {
59
59
#[ doc = #desc]
60
- pub type R = crate :: R <super :: #u_name_pc >;
60
+ pub type R = crate :: R <#name_uc_spec >;
61
61
} ) ;
62
62
methods. push ( "read" ) ;
63
63
}
@@ -66,7 +66,7 @@ pub fn render(
66
66
let desc = format ! ( "Writer for register {}" , register. name) ;
67
67
mod_items. extend ( quote ! {
68
68
#[ doc = #desc]
69
- pub type W = crate :: W <super :: #u_name_pc >;
69
+ pub type W = crate :: W <#name_uc_spec >;
70
70
} ) ;
71
71
methods. push ( "write_with_zero" ) ;
72
72
if can_reset {
@@ -138,49 +138,50 @@ pub fn render(
138
138
139
139
if name_sc != "cfg" {
140
140
doc += format ! (
141
- "\n \n For information about available fields see [{0}]({0} ) module" ,
141
+ "\n \n For information about available fields see [{0}](index.html ) module" ,
142
142
& name_sc
143
143
)
144
144
. as_str ( ) ;
145
145
}
146
146
out. extend ( quote ! {
147
147
#[ doc = #doc]
148
- pub type #name_pc = crate :: Reg <#u_name_pc>;
149
-
148
+ pub type #name_pc = crate :: Reg <#name_sc:: #name_uc_spec>;
149
+ } ) ;
150
+ mod_items. extend ( quote ! {
150
151
#[ allow( missing_docs) ]
151
152
#[ doc( hidden) ]
152
- pub struct #u_name_pc ;
153
+ pub struct #name_uc_spec ;
153
154
154
- impl crate :: RegisterSpec for #u_name_pc {
155
+ impl crate :: RegisterSpec for #name_uc_spec {
155
156
type Ux = #rty;
156
157
}
157
158
} ) ;
158
159
159
160
if can_read {
160
161
let doc = format ! (
161
- "`read()` method returns [{0}::R]({0}:: R) reader structure" ,
162
+ "`read()` method returns [{0}::R](R) reader structure" ,
162
163
& name_sc
163
164
) ;
164
- out . extend ( quote ! {
165
+ mod_items . extend ( quote ! {
165
166
#[ doc = #doc]
166
- impl crate :: Readable for #u_name_pc { }
167
+ impl crate :: Readable for #name_uc_spec { }
167
168
} ) ;
168
169
}
169
170
if can_write {
170
171
let doc = format ! (
171
- "`write(|w| ..)` method takes [{0}::W]({0}:: W) writer structure" ,
172
+ "`write(|w| ..)` method takes [{0}::W](W) writer structure" ,
172
173
& name_sc
173
174
) ;
174
- out . extend ( quote ! {
175
+ mod_items . extend ( quote ! {
175
176
#[ doc = #doc]
176
- impl crate :: Writable for #u_name_pc { }
177
+ impl crate :: Writable for #name_uc_spec { }
177
178
} ) ;
178
179
}
179
180
if let Some ( rv) = res_val. map ( util:: hex) {
180
181
let doc = format ! ( "`reset()` method sets {} to value {}" , register. name, & rv) ;
181
- out . extend ( quote ! {
182
+ mod_items . extend ( quote ! {
182
183
#[ doc = #doc]
183
- impl crate :: Resettable for #u_name_pc {
184
+ impl crate :: Resettable for #name_uc_spec {
184
185
#[ inline( always) ]
185
186
fn reset_value( ) -> Self :: Ux { #rv }
186
187
}
0 commit comments