11use crate :: svd:: {
2- Access , BitRange , DeriveFrom , EnumeratedValues , Field , Peripheral , Register ,
2+ Access , BitRange , DeriveFrom , EnumeratedValues , Field , Peripheral , ReadAction , Register ,
33 RegisterProperties , Usage , WriteConstraint ,
44} ;
55use cast:: u64;
@@ -217,6 +217,18 @@ pub fn render(
217217 )
218218 . as_str ( ) ;
219219 }
220+
221+ if can_read {
222+ if let Some ( action) = register. read_action {
223+ doc += match action {
224+ ReadAction :: Clear => "\n \n The register is **cleared** (set to zero) following a read operation." ,
225+ ReadAction :: Set => "\n \n The register is **set** (set to ones) following a read operation." ,
226+ ReadAction :: Modify => "\n \n The register is **modified** in some way after a read operation." ,
227+ ReadAction :: ModifyExternal => "\n \n One or more dependent resources other than the current register are immediately affected by a read operation." ,
228+ } ;
229+ }
230+ }
231+
220232 let alias_doc = format ! (
221233 "{} register accessor: an alias for `Reg<{}>`" ,
222234 name, name_uc_spec,
@@ -379,7 +391,7 @@ pub fn fields(
379391 } ;
380392
381393 if can_read {
382- let readerdoc = if let Some ( ( _, _, _, _, suffixes_str) ) = & field_dim {
394+ let mut readerdoc = if let Some ( ( _, _, _, _, suffixes_str) ) = & field_dim {
383395 format ! (
384396 "Fields `{}` reader - {}" ,
385397 util:: replace_suffix( & f. name, suffixes_str) ,
@@ -388,6 +400,14 @@ pub fn fields(
388400 } else {
389401 format ! ( "Field `{}` reader - {}" , f. name, description)
390402 } ;
403+ if let Some ( action) = f. read_action {
404+ readerdoc += match action {
405+ ReadAction :: Clear => "\n \n The field is **cleared** (set to zero) following a read operation." ,
406+ ReadAction :: Set => "\n \n The field is **set** (set to ones) following a read operation." ,
407+ ReadAction :: Modify => "\n \n The field is **modified** in some way after a read operation." ,
408+ ReadAction :: ModifyExternal => "\n \n One or more dependent resources other than the current field are immediately affected by a read operation." ,
409+ } ;
410+ }
391411
392412 let name_pc_r = Ident :: new ( & ( name_pc. clone ( ) + "_R" ) , span) ;
393413
0 commit comments