浏览代码

Add a few comments, update to `use::super`

dkhayes117 3 年之前
父节点
当前提交
9c3a57fb8b
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      src/register/pmpcfgx.rs

+ 4 - 2
src/register/pmpcfgx.rs

@@ -1,6 +1,7 @@
 /// Physical memory protection configuration
 use bit_field::BitField;
 
+/// Permission enum contains all possible pmp register permission configurations
 #[derive(Clone, Copy, Debug)]
 pub enum Permission {
     NONE = 0,
@@ -13,6 +14,7 @@ pub enum Permission {
     RWX = 7,
 }
 
+/// Range enum contains all possible addressing modes for pmp registers
 #[derive(Clone, Copy, Debug)]
 pub enum Range {
     OFF = 0,
@@ -21,6 +23,7 @@ pub enum Range {
     NAPOT = 3,
 }
 
+/// Pmpconfig struct to hold pmp register's current settings
 #[derive(Clone, Copy, Debug)]
 pub struct Pmpconfig {
     pub permission: Permission,
@@ -66,8 +69,7 @@ impl PmpByte {
     }
 }
 pub mod pmpcfg0 {
-    use crate::register::{Permission, PmpByte, Pmpconfig, Range};
-    use bit_field::BitField;
+   use super::{PmpByte,Pmpconfig,Permission,Range,BitField};
 
     #[derive(Clone, Copy, Debug)]
     pub struct Pmpcfg0 {