aboutsummaryrefslogtreecommitdiff
path: root/src/peripheral/mpu.rs
diff options
context:
space:
mode:
authorGravatar Jorge Aparicio <japaricious@gmail.com> 2016-09-27 18:35:29 -0500
committerGravatar Jorge Aparicio <japaricious@gmail.com> 2016-09-27 18:35:29 -0500
commitddc7f255b57d0e6aeb9f3b1b7466b2e5c0c5fff0 (patch)
treeac8332c9d63b45082f81ce419045c9b16db1b270 /src/peripheral/mpu.rs
downloadcortex-m-ddc7f255b57d0e6aeb9f3b1b7466b2e5c0c5fff0.tar.gz
cortex-m-ddc7f255b57d0e6aeb9f3b1b7466b2e5c0c5fff0.tar.zst
cortex-m-ddc7f255b57d0e6aeb9f3b1b7466b2e5c0c5fff0.zip
initial commit
Diffstat (limited to 'src/peripheral/mpu.rs')
-rw-r--r--src/peripheral/mpu.rs30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/peripheral/mpu.rs b/src/peripheral/mpu.rs
new file mode 100644
index 0000000..e024e62
--- /dev/null
+++ b/src/peripheral/mpu.rs
@@ -0,0 +1,30 @@
+//! Memory Protection Unit
+
+use volatile_register::{RO, RW};
+
+/// Registers
+#[repr(C)]
+pub struct Registers {
+ /// Type
+ pub _type: RO<u32>,
+ /// Control
+ pub ctrl: RW<u32>,
+ /// Region Number
+ pub rnr: RW<u32>,
+ /// Region Base Address
+ pub rbar: RW<u32>,
+ /// Region Attribute and Size
+ pub rasr: RW<u32>,
+ /// Alias 1 of RBAR
+ pub rbar_a1: RW<u32>,
+ /// Alias 1 of RSAR
+ pub rsar_a1: RW<u32>,
+ /// Alias 2 of RBAR
+ pub rbar_a2: RW<u32>,
+ /// Alias 2 of RSAR
+ pub rsar_a2: RW<u32>,
+ /// Alias 3 of RBAR
+ pub rbar_a3: RW<u32>,
+ /// Alias 3 of RSAR
+ pub rsar_a3: RW<u32>,
+}