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

#707 in Hardware support

Download history 54/week @ 2024-10-26 30/week @ 2024-11-02 12/week @ 2024-11-09 26/week @ 2024-11-16 9/week @ 2024-11-23 16/week @ 2024-11-30 45/week @ 2024-12-07 28/week @ 2024-12-14 9/week @ 2024-12-21 3/week @ 2024-12-28 20/week @ 2025-01-04 24/week @ 2025-01-11 31/week @ 2025-01-18 29/week @ 2025-01-25 46/week @ 2025-02-01 31/week @ 2025-02-08

140 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