diff options
Diffstat (limited to 'src/console.rs')
-rw-r--r-- | src/console.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/console.rs b/src/console.rs new file mode 100644 index 0000000..bcde05a --- /dev/null +++ b/src/console.rs @@ -0,0 +1,18 @@ +pub mod interface { + use core::fmt; + pub trait Write { + fn write_char(&self, c: char); + fn write_fmt(&self, args: fmt::Arguments) -> fmt::Result; + fn flush(&self); + } + + pub trait Statistics { + fn chars_written(&self) -> usize { 0 } + } + + pub trait All: Write + Statistics {} +} + +pub fn console() -> &'static crate::uart::Uart { + &crate::uart::UART_WRITER +} |