22 lines
488 B
Rust
Raw Normal View History

2023-07-18 18:03:45 +03:00
//! Device management and interfaces
use abi::error::Error;
pub mod interrupt;
pub mod platform;
pub mod serial;
pub mod timer;
pub mod tty;
/// General device interface
pub trait Device {
/// Initializes the device to a state where it can be used.
///
/// # Safety
///
/// Unsafe to call if the device has already been initialized.
unsafe fn init(&self) -> Result<(), Error>;
/// Returns a display name for the device
fn name(&self) -> &'static str;
}