@@ -21,7 +21,7 @@ pub fn render(
2121 let name = util:: name_of ( register) ;
2222 let span = Span :: call_site ( ) ;
2323 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) ;
2525 let name_sc = Ident :: new ( & name. to_sanitized_snake_case ( ) , span) ;
2626 let rsize = register
2727 . size
@@ -57,7 +57,7 @@ pub fn render(
5757 let desc = format ! ( "Reader of register {}" , register. name) ;
5858 mod_items. extend ( quote ! {
5959 #[ doc = #desc]
60- pub type R = crate :: R <super :: #u_name_pc >;
60+ pub type R = crate :: R <#name_uc_spec >;
6161 } ) ;
6262 methods. push ( "read" ) ;
6363 }
@@ -66,7 +66,7 @@ pub fn render(
6666 let desc = format ! ( "Writer for register {}" , register. name) ;
6767 mod_items. extend ( quote ! {
6868 #[ doc = #desc]
69- pub type W = crate :: W <super :: #u_name_pc >;
69+ pub type W = crate :: W <#name_uc_spec >;
7070 } ) ;
7171 methods. push ( "write_with_zero" ) ;
7272 if can_reset {
@@ -138,49 +138,50 @@ pub fn render(
138138
139139 if name_sc != "cfg" {
140140 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" ,
142142 & name_sc
143143 )
144144 . as_str ( ) ;
145145 }
146146 out. extend ( quote ! {
147147 #[ 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 ! {
150151 #[ allow( missing_docs) ]
151152 #[ doc( hidden) ]
152- pub struct #u_name_pc ;
153+ pub struct #name_uc_spec ;
153154
154- impl crate :: RegisterSpec for #u_name_pc {
155+ impl crate :: RegisterSpec for #name_uc_spec {
155156 type Ux = #rty;
156157 }
157158 } ) ;
158159
159160 if can_read {
160161 let doc = format ! (
161- "`read()` method returns [{0}::R]({0}:: R) reader structure" ,
162+ "`read()` method returns [{0}::R](R) reader structure" ,
162163 & name_sc
163164 ) ;
164- out . extend ( quote ! {
165+ mod_items . extend ( quote ! {
165166 #[ doc = #doc]
166- impl crate :: Readable for #u_name_pc { }
167+ impl crate :: Readable for #name_uc_spec { }
167168 } ) ;
168169 }
169170 if can_write {
170171 let doc = format ! (
171- "`write(|w| ..)` method takes [{0}::W]({0}:: W) writer structure" ,
172+ "`write(|w| ..)` method takes [{0}::W](W) writer structure" ,
172173 & name_sc
173174 ) ;
174- out . extend ( quote ! {
175+ mod_items . extend ( quote ! {
175176 #[ doc = #doc]
176- impl crate :: Writable for #u_name_pc { }
177+ impl crate :: Writable for #name_uc_spec { }
177178 } ) ;
178179 }
179180 if let Some ( rv) = res_val. map ( util:: hex) {
180181 let doc = format ! ( "`reset()` method sets {} to value {}" , register. name, & rv) ;
181- out . extend ( quote ! {
182+ mod_items . extend ( quote ! {
182183 #[ doc = #doc]
183- impl crate :: Resettable for #u_name_pc {
184+ impl crate :: Resettable for #name_uc_spec {
184185 #[ inline( always) ]
185186 fn reset_value( ) -> Self :: Ux { #rv }
186187 }
0 commit comments