aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2022-08-24 19:42:05 -0700
committerChristian Cunningham <cc@localhost>2022-08-24 19:42:05 -0700
commit7f3d7d9ce9818078b6a4616b4c31a28e2868397b (patch)
tree9d9a0ba47c997d87f0cca5da37c70642d9ed2b4d
parentbb56af20ed036bed8d9d2f8bf68376ce4d55e79a (diff)
GPIO constants in a new mdoule
-rw-r--r--src/gpio.rs4
-rw-r--r--src/kernel.rs1
-rw-r--r--src/uart.rs6
3 files changed, 6 insertions, 5 deletions
diff --git a/src/gpio.rs b/src/gpio.rs
new file mode 100644
index 0000000..5af665b
--- /dev/null
+++ b/src/gpio.rs
@@ -0,0 +1,4 @@
+/// GPIO Register
+pub const GPPUD: u32 = 0x3F200094;
+/// GPIO Clock 0 Register
+pub const GPPUDCLK0: u32 = 0x3F200098;
diff --git a/src/kernel.rs b/src/kernel.rs
index ff33f48..36b6e42 100644
--- a/src/kernel.rs
+++ b/src/kernel.rs
@@ -26,6 +26,7 @@ pub use alloc::string::String;
mod console;
mod cpu;
mod draw;
+mod gpio;
mod mem;
mod panic_wait;
mod print;
diff --git a/src/uart.rs b/src/uart.rs
index fa516a8..e516a6c 100644
--- a/src/uart.rs
+++ b/src/uart.rs
@@ -3,6 +3,7 @@ use crate::cpu::*;
use crate::sync::interface::Mutex;
use crate::sync::NullLock;
use core::fmt;
+use crate::gpio::*;
/// # Data Register
const UART0_DR: u32 = 0x3F201000;
@@ -21,11 +22,6 @@ const UART0_ICR: u32 = 0x3F201044;
/// # Integer Baud Rate Register
const UART0_IBRD: u32 = 0x3F201024;
-/// GPIO Register
-const GPPUD: u32 = 0x3F200094;
-/// GPIO Clock 0 Register
-const GPPUDCLK0: u32 = 0x3F200098;
-
/// # UART Inner Structure
///
/// Keeps record of the console statistics.