1 unstable release

0.1.0 Nov 19, 2024

#1527 in Embedded development

Download history 177/week @ 2024-11-16 175/week @ 2024-11-23 118/week @ 2024-11-30 57/week @ 2024-12-07

527 downloads per month

MIT/Apache

15KB
222 lines

pl011-uart

crates.io page docs.rs page

A Rust driver for the Arm PL011 UART.

This is not an officially supported Google product.

Usage

Basic usage of the pl011-uart crate

use pl011_uart::Uart;
use core::fmt::Write;

fn main() {
    // constants required for initializing the UART.
    const PL011_BASE_ADDRESS: *mut u32 = 0x0900_0000 as _;
    const PL011_BAUD_RATE: u32 = 115200;
    const PL011_CLK_IN_HZ: u32 = 50000000;

    // initialize PL011 UART.
    let mut uart = unsafe { Uart::new(PL011_BASE_ADDRESS) };
    uart.init(PL011_CLK_IN_HZ, PL011_BAUD_RATE);

    // write to PL011 UART.
    writeln!(uart, "Hello, World!").unwrap();
}

License

Licensed under either of

at your option.

Contributing

If you want to contribute to the project, see details of how we accept contributions.

Dependencies

~0.3–0.8MB
~19K SLoC