@@ -16,41 +16,41 @@ use interrupt::{CriticalSection, Nr};
16
16
mod test;
17
17
18
18
/// CPUID
19
- pub const CPUID : Peripheral < Cpuid > = unsafe { Peripheral :: new ( 0xE000_ED00 ) } ;
19
+ pub const CPUID : Peripheral < CPUID > = unsafe { Peripheral :: new ( 0xE000_ED00 ) } ;
20
20
21
21
/// Debug Control Block
22
- pub const DCB : Peripheral < Dcb > = unsafe { Peripheral :: new ( 0xE000_EDF0 ) } ;
22
+ pub const DCB : Peripheral < DCB > = unsafe { Peripheral :: new ( 0xE000_EDF0 ) } ;
23
23
24
24
/// Data Watchpoint and Trace unit
25
- pub const DWT : Peripheral < Dwt > = unsafe { Peripheral :: new ( 0xE000_1000 ) } ;
25
+ pub const DWT : Peripheral < DWT > = unsafe { Peripheral :: new ( 0xE000_1000 ) } ;
26
26
27
27
/// Flash Patch and Breakpoint unit
28
- pub const FPB : Peripheral < Fpb > = unsafe { Peripheral :: new ( 0xE000_2000 ) } ;
28
+ pub const FPB : Peripheral < FPB > = unsafe { Peripheral :: new ( 0xE000_2000 ) } ;
29
29
30
30
/// Floating Point Unit
31
- pub const FPU : Peripheral < Fpu > = unsafe { Peripheral :: new ( 0xE000_EF30 ) } ;
31
+ pub const FPU : Peripheral < FPU > = unsafe { Peripheral :: new ( 0xE000_EF30 ) } ;
32
32
33
33
/// Instrumentation Trace Macrocell
34
- pub const ITM : Peripheral < Itm > = unsafe { Peripheral :: new ( 0xE000_0000 ) } ;
34
+ pub const ITM : Peripheral < ITM > = unsafe { Peripheral :: new ( 0xE000_0000 ) } ;
35
35
36
36
/// Memory Protection Unit
37
- pub const MPU : Peripheral < Mpu > = unsafe { Peripheral :: new ( 0xE000_ED90 ) } ;
37
+ pub const MPU : Peripheral < MPU > = unsafe { Peripheral :: new ( 0xE000_ED90 ) } ;
38
38
39
39
/// Nested Vector Interrupt Controller
40
- pub const NVIC : Peripheral < Nvic > = unsafe { Peripheral :: new ( 0xE000_E100 ) } ;
40
+ pub const NVIC : Peripheral < NVIC > = unsafe { Peripheral :: new ( 0xE000_E100 ) } ;
41
41
42
42
/// System Control Block
43
- pub const SCB : Peripheral < Scb > = unsafe { Peripheral :: new ( 0xE000_ED04 ) } ;
43
+ pub const SCB : Peripheral < SCB > = unsafe { Peripheral :: new ( 0xE000_ED04 ) } ;
44
44
45
45
/// SysTick: System Timer
46
- pub const SYST : Peripheral < Syst > = unsafe { Peripheral :: new ( 0xE000_E010 ) } ;
46
+ pub const SYST : Peripheral < SYST > = unsafe { Peripheral :: new ( 0xE000_E010 ) } ;
47
47
48
48
/// Trace Port Interface Unit;
49
- pub const TPIU : Peripheral < Tpiu > = unsafe { Peripheral :: new ( 0xE004_0000 ) } ;
49
+ pub const TPIU : Peripheral < TPIU > = unsafe { Peripheral :: new ( 0xE004_0000 ) } ;
50
50
51
51
/// Cache and branch predictor maintenance operations
52
52
#[ cfg( armv7m) ]
53
- pub const CBP : Peripheral < Cbp > = unsafe { Peripheral :: new ( 0xE000_EF50 ) } ;
53
+ pub const CBP : Peripheral < CBP > = unsafe { Peripheral :: new ( 0xE000_EF50 ) } ;
54
54
55
55
// TODO stand-alone registers: ICTR, ACTLR and STIR
56
56
@@ -88,7 +88,7 @@ impl<T> Peripheral<T> {
88
88
89
89
/// CPUID register block
90
90
#[ repr( C ) ]
91
- pub struct Cpuid {
91
+ pub struct CPUID {
92
92
/// CPUID base
93
93
pub base : RO < u32 > ,
94
94
reserved0 : [ u32 ; 15 ] ,
@@ -159,7 +159,7 @@ impl Cpuid {
159
159
160
160
/// DCB register block
161
161
#[ repr( C ) ]
162
- pub struct Dcb {
162
+ pub struct DCB {
163
163
/// Debug Halting Control and Status
164
164
pub dhcsr : RW < u32 > ,
165
165
/// Debug Core Register Selector
@@ -172,7 +172,7 @@ pub struct Dcb {
172
172
173
173
/// DWT register block
174
174
#[ repr( C ) ]
175
- pub struct Dwt {
175
+ pub struct DWT {
176
176
/// Control
177
177
pub ctrl : RW < u32 > ,
178
178
/// Cycle Count
@@ -198,7 +198,7 @@ pub struct Dwt {
198
198
pub lsr : RO < u32 > ,
199
199
}
200
200
201
- impl Dwt {
201
+ impl DWT {
202
202
/// Enables the cycle counter
203
203
pub fn enable_cycle_counter ( & self ) {
204
204
unsafe { self . ctrl . modify ( |r| r | 1 ) }
@@ -219,7 +219,7 @@ pub struct Comparator {
219
219
220
220
/// FPB register block
221
221
#[ repr( C ) ]
222
- pub struct Fpb {
222
+ pub struct FPB {
223
223
/// Control
224
224
pub ctrl : RW < u32 > ,
225
225
/// Remap
@@ -235,7 +235,7 @@ pub struct Fpb {
235
235
236
236
/// FPU register block
237
237
#[ repr( C ) ]
238
- pub struct Fpu {
238
+ pub struct FPU {
239
239
reserved : u32 ,
240
240
/// Floating Point Context Control
241
241
pub fpccr : RW < u32 > ,
@@ -249,7 +249,7 @@ pub struct Fpu {
249
249
250
250
/// ITM register block
251
251
#[ repr( C ) ]
252
- pub struct Itm {
252
+ pub struct ITM {
253
253
/// Stimulus Port
254
254
pub stim : [ Stim ; 256 ] ,
255
255
reserved0 : [ u32 ; 640 ] ,
@@ -297,7 +297,7 @@ impl Stim {
297
297
298
298
/// MPU register block
299
299
#[ repr( C ) ]
300
- pub struct Mpu {
300
+ pub struct MPU {
301
301
/// Type
302
302
pub _type : RO < u32 > ,
303
303
/// Control
@@ -324,7 +324,7 @@ pub struct Mpu {
324
324
325
325
/// NVIC register block
326
326
#[ repr( C ) ]
327
- pub struct Nvic {
327
+ pub struct NVIC {
328
328
/// Interrupt Set-Enable
329
329
pub iser : [ RW < u32 > ; 8 ] ,
330
330
reserved0 : [ u32 ; 24 ] ,
@@ -344,7 +344,7 @@ pub struct Nvic {
344
344
pub ipr : [ RW < u8 > ; 240 ] ,
345
345
}
346
346
347
- impl Nvic {
347
+ impl NVIC {
348
348
/// Clears `interrupt`'s pending state
349
349
pub fn clear_pending < I > ( & self , interrupt : I )
350
350
where
@@ -448,7 +448,7 @@ impl Nvic {
448
448
449
449
/// SCB register block
450
450
#[ repr( C ) ]
451
- pub struct Scb {
451
+ pub struct SCB {
452
452
/// Interrupt Control and State
453
453
pub icsr : RW < u32 > ,
454
454
/// Vector Table Offset
@@ -495,7 +495,7 @@ const SCB_CPACR_FPU_MASK: u32 = 0b11_11 << 20;
495
495
const SCB_CPACR_FPU_ENABLE : u32 = 0b01_01 << 20 ;
496
496
const SCB_CPACR_FPU_USER : u32 = 0b10_10 << 20 ;
497
497
498
- impl Scb {
498
+ impl SCB {
499
499
/// Gets FPU access mode
500
500
pub fn fpu_access_mode ( & self ) -> FpuAccessMode {
501
501
let cpacr = self . cpacr . read ( ) ;
@@ -817,7 +817,7 @@ impl Scb {
817
817
818
818
/// SysTick register block
819
819
#[ repr( C ) ]
820
- pub struct Syst {
820
+ pub struct SYST {
821
821
/// Control and Status
822
822
pub csr : RW < u32 > ,
823
823
/// Reload Value
@@ -847,7 +847,7 @@ const SYST_CSR_COUNTFLAG: u32 = 1 << 16;
847
847
const SYST_CALIB_SKEW : u32 = 1 << 30 ;
848
848
const SYST_CALIB_NOREF : u32 = 1 << 31 ;
849
849
850
- impl Syst {
850
+ impl SYST {
851
851
/// Checks if counter is enabled
852
852
pub fn is_counter_enabled ( & self ) -> bool {
853
853
self . csr . read ( ) & SYST_CSR_ENABLE != 0
@@ -955,7 +955,7 @@ impl Syst {
955
955
956
956
/// TPIU register block
957
957
#[ repr( C ) ]
958
- pub struct Tpiu {
958
+ pub struct TPIU {
959
959
/// Supported Parallel Port Sizes
960
960
pub sspsr : RO < u32 > ,
961
961
/// Current Parallel Port Size
@@ -979,7 +979,7 @@ pub struct Tpiu {
979
979
/// Cache and branch predictor maintenance operations register block
980
980
#[ repr( C ) ]
981
981
#[ cfg( armv7m) ]
982
- pub struct Cbp {
982
+ pub struct CBP {
983
983
/// I-cache invalidate all to PoU
984
984
pub iciallu : WO < u32 > ,
985
985
reserved0 : u32 ,
0 commit comments