ns16550a

Crates.ions16550a
lib.rsns16550a
version0.4.0
sourcesrc
created_at2021-08-29 14:32:36.304316
updated_at2024-03-11 18:38:05.386143
descriptionNS16550A UART driver.
homepage
repositoryhttps://github.com/jeudine/NS16550A
max_upload_size
id443763
size7,510
Julien Eudine (jeudine)

documentation

https://docs.rs/ns16550a

README

NS16550A

Crates.io docs.rs GitHub

NS16550A UART driver written in Rust.

Installation

Add the following to Cargo.toml:

ns16550a = "0.4"

Example

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());
    }
}
Commit count: 18

cargo fmt