@@ -20,21 +20,67 @@ use crate::svd::{
20
20
#[ cfg_attr( feature = "serde" , derive( serde:: Deserialize , serde:: Serialize ) ) ]
21
21
#[ derive( Clone , Debug , PartialEq ) ]
22
22
pub struct RegisterInfo {
23
+ /// String to identify the register.
24
+ /// Register names are required to be unique within the scope of a peripheral
23
25
pub name : String ,
26
+
27
+ /// Define the address offset relative to the enclosing element
28
+ pub address_offset : u32 ,
29
+
30
+ /// Specifies a group name associated with all alternate register that have the same name
31
+ #[ cfg_attr( feature = "serde" , serde( default ) ) ]
32
+ #[ cfg_attr( feature = "serde" , serde( skip_serializing_if = "Option::is_none" ) ) ]
24
33
pub alternate_group : Option < String > ,
34
+
35
+ /// This tag can reference a register that has been defined above to
36
+ /// current location in the description and that describes the memory location already
37
+ #[ cfg_attr( feature = "serde" , serde( default ) ) ]
38
+ #[ cfg_attr( feature = "serde" , serde( skip_serializing_if = "Option::is_none" ) ) ]
25
39
pub alternate_register : Option < String > ,
40
+
41
+ /// Specify the register name from which to inherit data.
42
+ /// Elements specified subsequently override inherited values
43
+ #[ cfg_attr( feature = "serde" , serde( default ) ) ]
44
+ #[ cfg_attr( feature = "serde" , serde( skip_serializing_if = "Option::is_none" ) ) ]
26
45
pub derived_from : Option < String > ,
46
+
47
+ /// String describing the details of the register
48
+ #[ cfg_attr( feature = "serde" , serde( default ) ) ]
49
+ #[ cfg_attr( feature = "serde" , serde( skip_serializing_if = "Option::is_none" ) ) ]
27
50
pub description : Option < String > ,
28
- pub address_offset : u32 ,
51
+
52
+ #[ cfg_attr( feature = "serde" , serde( default ) ) ]
53
+ #[ cfg_attr( feature = "serde" , serde( skip_serializing_if = "Option::is_none" ) ) ]
29
54
pub size : Option < u32 > ,
55
+
56
+ #[ cfg_attr( feature = "serde" , serde( default ) ) ]
57
+ #[ cfg_attr( feature = "serde" , serde( skip_serializing_if = "Option::is_none" ) ) ]
30
58
pub access : Option < Access > ,
59
+
60
+ #[ cfg_attr( feature = "serde" , serde( default ) ) ]
61
+ #[ cfg_attr( feature = "serde" , serde( skip_serializing_if = "Option::is_none" ) ) ]
31
62
pub reset_value : Option < u32 > ,
63
+
64
+ #[ cfg_attr( feature = "serde" , serde( default ) ) ]
65
+ #[ cfg_attr( feature = "serde" , serde( skip_serializing_if = "Option::is_none" ) ) ]
32
66
pub reset_mask : Option < u32 > ,
67
+
33
68
/// `None` indicates that the `<fields>` node is not present
69
+ #[ cfg_attr( feature = "serde" , serde( default ) ) ]
70
+ #[ cfg_attr( feature = "serde" , serde( skip_serializing_if = "Option::is_none" ) ) ]
34
71
pub fields : Option < Vec < Field > > ,
72
+
73
+ #[ cfg_attr( feature = "serde" , serde( default ) ) ]
74
+ #[ cfg_attr( feature = "serde" , serde( skip_serializing_if = "Option::is_none" ) ) ]
35
75
pub write_constraint : Option < WriteConstraint > ,
76
+
77
+ /// Element to describe the manipulation of data written to a register
78
+ #[ cfg_attr( feature = "serde" , serde( default ) ) ]
79
+ #[ cfg_attr( feature = "serde" , serde( skip_serializing_if = "Option::is_none" ) ) ]
36
80
pub modified_write_values : Option < ModifiedWriteValues > ,
81
+
37
82
// Reserve the right to add more fields to this struct
83
+ #[ cfg_attr( feature = "serde" , serde( skip) ) ]
38
84
pub ( crate ) _extensible : ( ) ,
39
85
}
40
86
0 commit comments