@@ -71,12 +71,15 @@ pub(crate) struct PeriInstance<I = EmptyInstanceConfig> {
71
71
}
72
72
73
73
/// A single cell in the peripheral support table.
74
+ #[ derive( Default ) ]
74
75
pub ( crate ) struct SupportItem {
75
76
/// The human-readable name of the driver in the table (leftmost cell.)
76
77
pub name : & ' static str ,
77
78
/// The ID of the driver ([device.<config_group>]) in the TOML, that this
78
79
/// item corresponds to.
79
80
pub config_group : & ' static str ,
81
+ /// If true, this driver is not shown in the peripheral support table.
82
+ pub hide_from_peri_table : bool ,
80
83
}
81
84
82
85
/// Define driver configuration structs, and a PeriConfig struct
@@ -88,6 +91,9 @@ macro_rules! driver_configs {
88
91
( @property ( Option <u32 >) $self: ident, $config: ident) => { Value :: from( $self. $config) } ;
89
92
( @property ( $( $other: ty) * ) $self: ident, $config: ident) => { Value :: Unset } ; // Not a property
90
93
94
+ ( @default $default: literal) => { $default } ;
95
+ ( @default $default: literal $opt: literal) => { $opt } ;
96
+
91
97
// Creates a single struct
92
98
( @one
93
99
$struct: ident $( <$instance_config: ident>) ? ( $group: ident) {
@@ -129,6 +135,7 @@ macro_rules! driver_configs {
129
135
driver: $driver: ident,
130
136
// Driver name, used in the generated documentation.
131
137
name: $name: literal,
138
+ $( hide_from_peri_table: $hide: literal, ) ?
132
139
$( has_computed_properties: $computed: literal, ) ?
133
140
properties: $tokens: tt
134
141
} ,
@@ -156,6 +163,7 @@ macro_rules! driver_configs {
156
163
SupportItem {
157
164
name: $name,
158
165
config_group: stringify!( $driver) ,
166
+ hide_from_peri_table: driver_configs!( @default false $( $hide) ?) ,
159
167
} ,
160
168
) +
161
169
]
@@ -224,6 +232,13 @@ macro_rules! driver_configs {
224
232
225
233
// TODO: sort this similar to how the product portfolio is organized
226
234
driver_configs ! [
235
+ SocProperties {
236
+ driver: soc,
237
+ name: "SOC" ,
238
+ hide_from_peri_table: true ,
239
+ properties: { }
240
+ } ,
241
+
227
242
AdcProperties {
228
243
driver: adc,
229
244
name: "ADC" ,
0 commit comments