@@ -111,34 +111,40 @@ mod test;
111
111
/// Core peripherals
112
112
#[ allow( non_snake_case) ]
113
113
pub struct Peripherals {
114
- /// Cache and branch predictor maintenance operations
115
- #[ cfg( not( armv6m) ) ]
114
+ /// Cache and branch predictor maintenance operations (not present on Cortex-M0 variants)
116
115
pub CBP : CBP ,
116
+
117
117
/// CPUID
118
118
pub CPUID : CPUID ,
119
+
119
120
/// Debug Control Block
120
121
pub DCB : DCB ,
122
+
121
123
/// Data Watchpoint and Trace unit
122
124
pub DWT : DWT ,
123
- /// Flash Patch and Breakpoint unit
124
- # [ cfg ( not( armv6m ) ) ]
125
+
126
+ /// Flash Patch and Breakpoint unit (not present on Cortex-M0 variants)
125
127
pub FPB : FPB ,
126
- /// Floating Point Unit
127
- # [ cfg ( any ( has_fpu , target_arch = "x86_64" ) ) ]
128
+
129
+ /// Floating Point Unit (only present on `thumbv7em-none-eabihf`)
128
130
pub FPU : FPU ,
129
- /// Instrumentation Trace Macrocell
130
- # [ cfg ( not( armv6m ) ) ]
131
+
132
+ /// Instrumentation Trace Macrocell (not present on Cortex-M0 variants)
131
133
pub ITM : ITM ,
134
+
132
135
/// Memory Protection Unit
133
136
pub MPU : MPU ,
137
+
134
138
/// Nested Vector Interrupt Controller
135
139
pub NVIC : NVIC ,
140
+
136
141
/// System Control Block
137
142
pub SCB : SCB ,
143
+
138
144
/// SysTick: System Timer
139
145
pub SYST : SYST ,
140
- /// Trace Port Interface Unit;
141
- # [ cfg ( not( armv6m ) ) ]
146
+
147
+ /// Trace Port Interface Unit (not present on Cortex-M0 variants)
142
148
pub TPIU : TPIU ,
143
149
}
144
150
@@ -167,7 +173,6 @@ impl Peripherals {
167
173
CORE_PERIPHERALS = true ;
168
174
169
175
Peripherals {
170
- #[ cfg( not( armv6m) ) ]
171
176
CBP : CBP {
172
177
_marker : PhantomData ,
173
178
} ,
@@ -180,15 +185,12 @@ impl Peripherals {
180
185
DWT : DWT {
181
186
_marker : PhantomData ,
182
187
} ,
183
- #[ cfg( not( armv6m) ) ]
184
188
FPB : FPB {
185
189
_marker : PhantomData ,
186
190
} ,
187
- #[ cfg( any( has_fpu, target_arch = "x86_64" ) ) ]
188
191
FPU : FPU {
189
192
_marker : PhantomData ,
190
193
} ,
191
- #[ cfg( not( armv6m) ) ]
192
194
ITM : ITM {
193
195
_marker : PhantomData ,
194
196
} ,
@@ -204,7 +206,6 @@ impl Peripherals {
204
206
SYST : SYST {
205
207
_marker : PhantomData ,
206
208
} ,
207
- #[ cfg( not( armv6m) ) ]
208
209
TPIU : TPIU {
209
210
_marker : PhantomData ,
210
211
} ,
@@ -213,14 +214,10 @@ impl Peripherals {
213
214
}
214
215
215
216
/// Cache and branch predictor maintenance operations
216
- ///
217
- /// *NOTE* Available only on ARMv7-M (`thumbv7*m-none-eabi*`)
218
- #[ cfg( not( armv6m) ) ]
219
217
pub struct CBP {
220
218
_marker : PhantomData < * const ( ) > ,
221
219
}
222
220
223
- #[ cfg( not( armv6m) ) ]
224
221
unsafe impl Send for CBP { }
225
222
226
223
#[ cfg( not( armv6m) ) ]
@@ -313,14 +310,10 @@ impl ops::Deref for DWT {
313
310
}
314
311
315
312
/// Flash Patch and Breakpoint unit
316
- ///
317
- /// *NOTE* Available only on ARMv7-M (`thumbv7*m-none-eabi*`)
318
- #[ cfg( not( armv6m) ) ]
319
313
pub struct FPB {
320
314
_marker : PhantomData < * const ( ) > ,
321
315
}
322
316
323
- #[ cfg( not( armv6m) ) ]
324
317
unsafe impl Send for FPB { }
325
318
326
319
#[ cfg( not( armv6m) ) ]
@@ -341,14 +334,10 @@ impl ops::Deref for FPB {
341
334
}
342
335
343
336
/// Floating Point Unit
344
- ///
345
- /// *NOTE* Available only on ARMv7E-M (`thumbv7em-none-eabihf`)
346
- #[ cfg( any( has_fpu, target_arch = "x86_64" ) ) ]
347
337
pub struct FPU {
348
338
_marker : PhantomData < * const ( ) > ,
349
339
}
350
340
351
- #[ cfg( any( has_fpu, target_arch = "x86_64" ) ) ]
352
341
unsafe impl Send for FPU { }
353
342
354
343
#[ cfg( any( has_fpu, target_arch = "x86_64" ) ) ]
@@ -369,14 +358,10 @@ impl ops::Deref for FPU {
369
358
}
370
359
371
360
/// Instrumentation Trace Macrocell
372
- ///
373
- /// *NOTE* Available only on ARMv7-M (`thumbv7*m-none-eabi*`)
374
- #[ cfg( not( armv6m) ) ]
375
361
pub struct ITM {
376
362
_marker : PhantomData < * const ( ) > ,
377
363
}
378
364
379
- #[ cfg( not( armv6m) ) ]
380
365
unsafe impl Send for ITM { }
381
366
382
367
#[ cfg( not( armv6m) ) ]
@@ -491,15 +476,11 @@ impl ops::Deref for SYST {
491
476
}
492
477
}
493
478
494
- /// Trace Port Interface Unit;
495
- ///
496
- /// *NOTE* Available only on ARMv7-M (`thumbv7*m-none-eabi*`)
497
- #[ cfg( not( armv6m) ) ]
479
+ /// Trace Port Interface Unit
498
480
pub struct TPIU {
499
481
_marker : PhantomData < * const ( ) > ,
500
482
}
501
483
502
- #[ cfg( not( armv6m) ) ]
503
484
unsafe impl Send for TPIU { }
504
485
505
486
#[ cfg( not( armv6m) ) ]
0 commit comments