Skip to content

Commit d6bff9c

Browse files
committed
Add missing documentation
1 parent d279d1a commit d6bff9c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
//! Minimal support for uart_16550 serial output.
2+
13
#![no_std]
24

5+
#![warn(missing_docs)]
6+
37
#[macro_use]
48
extern crate bitflags;
59
extern crate x86_64;
@@ -28,6 +32,7 @@ bitflags! {
2832
}
2933
}
3034

35+
/// An interface to a serial port that allows sending out individual bytes.
3136
pub struct SerialPort {
3237
data: Port<u8>,
3338
int_en: Port<u8>,
@@ -53,6 +58,7 @@ impl SerialPort {
5358
}
5459
}
5560

61+
/// Initializes the serial port.
5662
pub fn init(&mut self) {
5763
unsafe {
5864
self.int_en.write(0x00);
@@ -70,6 +76,7 @@ impl SerialPort {
7076
unsafe { LineStsFlags::from_bits_truncate(self.line_sts.read()) }
7177
}
7278

79+
/// Sends a byte on the serial port.
7380
pub fn send(&mut self, data: u8) {
7481
unsafe {
7582
match data {

0 commit comments

Comments
 (0)