4 releases (breaking)

0.4.0 Mar 11, 2024
0.3.0 Dec 9, 2023
0.2.0 Mar 20, 2023
0.1.0 Aug 29, 2021

#231 in Embedded development

Download history 30/week @ 2024-01-06 53/week @ 2024-01-13 5/week @ 2024-01-20 39/week @ 2024-02-24 66/week @ 2024-03-02 220/week @ 2024-03-09 17/week @ 2024-03-16 4/week @ 2024-03-23 30/week @ 2024-03-30 9/week @ 2024-04-06

136 downloads per month

MIT license

7KB
162 lines

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());
    }
}

lib.rs:

NS16550A UART driver.

No runtime deps