mango_hal/io/serial/port.rs
1pub struct Serial
2{
3 port: uart_16550::SerialPort,
4}
5
6impl Serial
7{
8 pub fn new(port: u16) -> Serial
9 {
10 unsafe {
11 Serial {
12 port: uart_16550::SerialPort::new(port),
13 }
14 }
15 }
16 pub fn initialise(&self) {}
17}
18use core::fmt;
19
20impl fmt::Write for Serial
21{
22 fn write_str(&mut self, s: &str) -> fmt::Result
23 {
24 self.port.write_str(s)
25 }
26}