Add ns16550a
This commit is contained in:
parent
fef12c79f1
commit
704eae3bb0
16 changed files with 311 additions and 129 deletions
17
os/src/drivers/chardev/mod.rs
Normal file
17
os/src/drivers/chardev/mod.rs
Normal file
|
@ -0,0 +1,17 @@
|
|||
mod ns16550a;
|
||||
|
||||
pub use ns16550a::NS16550a;
|
||||
|
||||
use crate::board::CharDeviceImpl;
|
||||
use alloc::sync::Arc;
|
||||
use lazy_static::*;
|
||||
|
||||
pub trait CharDevice {
|
||||
fn read(&self) -> u8;
|
||||
fn write(&self, ch: u8);
|
||||
fn handle_irq(&self);
|
||||
}
|
||||
|
||||
lazy_static! {
|
||||
pub static ref UART: Arc<CharDeviceImpl> = Arc::new(CharDeviceImpl::new());
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue