@@ -86,7 +86,7 @@ pub mod fpb;
86
86
// NOTE(target_arch) is for documentation purposes
87
87
#[ cfg( any( has_fpu, target_arch = "x86_64" ) ) ]
88
88
pub mod fpu;
89
- #[ cfg( not( armv6m) ) ]
89
+ #[ cfg( all ( not( armv6m) , not ( armv8m_base ) ) ) ]
90
90
pub mod itm;
91
91
pub mod mpu;
92
92
pub mod nvic;
@@ -103,7 +103,9 @@ mod test;
103
103
/// Core peripherals
104
104
#[ allow( non_snake_case) ]
105
105
pub struct Peripherals {
106
- /// Cache and branch predictor maintenance operations (not present on Cortex-M0 variants)
106
+ /// Cache and branch predictor maintenance operations.
107
+ /// Not available on Armv6-M.
108
+ #[ cfg( not( armv6m) ) ]
107
109
pub CBP : CBP ,
108
110
109
111
/// CPUID
@@ -115,13 +117,19 @@ pub struct Peripherals {
115
117
/// Data Watchpoint and Trace unit
116
118
pub DWT : DWT ,
117
119
118
- /// Flash Patch and Breakpoint unit (not present on Cortex-M0 variants)
120
+ /// Flash Patch and Breakpoint unit.
121
+ /// Not available on Armv6-M.
122
+ #[ cfg( not( armv6m) ) ]
119
123
pub FPB : FPB ,
120
124
121
- /// Floating Point Unit (only present on `thumbv7em-none-eabihf`)
125
+ /// Floating Point Unit.
126
+ /// Available only on `hf` targets.
127
+ #[ cfg( any( has_fpu, target_arch = "x86_64" ) ) ]
122
128
pub FPU : FPU ,
123
129
124
- /// Instrumentation Trace Macrocell (not present on Cortex-M0 variants)
130
+ /// Instrumentation Trace Macrocell.
131
+ /// Not available on Armv6-M and Armv8-M Baseline.
132
+ #[ cfg( all( not( armv6m) , not( armv8m_base) ) ) ]
125
133
pub ITM : ITM ,
126
134
127
135
/// Memory Protection Unit
@@ -136,7 +144,9 @@ pub struct Peripherals {
136
144
/// SysTick: System Timer
137
145
pub SYST : SYST ,
138
146
139
- /// Trace Port Interface Unit (not present on Cortex-M0 variants)
147
+ /// Trace Port Interface Unit.
148
+ /// Not available on Armv6-M.
149
+ #[ cfg( not( armv6m) ) ]
140
150
pub TPIU : TPIU ,
141
151
}
142
152
@@ -164,6 +174,7 @@ impl Peripherals {
164
174
CORE_PERIPHERALS = true ;
165
175
166
176
Peripherals {
177
+ #[ cfg( not( armv6m) ) ]
167
178
CBP : CBP {
168
179
_marker : PhantomData ,
169
180
} ,
@@ -176,12 +187,15 @@ impl Peripherals {
176
187
DWT : DWT {
177
188
_marker : PhantomData ,
178
189
} ,
190
+ #[ cfg( not( armv6m) ) ]
179
191
FPB : FPB {
180
192
_marker : PhantomData ,
181
193
} ,
194
+ #[ cfg( any( has_fpu, target_arch = "x86_64" ) ) ]
182
195
FPU : FPU {
183
196
_marker : PhantomData ,
184
197
} ,
198
+ #[ cfg( all( not( armv6m) , not( armv8m_base) ) ) ]
185
199
ITM : ITM {
186
200
_marker : PhantomData ,
187
201
} ,
@@ -197,6 +211,7 @@ impl Peripherals {
197
211
SYST : SYST {
198
212
_marker : PhantomData ,
199
213
} ,
214
+ #[ cfg( not( armv6m) ) ]
200
215
TPIU : TPIU {
201
216
_marker : PhantomData ,
202
217
} ,
@@ -205,10 +220,12 @@ impl Peripherals {
205
220
}
206
221
207
222
/// Cache and branch predictor maintenance operations
223
+ #[ cfg( not( armv6m) ) ]
208
224
pub struct CBP {
209
225
_marker : PhantomData < * const ( ) > ,
210
226
}
211
227
228
+ #[ cfg( not( armv6m) ) ]
212
229
unsafe impl Send for CBP { }
213
230
214
231
#[ cfg( not( armv6m) ) ]
@@ -310,10 +327,12 @@ impl ops::Deref for DWT {
310
327
}
311
328
312
329
/// Flash Patch and Breakpoint unit
330
+ #[ cfg( not( armv6m) ) ]
313
331
pub struct FPB {
314
332
_marker : PhantomData < * const ( ) > ,
315
333
}
316
334
335
+ #[ cfg( not( armv6m) ) ]
317
336
unsafe impl Send for FPB { }
318
337
319
338
#[ cfg( not( armv6m) ) ]
@@ -336,10 +355,12 @@ impl ops::Deref for FPB {
336
355
}
337
356
338
357
/// Floating Point Unit
358
+ #[ cfg( any( has_fpu, target_arch = "x86_64" ) ) ]
339
359
pub struct FPU {
340
360
_marker : PhantomData < * const ( ) > ,
341
361
}
342
362
363
+ #[ cfg( any( has_fpu, target_arch = "x86_64" ) ) ]
343
364
unsafe impl Send for FPU { }
344
365
345
366
#[ cfg( any( has_fpu, target_arch = "x86_64" ) ) ]
@@ -362,13 +383,15 @@ impl ops::Deref for FPU {
362
383
}
363
384
364
385
/// Instrumentation Trace Macrocell
386
+ #[ cfg( all( not( armv6m) , not( armv8m_base) ) ) ]
365
387
pub struct ITM {
366
388
_marker : PhantomData < * const ( ) > ,
367
389
}
368
390
391
+ #[ cfg( all( not( armv6m) , not( armv8m_base) ) ) ]
369
392
unsafe impl Send for ITM { }
370
393
371
- #[ cfg( not( armv6m) ) ]
394
+ #[ cfg( all ( not( armv6m) , not ( armv8m_base ) ) ) ]
372
395
impl ITM {
373
396
/// Returns a pointer to the register block
374
397
#[ inline( always) ]
@@ -377,7 +400,7 @@ impl ITM {
377
400
}
378
401
}
379
402
380
- #[ cfg( not( armv6m) ) ]
403
+ #[ cfg( all ( not( armv6m) , not ( armv8m_base ) ) ) ]
381
404
impl ops:: Deref for ITM {
382
405
type Target = self :: itm:: RegisterBlock ;
383
406
@@ -387,7 +410,7 @@ impl ops::Deref for ITM {
387
410
}
388
411
}
389
412
390
- #[ cfg( not( armv6m) ) ]
413
+ #[ cfg( all ( not( armv6m) , not ( armv8m_base ) ) ) ]
391
414
impl ops:: DerefMut for ITM {
392
415
#[ inline( always) ]
393
416
fn deref_mut ( & mut self ) -> & mut Self :: Target {
@@ -492,10 +515,12 @@ impl ops::Deref for SYST {
492
515
}
493
516
494
517
/// Trace Port Interface Unit
518
+ #[ cfg( not( armv6m) ) ]
495
519
pub struct TPIU {
496
520
_marker : PhantomData < * const ( ) > ,
497
521
}
498
522
523
+ #[ cfg( not( armv6m) ) ]
499
524
unsafe impl Send for TPIU { }
500
525
501
526
#[ cfg( not( armv6m) ) ]
0 commit comments