| Crates.io | ns16550a |
| lib.rs | ns16550a |
| version | 0.5.0 |
| created_at | 2021-08-29 14:32:36.304316+00 |
| updated_at | 2025-03-10 19:22:58.38484+00 |
| description | NS16550A UART driver. |
| homepage | |
| repository | https://github.com/jeudine/NS16550A |
| max_upload_size | |
| id | 443763 |
| size | 7,933 |
NS16550A UART driver written in Rust.
Add the following to Cargo.toml:
ns16550a = "0.5"
Example usage:
use ns16550a::*;
fn main() {
let mut uart = Uart::new(0x1000_0000);
uart.init(WordLength::EIGHT,
StopBits::ONE,
ParityBit::DISABLE,
ParitySelect::EVEN,
StickParity::DISABLE,
Break::DISABLE,
DMAMode::MODE0,
Divisor::BAUD1200,
);
write!(&mut uart, "Hello, world!\n\r");
loop {
uart.put(uart.get().unwrap_or_default());
}
}