aboutsummaryrefslogtreecommitdiff
path: root/src/console.rs
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2022-08-26 17:25:34 -0700
committerChristian Cunningham <cc@localhost>2022-08-26 17:25:34 -0700
commita04cf2dbb8d2e890405fbf0a1022aaad3015b1e8 (patch)
tree381892074d13c059d50cb88caa41f8a8722c07ce /src/console.rs
parent7f3d7d9ce9818078b6a4616b4c31a28e2868397b (diff)
Modularize
Diffstat (limited to 'src/console.rs')
-rw-r--r--src/console.rs57
1 files changed, 0 insertions, 57 deletions
diff --git a/src/console.rs b/src/console.rs
deleted file mode 100644
index ae3e62b..0000000
--- a/src/console.rs
+++ /dev/null
@@ -1,57 +0,0 @@
-//! # UART Console module
-//!
-//! ## Encapsulates base trait for any console.
-//! ## Wraps the UART console.
-
-/// # Interface module
-///
-/// ## Provides trait for consoles.
-pub mod interface {
- use core::fmt;
- /// # Write Trait
- ///
- /// Structure must provide ways to:
- /// - Write individual characters
- /// - Write formatted strings
- /// - Flush write queue
- pub trait Write {
- /// # Write Character
- ///
- /// Writes an individual character to a console
- fn write_char(&self, c: char);
- /// # Write Format
- ///
- /// Writes a formatted string to a console
- fn write_fmt(&self, args: fmt::Arguments) -> fmt::Result;
- /// # Flush
- ///
- /// Flush console write queue
- fn flush(&self);
- }
-
- /// # Statistics Trait
- ///
- /// Structure must provide a way to:
- /// - Get how many characters have been written
- pub trait Statistics {
- /// # Get Written Chars
- ///
- /// Gets the statistic associated with how many
- /// characters have been written to a console.
- fn chars_written(&self) -> usize {
- 0
- }
- }
-
- /// # All Trait
- ///
- /// Structure must provide both Write + Statistics
- pub trait All: Write + Statistics {}
-}
-
-/// # UART console
-///
-/// Returns a borrow for the UART writer
-pub fn console() -> &'static crate::uart::Uart {
- &crate::uart::UART_WRITER
-}