We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d279d1a commit d6bff9cCopy full SHA for d6bff9c
src/lib.rs
@@ -1,5 +1,9 @@
1
+//! Minimal support for uart_16550 serial output.
2
+
3
#![no_std]
4
5
+#![warn(missing_docs)]
6
7
#[macro_use]
8
extern crate bitflags;
9
extern crate x86_64;
@@ -28,6 +32,7 @@ bitflags! {
28
32
}
29
33
30
34
35
+/// An interface to a serial port that allows sending out individual bytes.
31
36
pub struct SerialPort {
37
data: Port<u8>,
38
int_en: Port<u8>,
@@ -53,6 +58,7 @@ impl SerialPort {
53
58
54
59
55
60
61
+ /// Initializes the serial port.
56
62
pub fn init(&mut self) {
57
63
unsafe {
64
self.int_en.write(0x00);
@@ -70,6 +76,7 @@ impl SerialPort {
70
76
unsafe { LineStsFlags::from_bits_truncate(self.line_sts.read()) }
71
77
72
78
79
+ /// Sends a byte on the serial port.
73
80
pub fn send(&mut self, data: u8) {
74
81
75
82
match data {
0 commit comments